我正在尝试从 R-Forge 中找出“factorAnalytics”包。一切似乎都可以正常加载,但是当我尝试浏览示例时,我无法加载数据。
install.packages("factorAnalytics", repos="http://R-Forge.R-project.org")
这工作正常,一切都已安装。我现在尝试浏览小插图中的示例:
# Load fundamental and return data
data(Stock.df)
# fit a fundamental factor model
exposure.vars <- c("BOOK2MARKET", "LOG.MARKETCAP")
fit <- fitFfm(data=stock, asset.var="TICKER", ret.var="RETURN",
date.var="DATE", exposure.vars=exposure.vars)
names(fit)
它提供了这个:
Warning message:
In data(Stock.df) : data set ‘Stock.df’ not found
但是如果我运行这个:
data(package = "factorAnalytics")
我看到数据集应该在那里......
Data sets in package ‘factorAnalytics’:
factors.M (CommonFactors) Factor set of several commonly used factors
factors.Q (CommonFactors) Factor set of several commonly used factors
managers Hypothetical Alternative Asset Manager and Benchmark Data
r.M (StockReturns) Stock Return Data
r.W (StockReturns) Stock Return Data
stock (Stock.df) Fundamental and return data for 447 NYSE stocks
tr.yields (TreasuryYields) Treasury yields at different maturities
那我错过了什么??