* References: Chapters 4 and 6 of * Jeffrey M. Wooldridge, Introductory Econometrics: A Modern Approach, * South-Western College Publishing, 2000. SAMPLE 1 680 READ (ATTEND.shd) attend termgpa priGPA ACT final atndrte hwrte & frosh soph skipped stndfnl SET MISSVALU=-999 SET SKIPMISS SET NOWARNMISS * Question 4.5, p. 147 * Estimate the unrestricted model. OLS atndrte priGPA ACT * The SHAZAM output automatically reports the t-statistic for * the coefficient on ACT. * Now show the calculations that the textbook asks for. * Save the R-square from the unrestricted model. GEN1 R_ur=$R2 * Save the degrees of freedom GEN1 DF=$df * Estimate the restricted model. OLS atndrte priGPA * Save the R-square from the restricted model. GEN1 R_r=$R2 * Calculate the F-statistic GEN1 F=DF*(R_ur - R_r)/(1-R_ur) * Now get the t-statistic GEN1 T=sqrt(F) * Print the results PRINT F T * Example 6.3 GENR priGPAsq=priGPA**2 GENR ACTsq=ACT**2 GENR priatn=priGPA*atndrte STAT priGPA / MEAN=MpriGPA * Equation (6.19), p. 191 OLS stndfnl atndrte priGPA ACT priGPAsq ACTsq priatn * Test for the significance of coefficients on attendance. TEST TEST atndrte=0 TEST priatn=0 END * Estimate the effect of attendance on the standardized exam score. * The TEST command reports the estimated standard error, t-statistic * and p-value for testing the null hypothesis that the effect is zero * against a 2-sided alternative. TEST atndrte+priatn*MpriGPA * On the TEST command the variable names represent the regression * coefficients. STOP