* * Example 19.6 from page 600 * open data tablef5-1[1].txt calendar(q) 1950 data(format=prn,org=columns) 1950:1 2000:4 year qtr realgdp realcons realinvs realgovt realdpi $ cpi_u m1 tbilrate unemp pop infl realint * * Because the data set doesn't have dates in a form that RATS recognizes, the * data are read over the whole range. By restricting the range over which the * transformed data are defined, we can force the subsequent analysis to be * limited to the desired portion of the data. * set logc 1959:1 1997:4 = 100*log(realcons) set logy 1959:1 1997:4 = 100*log(realgdp) set delc = logc-logc{1} set dely = logy-logy{1} set delpi 1959:2 1997:4 = infl-infl{1} * graph(footer="Figure 19.5 Log GDP") # logy graph(footer="Figure 19.6 The Quarterly Rate of Inflation") # infl 1959:1 1997:4 graph(footer="Figure 19.7 Rates of Change, log GDP and Rate of Inflation") 2 # dely # delpi * * Unit root tests on log y and inflation * @dfunit(lags=4) logy @dfunit(lags=4) infl * * Andrews-Ploberger/Quandt tests on the regressions on the differenced variables * @apbreaktest dely # constant dely{1 to 8} delpi{1 to 8} @apbreaktest delpi # constant dely{1 to 8} delpi{1 to 8} * * Set up and estimate the VAR * system(model=rcmodel) variables dely delpi lags 1 to 8 det constant end(system) * estimate * * Compute the Blanchard-Quah factorization of the covariance matrix * compute bqfactor=%bqfactor(%sigma,%varlagsums) * * Do the impulse responses * impulse(model=rcmodel,factor=bqfactor,steps=80,results=responses,labels=||"Permanent","Transitory"||) * * The response of log GDP itself and of the inflation rate can be obtained by * accumulating the responses of the differences (to the second shock, which is * interpreted as the demand shock). For computing the sacrifice ratio, the GDP * response needs to be accumulated twice. * * responses(1,2) is the response of del log GDP (variable 1) to shock 2 and * responses(2,2) is the response of del inflation (variable 2) to shock 2. * acc responses(1,2) / accoutput acc accoutput / cumoutput acc responses(2,2) / accinfl * * Compute sacrifice ratio * set sacratio = cumoutput/accinfl * graph(footer="Sacrifice Ratio",nodates) # sacratio