* * Enders, Applied Econometric Time Series, 4th edition * Example from Section 5.9, pp 309-312 * VAR on Terrorism data * cal(q) 1970:4 open data terrorism.xls data(format=xls,org=columns) * 2010:4 * * Make copies with shorter names * set dom = domestic set trans = transnational * @dfunit(max=4,method=gtos) dom 1979:1 * @erstest(lags=%%autop) dom 1979:1 * @dfunit(max=4,method=gtos) trans 1979:1 * @erstest(lags=%%autop) trans 1979:1 * * @varlagselect(lags=4,crit=gtos,signif=0.05) 1979:4 * # dom trans @varlagselect(lags=4,crit=bic) 1979:4 * # dom trans * system(model=var) variables dom trans lags 1 to 3 det constant ; * no dummy with adjusted data end(system) * estimate(resids=resids,sigma) 1979:4 * errors(results=ferrors,steps=12,model=var) * * Table generated as in 5.3 * report(action=define) report(row=new,atcol=2,tocol=3,span,align=center) "% Variance of dom" report(row=current,atcol=4,tocol=5,span,align=center) "% Variance of trans" report(row=new,atcol=2,align=center) "Shock to dom" "Shock to trans" "Shock to dom" "Shock to trans" dofor j = 1 4 8 12 report(row=new,atcol=1) %strval(j,"##")+"-step-ahead" 100*ferrors(1,1)(j) 100*ferrors(1,2)(j) \$ 100*ferrors(2,1)(j) 100*ferrors(2,2)(j) end dofor j report(action=format,picture="*.#") report(action=show) * compute longlabels=||"Domestic","Transnational"|| @MCVARDoDraws(model=VAR,draws=2000,steps=18) @mcgraphirf(model=VAR,shocks=longlabels,varlabels=longlabels, \$ footer="Figure 5.8 Impulse Responses of Terrorism",\$ center=median,percent=||.025,.975||)