** Chapter 20.3 ** for W.H. Greene, Econometric Analysis 6th ed. ***************** * (c) Noel Roy 2003, 2008 * * MODELS WITH LAGGED VARIABLES * *=============================================================================== * * 20.3 SIMPLE DISTRIBUTED LAG MODELS * * Example 20.3 (p. 680) Price and Income Elasticities of Demand for Gasoline * TIME 1953.0 1 SAMPLE 1953.0 2004.0 READ (TableF2-2.txt) Year,GasExp,Pop,Gasp,Income,PNC,PUC,PPT,PD,PN,PS /SKIPLINES=1 * * Set up regression variables. * GENR lGpop = LOG(GasExp/Pop/Gasp) GENR lPg = LOG(Gasp) GENR ly = LOG(Income) GENR LPnc = LOG(Pnc) GENR LPuc = LOG(Puc) GENR LPpt = LOG(Ppt) GENR Trend=year-1952 * * The general command format for distributed-lag models is: * * OLS depvar indep(first.last,order,endcon) / options * * where first and last separated by dots specify the range of lags; order * specifies the order of the Almon lag scheme; and endcon specifies the * endpoint restrictions as follows: * * 0= No endpoint restrictions; * 1= Endpoint restrictions on the left side of the polynomial. * 2= Endpoint restrictions on the right side of the polynomial. * 3= Endpoint restrictions on both left and right sides. * * If order and endcon are not specified, an unrestricted lag is used. * * Note that, when using this lagging method (as opposed to using the LAG(x) * function with the GENR command), the OLS estimation automatically deletes * the appropriate initial observations. This default can be over-ridden using * the SET NODELETE command. * * See Chapter 15 of the SHAZAM Manual fro further information on estimating * distributed lag models. * * Estimate the "Unrestricted" model in Tabl2 20.1. * OLS LGPOP LPNC LPUC LPPT TREND LPG(0.5) LY(0.5) /PREDICT=YUHAT LOGLOG * * The short run price and income elasticities (presented in Table 20.2) are the * first estimated coefficient on LPG and LNY respectively. The long run elasticities * are reported as the sum of the lagged coefficients on LPG and LNY. * * The Expectations model must be estimated iteratively. * Estimate for all values of lambda between 0 and .99, in steps of .01. * * Calculate ZtG and ZtY as in (20-14). DIM ZtG 52 ZtY 52 dt 52 GEN1 EEMIN=99999 SET NODOECHO NOWARN DO #=1,100 GEN1 LAMBDA=(#-1)/100 SAMPLE 1953.0 1953.0 GENR ZtG = LPG/(1-LAMBDA) GENR ZtY = LY/(1-LAMBDA) SAMPLE 1954.0 2004.0 GENR ZtG = LPG + LAMBDA*LAG(ZtG) GENR ZtY = LY + LAMBDA*LAG(ZtY) * Estimate for current value of Lambda. SAMPLE 1953.0 2004.0 ?OLS LGPOP LPNC LPUC LPPT TREND ZtG ZtY ?GEN1 SSE=$SSE IF1 (SSE .LT. EEMIN) LAMDAMIN=LAMBDA IF1 (SSE .LT. EEMIN) EEMIN=SSE ENDO * * Estimate the relationship at the value of LAMBDA that minimizes SSE. * GEN1 LAMBDA=LAMDAMIN PRINT LAMBDA SAMPLE 1953.0 1953.0 GENR ZtG = LPG/(1-LAMBDA) GENR ZtY = LY/(1-LAMBDA) SAMPLE 1954.0 2004.0 GENR ZtG = LPG + LAMBDA*LAG(ZtG) GENR ZtY = LY + LAMBDA*LAG(ZtY) SAMPLE 1953.0 2004.0 OLS LGPOP LPNC LPUC LPPT TREND ZtG ZtY /COEF=Bexp PREDICT=YEHAT LOGLOG RESID=EExp * * Calculate the long-run elasticities. * GEN1 Beta= Bexp(5)/(1-LAMBDA) GEN1 Gamma= Bexp(6)/(1-LAMBDA) PRINT Beta Gamma * * Calculate derived lag coefficients on LnPg and LnY. DO #=0,5 GEN1 COEFLPg#=Beta*Lambda**#*(1-Lambda) GEN1 COEFLnY#=Gamma*Lambda**#*(1-Lambda) ENDO PRINT COEFLPg0-COEFLPg5 COEFLnY0-COEFLnY5 * The derivation of the income lag coefficients in Table 19.1 appear to be incorrect, * as they are based on a geometric weight of 1-Lambda and not Lambda. The price * lag coefficents are valid. * * Now estimate the partial adjustment model. * SAMPLE 1954.0 2004.0 GENR LGPOPLAG = LAG(LGPOP) OLS LGPOP LPNC LPUC LPPT TREND LPG LY LGPOPLAG /COEF=B PREDICT=YAHAT LOGLOG RESID=EPAdj * * The short-run price and income elasticities reported in Table 20.2 are the * estimated coefficients to LPG and LY respectively. * Calculate the long-run elasticities. * GEN1 Beta= B(5)/(1-B(7)) GEN1 Gamma= B(6)/(1-B(7)) PRINT Beta Gamma * * Calculate derived lag coefficients on LnPg and LnY. DO #=0,5 GEN1 COEFLPg#=Beta*B(7)**#*(1-b(7)) GEN1 COEFLnY#=Gamma*B(7)**#*(1-b(7)) ENDO PRINT COEFLPg0-COEFLPg5 COEFLnY0-COEFLnY5 * STOP * *=============================================================================== * Updated November 12, 2008