The Easiest Way to Save and Share Code Snippets on the web

Untitled

matlab

posted: Feb, 13th 2011 | jump to bottom

require(quantmod)
 
getSymbols("WRESCRT;PPIACO", src="FRED") 
 
head(PPIACO)
head(WRESCRT)
 
W <- to.monthly(WRESCRT)
P <- to.monthly(PPIACO)
 
W.c <- W[,4]
P.c <- P[,4]
 
PP <- P.c['1991::']
WW <- W.c['1991::']
WW <- WW['::2010']
 
head(PP)
head(WW)
 
length(PP)
length(WW)
 
WWW <- as.ts(WW)
PPP <- as.ts(PP)
 
ccf(WWW, PPP, lag.max=300, main="WRESCRT & PPIACO")
20 views