* * Martin, Hurn, Harris, "Econometric Modelling with Time Series" * Example 13-2, from pp 468-470 * Properties of US Macro Data * open data sims_data.dat calendar(m) 1959:1 data(format=prn,nolabels,org=columns) 1959:01 1998:12 ffunds exchrate commpri m1 cpi ip * set lex = log(exchrate) set lcp = log(commpri) set lm = log(m1) set lp = log(cpi) set lo = log(ip) * spgraph(hfields=3,vfields=4,xlabels=||"Levels","1st Difference","12th Difference"||,\$ ylabels=||"Interest Rate","Money","Price","Output"||,\$ footer="Figure 13.1 Plots of U.S. monthly macroeconomic data, January 1960 to December 1998") dofor y = ffunds lm lp lo set dy = y{0}-y{1} set d12y = y{0}-y{12} graph(row=%doforpass,col=1) # y graph(row=%doforpass,col=2) # dy graph(row=%doforpass,col=3) # d12y end dofor y spgraph(done) * report(action=define,title="Table 13.1 ACF and PACF of U.S. Macroeconomic Data") report(atrow=1,atcol=1) "Lag" report(atrow=1,atcol=2,tocol=5,align=center,span) "ACF" report(atrow=1,atcol=6,tocol=9,align=center,span) "PACF" report(atrow=2,atcol=2,align=center) "\$r_t\$" "\$lm_t\$" "\$lp_t\$" "\$lo_t\$" "\$r_t\$" "\$lm_t\$" "\$lp_t\$" "\$lo_t\$" * report(atrow=3,atcol=2,tocol=9,align=center,span) "\$Level (y_t)\$" report(atrow=4,atcol=1,fillby=cols) 1 2 3 report(atrow=7,atcol=2,tocol=9,align=center,span) "\$1st Difference (y_t - y_{t-1})\$" report(atrow=8,atcol=1,fillby=cols) 1 2 3 report(atrow=11,atcol=2,tocol=9,align=center,span) "\$12th Difference (y_t - y_{t-12})\$" report(atrow=12,atcol=1,fillby=cols) 1 2 3 * dofor y = ffunds lm lp lo set dy = y{0}-y{1} set d12y = y{0}-y{12} corr(noprint,number=3,results=corr,partial=pcorr,method=yule) y report(atrow=4,atcol=%doforpass+1,fillby=cols) %xsubvec(corr,2,4) report(atrow=4,atcol=%doforpass+5,fillby=cols) %xsubvec(pcorr,2,4) corr(noprint,number=3,results=corr,partial=pcorr,method=yule) dy report(atrow=8,atcol=%doforpass+1,fillby=cols) %xsubvec(corr,2,4) report(atrow=8,atcol=%doforpass+5,fillby=cols) %xsubvec(pcorr,2,4) corr(noprint,number=3,results=corr,partial=pcorr,method=yule) d12y report(atrow=12,atcol=%doforpass+1,fillby=cols) %xsubvec(corr,2,4) report(atrow=12,atcol=%doforpass+5,fillby=cols) %xsubvec(pcorr,2,4) end dofor y report(action=format,picture="##.##") report(action=show)