Compute mean from the object returned by "getSymbols()" in R package "quantmod" -
i compute moments object returned "getsymbols()" in r package "quantmod". object isn't vector or matrix, there error. how can that? following code:
> library(quantmod) > getsymbols("axp", = "2007-01-01", = "2013-12-31") > returns = diff(axp[,6]) / lag(axp[,6]) * 100 # calculate simple return adjusted prices > mean(returns) [1] na > var(returns) axp.adjusted axp.adjusted na
how can calculate sample mean , variance? thanks!
Comments
Post a Comment