* Reference: Chapters 3, 4, 6, 7 and 8 of * Jeffrey M. Wooldridge, Introductory Econometrics: A Modern Approach, * South-Western College Publishing, 2000. SAMPLE 1 526 READ (WAGE1.shd) wage educ exper tenure nonwhite female married numdep & smsa northcen south west construc ndurman trcommpu trade & services profserv profocc clerocc servocc lwage expersq tenursq * Example 3.2, pp. 74-75 and Example 4.1, pp. 120-121. * The LOGLIN option specifies that the dependent variable * is log-transformed and the explanatory variables are in levels. * This option is used for calculating elasticities. OLS lwage educ exper tenure / LOGLIN * Note that the t-statistic for the coefficient on exper is * reported as 2.39. The textbook calculation in Example 4.1 has rounded * the coefficient estimates and standard errors to use fewer * decimal places and reports the t-statistic as 2.41. * Find the effect on log(wage) for 3 additional years of experience TEST 3*exper * Section 6.2, Models with Quadratics, p. 186. OLS wage exper expersq * Estimate marginal effects. TEST exper + 2*expersq*1 TEST exper + 2*expersq*10 * Estimate the turning point using Equation (6.13), p. 187. TEST -exper/(2*expersq) * On the TEST command the variable names represent the regression * coefficients. * Example 7.1 * Equation (7.4), p. 215 OLS wage female educ exper tenure * Equation (7.5), p. 215 OLS wage female * Average wage for women in the sample TEST CONSTANT+female * Use an alternative approach to obtain a comparison-of-means test * between the two groups. * Set the variable wagef with the average wages for the females * in the sample. SET NOWARNSKIP SKIPIF (female.eq.0) COPY wage wagef DELETE SKIP$ * Set the variable wagem with the average wages for the males * in the sample. SKIPIF (female.eq.1) COPY wage wagem DELETE SKIP$ * The ANOVA option on the STAT command reports test statistics * for equal means. STAT wagef wagem / ANOVA * Example 7.5 * Equation (7.9), p. 219. OLS lwage female educ exper expersq tenure tenursq / COEF=BETA STDERR=SE * Estimate the percentage differential in wage for a female compared * to a male (holding all else constant). * An interpretation of coefficients on dummy variables is discussed in * Peter Kennedy, 1981, "Estimation with Correctly Interpreted Dummy * Variables in Semi-Logarithmic Equations," American Economic Review, * p. 801. GEN1 B=BETA:1 GEN1 SE=SE:1 * The calculation is a corrected form of Equation (7.10), p. 219. GEN1 P = 100*(EXP(B - SE*SE/2) - 1) PRINT P * Example 7.6 * Define dummy variables GENR marrmale=married*(1-female) GENR marrfem =married*female GENR singfem = (1-married)*female * Equation (7.11), p. 220. * The STDERR= option on the OLS command is used to save the * estimated standard errors for use later. OLS lwage marrmale marrfem singfem educ exper expersq tenure tenursq / & STDERR=SEOLS * Estimate the proportional difference in wage between single and * married women. The TEST command calculates a t-test statistic * and a p-value for a test of the null hypothesis of no difference * against a 2-sided alternative. TEST singfem-marrfem * Now consider the difference between married men and married women. TEST marrmale-marrfem * Example 7.10 * Equation (7.18), p. 227 * Generate an interaction variable GENR femeduc=female*educ OLS lwage female educ femeduc exper expersq tenure tenursq * Obtain the estimated return to education for women TEST educ+femeduc * Test of significance TEST TEST female=0 TEST femeduc=0 END * Example 8.1 * The HETCOV option on the OLS command calculates and reports * heteroskedasticity-robust standard errors. OLS lwage marrmale marrfem singfem educ exper expersq tenure tenursq / & HETCOV COEF=BETA STDERR=SEROBUST * Compare the OLS standard errors with the robust standard errors. * The temporary variable $K contains the number of estimated * coefficients in the previous estimation command. GEN1 K=$K SAMPLE 1 K FORMAT(5(A8,1X)) READ NAMES / FORMAT BYVAR marrmale marrfem singfem educ exper expersq tenure tenursq intercpt NAMEFMT(1X,A8,5X,3(4X,A8)) FORMAT(1X,A8,5X,3F12.5) PRINT NAMES BETA SEOLS SEROBUST / FORMAT STOP