Price changes
Scatter plots are an effective way of illustrating the relationship between two variables. In this exercise, you will examine the relationship between the daily price changes of two ETF funds: the iShares Russell 1000 Growth (IWF) and iShares Russell 2000 (IWM). There is a possibility of a relationship between the two as they both track the same type of index.
The CSV
and DataFrames
packages have been imported for you and the DataFrames iwf
and iwm
have been loaded and are available.
This exercise is part of the course
Introduction to Data Visualization with Julia
Exercise instructions
- First, import the Plots.jl package.
- Define the
price_change
columns for both funds by calculating the difference between theclose
andopen
prices. - Create a scatter plot of the
price_change
's foriwf
(y-axis) versusiwm
(x-axis).
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Import Plots.jl
____ ____
# Define price change
iwf[____, "____"] = iwf.____ - iwf.____
iwm[____, "____"] = iwm.____ - iwm.____
# Scatter plot of price changes
____(
iwm.____,
iwf.____
)