View source: R/selectCRSPandSPGMI.R
selectCRSPandSPGMI | R Documentation |
Select and merge a set of CRSP stocks and SPGMI factors and SPGMI factors over a range of dates between January 1993 and December 2015
selectCRSPandSPGMI(
stocks = stocksCRSP,
factors = factorsSPGMI,
dateSet = c("2006-01-31", "2010-12-31"),
stockItems = c("Date", "TickerLast", "CapGroup", "Sector", "Return", "Ret13WkBill",
"mktIndexCRSP"),
factorItems = c("BP", "LogMktCap", "SEV"),
capChoice = "SmallCap",
Nstocks = 20
)
stocks |
A data.table of stock returns and related data |
factors |
A data.table of factors and related data |
dateSet |
A character vector providing a start data and an end date, having the same form as c("2006-01-31", "2010-12-31") |
stockItems |
A character vector that is a subset of the names of stocks data.table |
factorItems |
A character vector that is a subset of the names of factors data.table |
capChoice |
One of the market capitalization group names "Smallcap", "Smallcap", "MidCap", "LargeCap". |
Nstocks |
Number of stocks in one of the marketcap groups, not to exceed the number of stocks in the chosen group. |
The date range is specified by a beginning Date object and an ending Date object. Default values for the stocks and factors component names, marketcap group, and number of stocks in the marketcap group can be changed by the user
A merged data.table consisting of selected stocks and factors
## Not run:
data(stocksCRSP)
data(factorsSPGMI)
stocks_factors <- selectCRSPandSPGMI(stocks = stocksCRSP, factors = factorsSPGMI,
dateSet = c("2006-01-31", "2010-12-31"),
stockItems = c("Date", "TickerLast",
"CapGroup", "Sector",
"Return", "Ret13WkBill",
"mktIndexCRSP"),
factorItems = c("BP", "LogMktCap", "SEV"),
capChoice = "SmallCap",
Nstocks = 20)
str(stocks_factors)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.