* Reference: Chapter 4 of * Ernst R. Berndt, The Practice of Econometrics, Addison-Wesley, 1991. SAMPLE 1 137 READ (CHOW) VOLUME RENT BINARY DIGITS WORDS ADD MULT ACCESS YEAR & ORDER IBMDUM / SKIPLINES=1 * Exercise 3, p. 136. * (a) Construct variables GENR MEM=WORDS*BINARY*DIGITS GENR LNMEM=LOG(WORDS*BINARY*DIGITS) GENR LNMULT=LOG(MULT) GENR LNACCESS=LOG(ACCESS) GENR LNRENT=LOG(RENT) * Create dummy variables for years 1955 thru 1965 DO #=55,65 IF (YEAR.EQ.#) D#=1 ENDO SET NOWARNSKIP * Restrict to 1954 to 1959 SKIPIF (YEAR.GE.60) STAT YEAR D61-D65 STAT LNRENT LNMULT LNMEM LNACCESS / PCOR DELETE SKIP$ * Restrict to 1960 to 1965 SKIPIF (YEAR.LT.60) STAT YEAR D61-D65 STAT LNRENT LNMULT LNMEM LNACCESS / PCOR * (b) OLS estimation - see final row of Table 4.1, p. 121 OLS LNRENT D61-D65 LNMULT LNMEM LNACCESS / LOGLOG COEF=BETA DELETE SKIP$ * Calculate a price index using anti-logarithms, see Table 4.2, p. 123. SAMPLE 1 6 GENR PINDEX=1 SAMPLE 2 6 * Use the LAG function so that observations 1 to 5 of BETA are * placed in observations 2 to 6 of PINDEX. GENR PINDEX=EXP(LAG(BETA)) SAMPLE 1 6 GENR YR=TIME(59) PRINT YR PINDEX * Calculate an annual growth rate GENR RATE=100*(PINDEX-LAG(PINDEX))/LAG(PINDEX) * Get the average growth rate as reported on p. 123. SAMPLE 2 6 STAT RATE * (c) Restrict the sample to 1960 to 1965. SAMPLE 56 137 GENR LNLENGTH=LOG(BINARY*DIGITS) GENR LNWORDS=LOG(WORDS) OLS LNRENT D61-D65 LNMULT LNLENGTH LNWORDS LNACCESS / LOGLOG * Test the null hypothesis that the coefficient on LNLENGTH is the * same as the coefficient on LNWORDS TEST LNLENGTH=LNWORDS * (d) Use the entire sample SAMPLE 1 137 OLS LNRENT D55-D65 LNMULT LNMEM LNACCESS / LOGLOG COEF=BETA1 * Construct a price index for 1954 - 1965 SAMPLE 1 12 GENR PINDEX1=1 SAMPLE 2 12 GENR PINDEX1=EXP(LAG(BETA1)) SAMPLE 1 12 GENR YR1=TIME(53) PRINT YR1 PINDEX1 * (e) Restrict the sample to 1960 to 1965. SAMPLE 56 137 * The log-transformed model used previously may correct heteroskedasticity. * Therefore, start with a model that has variables in levels. OLS RENT D61-D65 MULT MEM ACCESS / RESID=E * Test for heteroskedasticity as a function of VOLUME GENR E2=E*E GENR ZVOL=1/VOLUME * Run an auxiliary regression OLS E2 ZVOL * Calculate a test statistic as N*R-square GEN1 LM=$N*$R2 * Calculate a p-value DISTRIB LM / TYPE=CHI DF=1 GEN1 pval=1-$CDF PRINT LM pval * Now implement weighted least squares estimation. * On the OLS command the WEIGHT= option assumes that the error variance * is inversely proportional to the weight variable. OLS RENT D61-D65 MULT MEM ACCESS / WEIGHT=VOLUME * Exercise 5, p. 139. * (a) Restrict the sample to 1960 to 1965. SAMPLE 56 137 * Create slope dummy variables DO #=61,65 GENR SA#=LNMULT*D# GENR SB#=LNMEM*D# GENR SC#=LNACCESS*D# ENDO * Pooled equation OLS LNRENT D61-D65 LNMULT LNMEM LNACCESS GEN1 SSER2=$SSE GEN1 DFS2=$DF * Allow different coefficients for each year. OLS LNRENT D61-D65 LNMULT LNMEM LNACCESS & SA61-SA65 SB61-SB65 SC61-SC65 * Equation for 1961 - see Table 4.1, p. 121 TEST CONSTANT+D61 TEST LNMULT+SA61 TEST LNMEM+SB61 TEST LNACCESS+SC61 * Test the null hypothesis that the slope coefficients are the same. TEST TEST SA61=0 TEST SA62=0 TEST SA63=0 TEST SA64=0 TEST SA65=0 TEST SB61=0 TEST SB62=0 TEST SB63=0 TEST SB64=0 TEST SB65=0 TEST SC61=0 TEST SC62=0 TEST SC63=0 TEST SC64=0 TEST SC65=0 END * Equivalent test approach - based on the sum of squared residuals * from the regressions. * Test the null hypothesis that the slope coefficients are the same. GEN1 SSEU=$SSE GEN1 DF2=$DF GEN1 DF1=15 GEN1 F=(DF2/DF1)*(SSER2-SSEU)/SSEU * p-value DISTRIB F / TYPE=F DF1=DF1 DF2=DF2 GEN1 pval=1-$CDF PRINT F pval * (b) Consider the 1954-1959 era SAMPLE 1 55 * Create slope dummy variables DO #=55,59 GENR SA#=LNMULT*D# GENR SB#=LNMEM*D# GENR SC#=LNACCESS*D# ENDO * Pooled equation OLS LNRENT D55-D59 LNMULT LNMEM LNACCESS GEN1 SSER1=$SSE GEN1 DFS1=$DF * Allow different coefficients for each year. OLS LNRENT D55-D59 LNMULT LNMEM LNACCESS & SA55-SA59 SB55-SB59 SC55-SC59 * Test the null hypothesis that the slope coefficients are the same. GEN1 SSEU=$SSE GEN1 DF2=$DF GEN1 DF1=15 GEN1 F=(DF2/DF1)*(SSER1-SSEU)/SSEU * p-value DISTRIB F / TYPE=F DF1=DF1 DF2=DF2 GEN1 pval=1-$CDF PRINT F pval * (c) Work with the entire 1954-1965 time period. SAMPLE 1 137 * Create a dummy variable DGEN2=1 for the second generation. IF (YEAR.GE.60) DGEN2=1 * Slope dummy variables. GENR DX1=LNMULT*DGEN2 GENR DX2=LNMEM*DGEN2 GENR DX3=LNACCESS*DGEN2 * Include year specific dummies for 1955 through 1965. * Allow for different slopes for the second generation. OLS LNRENT D55-D65 LNMULT LNMEM LNACCESS DX1 DX2 DX3 * Test the null hypothesis that the slope coefficients of the * first generation equal those of the second generation. TEST TEST DX1=0 TEST DX2=0 TEST DX3=0 END * (d) Goldfeld-Quandt test for heteroskedasticity between the * two generations. GEN1 GQ=(DFS1/DFS2)*SSER2/SSER1 DISTRIB GQ / TYPE=F DF1=DFS2 DF2=DFS1 GEN1 pval=1-$CDF PRINT GQ pval STOP