Created
May 20, 2012 04:12
-
-
Save shabbychef/2744481 to your computer and use it in GitHub Desktop.
ANOVA on monthly GSPC returns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# * Sat May 19 2012 21:04:56 Steven E. Pav <shabbychef@gmail.com> | |
# from https://github.com/milktrader/rfinance2012/blob/94e6dd0452b16697ad10f9bc7e0e7431c95d9020/xts/.Rhistory | |
require(quantmod) | |
getSymbols('^GSPC', from='1950-01-01') | |
G <- monthlyReturn(Cl(GSPC)) | |
G$monnum <- .indexmon(G) | |
# try ANOVA on the monthly returns | |
mret.aov <- aov(monthly.returns ~ monnum,data=as.data.frame(G)) | |
# don't see much here | |
summary(mret.aov) | |
png('monthly_spy.png') | |
boxplot(monthly.returns ~ monnum,data = as.data.frame(G)) | |
dev.off() | |
#for vim modeline: (do not edit) | |
# vim:ts=2:sw=2:tw=79:fdm=marker:fmr=FOLDUP,UNFOLD:cms=#%s:syn=r:ft=r:ai:si:cin:nu:fo=croql:cino=p0t0c5(0: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment