S&P Stock Market Data#
Daily percentage returns for the S&P 500 stock index between 2001 and 2005.
Year
: The year that the observation was recordedLag1
: Percentage return for previous dayLag2
: Percentage return for 2 days previousLag3
: Percentage return for 3 days previousLag4
: Percentage return for 4 days previousLag5
: Percentage return for 5 days previousVolume
: Volume of shares traded (number of daily shares traded in billions)Today
: Percentage return for todayDirection
: 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.
from ISLP import load_data
Smarket = load_data('Smarket')
Smarket.columns
Index(['Year', 'Lag1', 'Lag2', 'Lag3', 'Lag4', 'Lag5', 'Volume', 'Today',
'Direction'],
dtype='object')
Smarket.shape
(1250, 9)
Smarket.columns
Index(['Year', 'Lag1', 'Lag2', 'Lag3', 'Lag4', 'Lag5', 'Volume', 'Today',
'Direction'],
dtype='object')
Smarket.describe().iloc[:,-4:]
Lag4 | Lag5 | Volume | Today | |
---|---|---|---|---|
count | 1250.000000 | 1250.00000 | 1250.000000 | 1250.000000 |
mean | 0.001636 | 0.00561 | 1.478305 | 0.003138 |
std | 1.138774 | 1.14755 | 0.360357 | 1.136334 |
min | -4.922000 | -4.92200 | 0.356070 | -4.922000 |
25% | -0.640000 | -0.64000 | 1.257400 | -0.639500 |
50% | 0.038500 | 0.03850 | 1.422950 | 0.038500 |
75% | 0.596750 | 0.59700 | 1.641675 | 0.596750 |
max | 5.733000 | 5.73300 | 3.152470 | 5.733000 |