Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timelyportfolio/4999748 to your computer and use it in GitHub Desktop.
Save timelyportfolio/4999748 to your computer and use it in GitHub Desktop.
#build on fine work at http://tradeblotter.wordpress.com/
#I take blame for all the ugly/bad code
require(latticeExtra)
#data from pimco and vanguard websites imported into Excel and translated into csv
#if local uncomment next line
#pimco_vanguard <- read.csv("vanguard_pimco.csv")
#get data from published google doc spreadsheet
pimco_vanguard <- read.csv("https://docs.google.com/spreadsheet/pub?key=0AieeEIaS0AOsdDFET0ZmbTBKWDNoMnZrZ0oySWRia1E&single=true&gid=0&output=csv")
#do 1 year or past 12 months
#exclude 0 assuming that data does not exist for this fund
asTheEconomist(
Ecdf(~X1Y,group=FundComplex,data=pimco_vanguard[which(!(pimco_vanguard[,"X1Y"]==0)),],
label.curves=TRUE,
main="PIMCO and Vanguard Mutual Funds \nCumulative Density of 1 Year Performance")
) +
layer(panel.abline(v=0, col="grey70"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment