R Dataset / Package ISLR / Smarket

Submitted by pmagunia on March 9, 2018 - 1:06 PM
Dataset License
GNU General Public License v2.0
Attachment Size
dataset-18213.csv 68.81 KB
Documentation

S&P Stock Market Data

Description

Daily percentage returns for the S&P 500 stock index between 2001 and 2005.

Usage

Smarket

Format

A data frame with 1250 observations on the following 9 variables.

Year

The year that the observation was recorded

Lag1

Percentage return for previous day

Lag2

Percentage return for 2 days previous

Lag3

Percentage return for 3 days previous

Lag4

Percentage return for 4 days previous

Lag5

Percentage return for 5 days previous

Volume

Volume of shares traded (number of daily shares traded in billions)

Today

Percentage return for today

Direction

A factor with levels Down and Up indicating whether the market had a positive or negative return on a given day

Source

Raw values of the S&P 500 were obtained from Yahoo Finance and then converted to percentages and lagged.

References

Games, G., Witten, D., Hastie, T., and Tibshirani, R. (2013) An Introduction to Statistical Learning with applications in R, www.StatLearning.com, Springer-Verlag, New York

Examples

summary(Smarket)
lm(Today~Lag1+Lag2,data=Smarket)
--

Dataset imported from https://www.r-project.org.

Documentation License
GNU General Public License v2.0

From Around the Site...

Title Authored on Content type
R Dataset / Package wooldridge / big9salary March 9, 2018 - 1:06 PM Dataset
R Dataset / Package mosaicData / Galton March 9, 2018 - 1:06 PM Dataset
Greedy Pig 2007 August 18, 2017 - 1:45 AM Dataset
R Dataset / Package survival / bladder March 9, 2018 - 1:06 PM Dataset
R Dataset / Package Zelig / swiss March 9, 2018 - 1:06 PM Dataset