| Weekly | R Documentation |
Weekly percentage returns for the S&P 500 stock index between 1990 and 2010.
Weekly
A data frame with 1089 observations on the following 9 variables.
YearThe year that the observation was recorded
Lag1Percentage return for previous week
Lag2Percentage return for 2 weeks previous
Lag3Percentage return for 3 weeks previous
Lag4Percentage return for 4 weeks previous
Lag5Percentage return for 5 weeks previous
VolumeVolume of shares traded (average number of daily shares traded in billions)
TodayPercentage return for this week
DirectionA factor with levels Down and
Up indicating whether the market had a positive or negative
return on a given week
Raw values of the S&P 500 were obtained from Yahoo Finance and then converted to percentages and lagged.
James, G., Witten, D., Hastie, T., and Tibshirani, R. (2013) An Introduction to Statistical Learning with applications in R, https://www.statlearning.com, Springer-Verlag, New York
summary(Weekly) lm(Today~Lag1+Lag2,data=Weekly)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.