* Reference: Chapters 10 and 12 of * Jeffrey M. Wooldridge, Introductory Econometrics: A Modern Approach, * South-Western College Publishing, 2000. SAMPLE 1 131 READ (BARIUM.shd) chnimp bchlimp befile6 affile6 afdec6 & befile12 affile12 afdec12 chempi gas rtwex spr sum fall & lchnimp lgas lrtwex lchempi t & feb mar apr may jun jul aug sep oct nov dec percchn * Example 10.5 * Equation (10.22), p. 329. OLS lchnimp lchempi lgas lrtwex befile6 affile6 afdec6 / COEF=BETA STDERR=SE * Estimate the expected percentage difference in the import demand for * barium chloride from China after the decision in favor of the * U.S. industry. * An interpretation of the coefficients is discussed in * Peter Kennedy, 1981, "Estimation with Correctly Interpreted Dummy * Variables in Semi-Logarithmic Equations," American Economic Review, * p. 801. GEN1 BC=BETA:6 GEN1 SEC=SE:6 * The calculation is a corrected form of Equation (7.10), p. 219. GEN1 P = 100*(EXP(BC - SEC*SEC/2) - 1) PRINT P * Example 10.11, p. 341 * Generate monthly seasonal dummy variables. MATRIX MDUM=SEAS(131,12) DO #=1,12 GENR m#=MDUM:# ENDO * The data set starts in February, 1978. * Therefore, m1 = 1 for February and 0 otherwise * m2 = 1 for March and 0 otherwise; etc. * Include seasonal dummy variables in the model. OLS lchnimp lchempi lgas lrtwex befile6 affile6 afdec6 m1-m11 * Test for joint significance TEST TEST m1=0 TEST m2=0 TEST m3=0 TEST m4=0 TEST m5=0 TEST m6=0 TEST m7=0 TEST m8=0 TEST m9=0 TEST m10=0 TEST m11=0 END * A variation - generate dummy variables for spring, summer and fall. * The base season is winter (Dec, Jan, Feb) * March, April, May GENR spr=m2+m3+m4 * June, July, August GENR sum=m5+m6+m7 * Sept, Oct, Nov GENR fall=m8+m9+m10 OLS lchnimp lchempi lgas lrtwex befile6 affile6 afdec6 spr sum fall * Test for joint significance TEST TEST spr=0 TEST sum=0 TEST fall=0 END * Example 12.3 OLS lchnimp lchempi lgas lrtwex befile6 affile6 afdec6 / RESID=U GEN1 NOBS=$N GEN1 nlag=3 GEN1 BEG=nlag+1 SAMPLE BEG NOBS DO #=1,nlag GENR U#=LAG(U,#) ENDO * Auxiliary regression OLS U lchempi lgas lrtwex befile6 affile6 afdec6 U1-U3 * Calculate the F-test statistic for the joint significance of * U1, U2 and U3. TEST TEST U1=0 TEST U2=0 TEST U3=0 END * Alternatively, calculate the Breusch-Godfrey Test statistic in * Equation (12.24), p. 386. * First test for heteroskedasticity since the test assumes * homoskedastic errors. DIAGNOS / HET NOWHITE GEN1 LM=$N*$R2 * Calculate a p-value for the test statistic. SAMPLE 1 1 DISTRIB LM / TYPE=CHI DF=nlag CDF=cdf GEN1 p_value=1-cdf PRINT LM p_value * Example 12.4 SAMPLE 1 NOBS * The AUTO command implements iterative Cochrane-Orcutt estimaton. * The first transformed observation is included in the estimation. AUTO lchnimp lchempi lgas lrtwex befile6 affile6 afdec6 * The text reports an R-Square based on the transformed dependent * variable. SHAZAM reports an R-Square based on the untransformed * dependent variable. The SHAZAM output from AUTO states: * ..NOTE..R-SQUARE,ANOVA,RESIDUALS DONE ON ORIGINAL VARS * To produce the results in Table 12.1, p. 391 use the DROP * option to drop the first observation. AUTO lchnimp lchempi lgas lrtwex befile6 affile6 afdec6 / DROP STOP