* Reference: Chapter 3 of * Ernst R. Berndt, The Practice of Econometrics, Addison-Wesley, 1991. SAMPLE 1 145 READ (NERLOV) ORDER COSTS KWH PL PF PK / SKIPLINES=1 * Exercise 4, p. 87. * (a) Data transformations GENR LNCP3=LOG(COSTS/PF) GENR LNP13=LOG(PL/PF) GENR LNP23=LOG(PK/PF) GENR LNKWH=LOG(KWH) * (b) Estimate the parameters of Equation (3.20). * The RESID= option saves the estimated residuals in the variable E. OLS LNCP3 LNKWH LNP13 LNP23 / RESID=E * (c) Confidence interval for the parameter on LNKWY CONFID LNKWH * Point estimate of returns to scale (reported as TEST VALUE on * the TEST command). TEST 1/LNKWH * (d) Implied estimates for alpha_1, alpha_2, alpha_3 TEST LNP13/LNKWH TEST LNP23/LNKWH TEST (1-LNP13-LNP23)/LNKWH * (e) Plot GRAPH E LNKWH * Sample correlation of residuals with LNKWH STAT LNKWH E / PCOR * Test for heteroskedasticity GENR E2=E*E * Artificial regression OLS E2 LNKWH * Test statistic GEN1 LM=$N*$R2 * p-value DISTRIB LM / TYPE=CHI DF=1 GEN1 pval=1-$CDF PRINT LM pval * Exercise 5, p. 88. * (a) & (b) Estimate the parameters for each of five subsamples. * Allocate a matrix to save the results. DIM RESULT 5 11 GEN1 END=0 DO #=1,5 GEN1 BEG=END+1 GEN1 END=BEG+28 SAMPLE BEG END OLS LNCP3 LNKWH LNP13 LNP23 / COEF=BETA STDERR=SE * Returns to scale TEST 1/LNKWH GEN1 SCALE=$VAL GEN1 R2=$R2 GEN1 ID=$DO MATRIX ROW=ID|BETA'|R2|SCALE|SE' MATRIX RESULT(#,0)=ROW ENDO * Print the results in a table. SET NOECHO FORMAT(15X,'b_Y',7X,'b_1',7X,'b_2',5X,'Intercept',3X,'R-square',2X,'Scale') PRINT / FORMAT FORMAT(1X,'Sample',F3.0,6F10.3/11X,4(3X,'(',F5.3,')')) PRINT RESULT / FORMAT NONAMES SET ECHO * (c) Create dummy variables for the sub-samples SAMPLE 1 145 MATRIX DSUB=SEAS(145,-5) DO #=1,5 GENR DS#=DSUB:# * Create slope dummy variables GENR YS#=LNKWH*DS# ENDO * Allow for different intercepts and different coefficients for LNKWH * for the sub-samples. OLS LNCP3 DS2-DS5 LNKWH YS2-YS5 LNP13 LNP23 * (d) Estimate the returns to scale for each sub-sample TEST 1/LNKWH TEST 1/(LNKWH+YS2) TEST 1/(LNKWH+YS2) TEST 1/(LNKWH+YS3) TEST 1/(LNKWH+YS4) * (e) Exercise 4 (b) is a restricted model that assumes common * coefficients for all sub-samples. Test this restriction. TEST TEST DS2=0 TEST DS3=0 TEST DS4=0 TEST DS5=0 TEST YS2=0 TEST YS3=0 TEST YS4=0 TEST YS5=0 END * (f) Calculate the median value of LNKWH in each sub-sample. GEN1 END=0 DO #=1,5 GEN1 BEG=END+1 GEN1 END=BEG+28 SAMPLE BEG END STAT LNKWH / PMEDIAN MEDIAN=MEDX# ENDO * Another model variation. SAMPLE 1 145 GENR LNY2=LNKWH*LNKWH OLS LNCP3 LNKWH LNY2 LNP13 LNP23 TEST TEST LNKWH=0 TEST LNY2=0 END * Compute returns to scale estimates at the median value of LNKWH in * each of the five subsamples. TEST 1/(LNKWH+2*MEDX1*LNY2) TEST 1/(LNKWH+2*MEDX2*LNY2) TEST 1/(LNKWH+2*MEDX3*LNY2) TEST 1/(LNKWH+2*MEDX4*LNY2) TEST 1/(LNKWH+2*MEDX5*LNY2) STOP