* * Empirical example from pp 140-143 * open data consump.dat calendar 1950 data(format=prn,org=columns) 1950:1 1993:1 year y c * set logc = log(c) set logy = log(y) * * The restricted distributed lag can be done in one of two ways. The first is to * "code" the restrictions into the explanatory variables. This is done using the * ENCODE instruction. Here, this generates the linear combination of * 6y{0}+5y{1}+...+y{5}. The UNRAVEL option on LINREG then rewrites the regression * in terms of the original lagged values of y. * dec rect r(1,6) ewise r(i,j)=(7-j) encode r / liny # logy{0 to 5} linreg(unravel) logc # constant liny * * The alternative is to estimate an unrestricted distributed lag, then impose the * restrictions. Here, there are five restrictions. There are many ways to write * these: here we set the restrictions as the 6th coefficient (which will be the * one on logy{4}) - 2 x the 7th equals zero, then 5th - 3 x 7th = 0, etc. While * clumsier in this case, it does have the side effect of producing the test * statistic for the restriction. * linreg logc # constant logy{0 to 5} restrict(create) 5 # 6 7 # 1.0 -2.0 0.0 # 5 7 # 1.0 -3.0 0.0 # 4 7 # 1.0 -4.0 0.0 # 3 7 # 1.0 -5.0 0.0 # 2 7 # 1.0 -6.0 0.0 * * The Almon lags are most easily done using the PDL procedure. The coded * regression output is somewhat different because RATS codes both the polynomial * restrictions and the endpoint restrictions into a single set, while SAS * estimates using just the polynomial restrictions, and then imposes the endpoint * constraint. * @pdl(codedreg,constrain=near,graph) logc # logy 0 5 2 @pdl(codedreg,constrain=far,graph) logc # logy 0 5 2