* * Example 19.4 from page 575 * 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 * set logc = log(realcons) set logy = log(realgdp) * * This creates a dummy variable for quarter 4. This series with leads 0 to 3 * (that is regressors seas{0 to -3}) gives you a full set of dummies. * seasonal seas * linreg(define=ardl) logc # logc{1 to 3} logy{0 to 3} seas{0 to -3} * * Extract the polynomials for the autoregressive part (which will be * 1-a(1)x-a(2)x**2-a(3)x**3), and the distributed lag part. * compute arpoly=%eqnlagpoly(0,logc) compute dlpoly=%eqnlagpoly(0,logy) * * Compute the long run effect * compute arlags=%polyvalue(arpoly,1) compute ardllt=%polyvalue(dlpoly,1)/arlags summarize(title="Long-Term Effects-ARDL Estimates",value=ardllt,$ vector=||ardllt/arlags,ardllt/arlags,ardllt/arlags,1.0/arlags,1.0/arlags,1.0/arlags,1.0/arlags,0,0,0,0||) * * Compute the implied dynamic lag coefficients. This is done by dividing the DL * polynomial by the AR polynomial. Since that's, in fact, infinitely long, we * need to set the number of lags required. * compute ardlest=%polydiv(dlpoly,arpoly,7) * linreg logc # logy{0 to 7} seas{0 to -3} summarize(title="Long Term Effects-OLS Estimates") # logy{0 to 7} * compute [vector] ardlest=ardlest compute [vector] olsest =%xsubvec(%beta,1,8) report(action=define) report(atrow=1,atcol=1) "Lag" %seq(0,7) report(atrow=2,atcol=1) "ARDL" ardlest report(atrow=3,atcol=1) "Unrestricted" olsest report(action=format,atrow=2,picture="*.###") report(action=show,window="Table 19.3 Lag Coefficients in a Rational Lag Model")