* Reference: Chapter 5 of * Ernst R. Berndt, The Practice of Econometrics, Addison-Wesley, 1991. SAMPLE 1 550 READ (CPS78) ED SOUTH NONWH HISP FE MARR MARRFE EX EXSQ UNION & LNWAGE AGE NDEP MANUF CONSTR MANAG SALES CLER SERV PROF / SKIPLINES=2 * Exercise 1, p. 194 GENR WAGE = EXP(LNWAGE) * (a) Calculate the arithmetic mean STAT WAGE LNWAGE / MEAN=MU GEN1 AN=MU:1 * Calculate the geometric mean GEN1 GN=EXP(MU:2) PRINT AN GN * Consider a work year of 2000 hours GEN1 SALARY=GN*2000 PRINT SALARY * (b) The sample mean of the dummy variable NONWH gives the proportion * of individuals that are non-white and non-Hispanic. * The sample mean of FE gives the proportion of the sample that * is female. STAT NONWH HISP FE / SUMS=TOT * Number of individals that are non-white and non-Hispanic GEN1 N_NONWH=TOT:1 * Number of individals that are Hispanic GEN1 N_HISP=TOT:2 * Number of females GEN1 N_FEMALE=TOT:3 PRINT N_NONWH N_HISP N_FEMALE * (c) Calculate summary statistics by gender SET NOWARNSKIP DO #=0,1 GEN1 TYPE=1-# SKIPIF (FE.EQ.TYPE) STAT ED LNWAGE / MEAN=MU DELETE SKIP$ GEN1 ED#=MU:1 GEN1 GN#=EXP(MU:2) ENDO * ED0 - mean years of schooling males * ED1 - mean years of schooling females * GN0 - geometric mean wage rate males * GN1 - geometric mean wage rate females PRINT ED0 ED1 GN0 GN1 * Exercise 2, p. 196 * (a) OLS LNWAGE ED * 95% confidence interval for the coefficient on ED. CONFID ED * (b) A test of the null hypothesis that intercept terms for * union and non-union individuals are identical is obtained * by inspecting the t-test statistic and p-value reported for * the coefficient on UNION. OLS LNWAGE ED UNION * (c) Alternative to (b) GENR NONU=1-UNION OLS LNWAGE ED UNION NONU / NOCONSTANT TEST UNION=NONU * (e) Another equivalent form to (b) and (c) OLS LNWAGE ED NONU * Exercise 3, p. 197. * (a) A simple human capital model. OLS LNWAGE ED EX EXSQ * (b) Intercepts vary by gender OLS LNWAGE FE ED EX EXSQ * (c) Include marital status OLS LNWAGE FE MARR ED EX EXSQ * (d) Construct an interaction variable GENR INFMAR=FE*MARR GENR CHECK=INFMAR-MARRFE STAT CHECK * (e) OLS LNWAGE FE MARR INFMAR ED EX EXSQ * Exercise 4, p. 199. * (a) The "base model" OLS LNWAGE FE UNION NONWH HISP ED EX EXSQ / COEF=BETA * Find the turning point - the TEST command reports this as * TEST VALUE. TEST -EX/(2*EXSQ) * The TEST VALUE is saved in the temporary variable $VAL. GEN1 MAX=$VAL SAMPLE 1 3 READ EDUCYR / BYVAR 8 12 16 GENR AGEX=MAX+EDUCYR+6 PRINT EDUCYR AGEX * (b) Calculate sample means of the regressors SAMPLE 1 550 STAT FE UNION NONWH HISP ED / MEANS=MX * Set the age range from 18 to 65 SAMPLE 1 48 GENR AGE0=TIME(17) DO #=1,5 GENR XVAL#=MX:# ENDO * Calculate experience - XVAL5 is the mean of education. GENR EX0=AGE0-XVAL5-6 GENR EXSQ0=EX0*EX0 GENR Y0=0 * Use the FC command for prediction FC Y0 XVAL1-XVAL5 EX0 EXSQ0 / COEF=BETA PREDICT=YHAT GENR WAGE_HAT=EXP(YHAT) GRAPH WAGE_HAT AGE0 / LINEONLY * (c) SAMPLE 1 550 GENR EDEX=ED*EX OLS LNWAGE FE UNION NONWH HISP ED EX EXSQ EDEX * Calculate EX* for individuals with 8, 12 and 16 years of schooling. * On the TEST command the variable names represent the coefficients. TEST -(EX+EDEX*8)/(2*EXSQ) TEST -(EX+EDEX*12)/(2*EXSQ) TEST -(EX+EDEX*16)/(2*EXSQ) * (e) Restrict the sample to married females SKIPIF (FE.EQ.0) SKIPIF (MARR.EQ.0) OLS LNWAGE UNION NONWH HISP ED EX EXSQ EDEX TEST -(EX+EDEX*8)/(2*EXSQ) TEST -(EX+EDEX*12)/(2*EXSQ) TEST -(EX+EDEX*16)/(2*EXSQ) DELETE SKIP$ * Exercise 5, p. 201 * (a) OLS LNWAGE FE UNION NONWH HISP ED EX EXSQ * (b) Calculate summary statistics by union membership DO #=0,1 GEN1 TYPE=1-# SKIPIF (UNION.EQ.TYPE) STAT LNWAGE FE NONWH HISP ED EX / MEAN=MVAR DELETE SKIP$ GEN1 ED#=MVAR:5 GEN1 GN#=EXP(MVAR:1) ENDO * ED0 - mean years of schooling non-union * ED1 - mean years of schooling union * GN0 - geometric mean wage rate non-union * GN1 - geometric mean wage rate union PRINT ED0 ED1 GN0 GN1 * (c) Sort the data so that the first group is non-union workers and * the second group is union workers. SORT UNION LNWAGE FE NONWH HISP ED EX EXSQ * Determine the number of union workers. STAT UNION / SUMS=NTOT * Determine the number of non-union workers. GEN1 NTOTA=550-NTOT * Estimate an equation for non-union workers. SAMPLE 1 NTOTA * The mean of UNION should be 0. STAT UNION OLS LNWAGE FE NONWH HISP ED EX EXSQ / COEF=BETA1 * The temporary variable $SSE = sum of squared errors. GEN1 SSE1=$SSE * Estimate an equation for union workers. GEN1 N0=NTOTA+1 SAMPLE N0 550 STAT UNION OLS LNWAGE FE NONWH HISP ED EX EXSQ / COEF=BETA2 GEN1 SSE2=$SSE * (d) Chow test SAMPLE 1 550 OLS LNWAGE FE NONWH HISP ED EX EXSQ GEN1 SSE0=$SSE GEN1 K=$K GEN1 DF1=K GEN1 DF2=550-2*K GEN1 CHOW=(DF2/DF1)*(SSE0-SSE1-SSE2)/(SSE1+SSE2) * p-value DISTRIB CHOW / TYPE=F DF1=DF1 DF2=DF2 GEN1 pval=1-$CDF PRINT CHOW pval * At a significance level of 1%, the null hypothesis of an identical * wage equation for union and non-union workers is rejected if the * p-value is less than 0.01. * (e) Estimate the union-nonunion wage differential by the Bloch- * Kuskin procedure. GENR ONE=1 SAMPLE 1 NTOTA STAT LNWAGE / MEAN=LW0 STAT FE NONWH HISP ED EX EXSQ ONE / MEAN=MVAR0 SAMPLE N0 550 STAT LNWAGE / MEAN=LW1 STAT FE NONWH HISP ED EX EXSQ ONE / MEAN=MVAR1 MATRIX BZZ=BETA2'*(MVAR1-MVAR0) GEN1 WDIFF=EXP((LW1-LW0)-BZZ) PRINT WDIFF * (f) Another procedure for estimating the union-nonunion wage * differential, workers' characteristics fixed. MATRIX BZZ=BETA1'*(MVAR1-MVAR0) GEN1 WDIFF=EXP((LW1-LW0)-BZZ) PRINT WDIFF STOP