sp500: Standard & Poor's 500 index

Description Usage Format Source Examples

Description

This data set consists of (monthly) values of the S&P 500 stock exchange index. The variable of interest is the logarithm of the return values, i.e., the logarithm of the ratio of indices, in this case the closing index is used.

Usage

1

Format

A data frame with 744 observations and 6 variables.

Open

Index at the start of trading.

High

Highest index.

Low

Lowest index.

Close

Index at the close of trading.

Volume

The volume of trading.

logret

The log return of the closing index.

Source

Yahoo Data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(sp500)

# the data can be made with the following code (eg to include a longer or
# shorter time span)

## Not run: 

require(TTR)

# load SP500 returns
Sys.setenv(tz='UTC')

sp500 <- getYahooData('^GSPC',start=19500101,end=20120228,freq='daily')
ep <- endpoints(sp500, on="months", k=1)
sp500 <- sp500[ep[2:(length(ep)-1)]]
sp500$sp500_ret <- log(sp500$Close) - lag(log(sp500$Close))
sp500 <- na.exclude(sp500)


## End(Not run)

depmixS4 documentation built on Jan. 23, 2020, 3 p.m.