--------------------------------------------------------------------------------- name: log: C:\Users\vkbostwick\Dropbox\Teaching_Grad_Metrics930\Homeworks\HW2_P > roblem4.log log type: text opened on: 10 Mar 2020, 16:13:56 . . . . use "wagepan.dta", clear . . ***(a) Estimate this equation by pooled OLS and report the results. . reg lwage i.year educ black hisp c.exper##c.exper married union Source | SS df MS Number of obs = 4,360 -------------+---------------------------------- F(14, 4345) = 72.46 Model | 234.048277 14 16.7177341 Prob > F = 0.0000 Residual | 1002.48136 4,345 .230720682 R-squared = 0.1893 -------------+---------------------------------- Adj R-squared = 0.1867 Total | 1236.52964 4,359 .283672779 Root MSE = .48033 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- year | 1981 | .05832 .0303536 1.92 0.055 -.0011886 .1178286 1982 | .0627744 .0332141 1.89 0.059 -.0023421 .1278909 1983 | .0620117 .0366601 1.69 0.091 -.0098608 .1338843 1984 | .0904672 .0400907 2.26 0.024 .011869 .1690654 1985 | .1092463 .0433525 2.52 0.012 .0242533 .1942393 1986 | .1419596 .046423 3.06 0.002 .0509469 .2329723 1987 | .1738334 .049433 3.52 0.000 .0769194 .2707474 | educ | .0913498 .0052374 17.44 0.000 .0810819 .1016177 black | -.1392342 .0235796 -5.90 0.000 -.1854622 -.0930062 hisp | .0160195 .0207971 0.77 0.441 -.0247535 .0567925 exper | .0672345 .0136948 4.91 0.000 .0403856 .0940834 | c.exper#| c.exper | -.0024117 .00082 -2.94 0.003 -.0040192 -.0008042 | married | .1082529 .0156894 6.90 0.000 .0774937 .1390122 union | .1824613 .0171568 10.63 0.000 .1488253 .2160973 _cons | .0920558 .0782701 1.18 0.240 -.0613935 .2455051 ------------------------------------------------------------------------------ . . ***Are the usual OLS standard errors reliable? Explain. . *Answer: No. Even if ci is uncorrelated with xit for all t, the usual OLS stand > ard errors do not account for the serial correlation in vit = ci + uit. You can > see below that the fully robust standard errors (which account for correlation > between all vit within the same person) are substantially larger than the usua > l ones because of this serial correlation. . . ***Compute more appropriate standard errors. . reg lwage i.year educ black hisp c.exper##c.exper married union, cluster(nr) Linear regression Number of obs = 4,360 F(14, 544) = 47.10 Prob > F = 0.0000 R-squared = 0.1893 Root MSE = .48033 (Std. Err. adjusted for 545 clusters in nr) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- year | 1981 | .05832 .028228 2.07 0.039 .0028707 .1137693 1982 | .0627744 .0369735 1.70 0.090 -.0098538 .1354027 1983 | .0620117 .046248 1.34 0.181 -.0288348 .1528583 1984 | .0904672 .057988 1.56 0.119 -.0234407 .204375 1985 | .1092463 .0668474 1.63 0.103 -.0220644 .240557 1986 | .1419596 .0762348 1.86 0.063 -.007791 .2917102 1987 | .1738334 .0852056 2.04 0.042 .0064611 .3412057 | educ | .0913498 .0110822 8.24 0.000 .0695807 .1131189 black | -.1392342 .0505238 -2.76 0.006 -.2384798 -.0399887 hisp | .0160195 .0390781 0.41 0.682 -.060743 .092782 exper | .0672345 .0195958 3.43 0.001 .0287417 .1057273 | c.exper#| c.exper | -.0024117 .0010252 -2.35 0.019 -.0044255 -.0003979 | married | .1082529 .026034 4.16 0.000 .0571135 .1593924 union | .1824613 .0274435 6.65 0.000 .1285531 .2363695 _cons | .0920558 .1609365 0.57 0.568 -.2240773 .4081888 ------------------------------------------------------------------------------ . . . . . ***(b) Estimate the equation by Random Effects. . xtset nr year panel variable: nr (strongly balanced) time variable: year, 1980 to 1987 delta: 1 unit . xtreg lwage i.year educ black hisp c.exper##c.exper married union, re cluster(n > r) Random-effects GLS regression Number of obs = 4,360 Group variable: nr Number of groups = 545 R-sq: Obs per group: within = 0.1799 min = 8 between = 0.1860 avg = 8.0 overall = 0.1830 max = 8 Wald chi2(14) = 610.97 corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000 (Std. Err. adjusted for 545 clusters in nr) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- year | 1981 | .040462 .0275684 1.47 0.142 -.0135711 .0944951 1982 | .0309212 .0350705 0.88 0.378 -.0378158 .0996581 1983 | .0202806 .043861 0.46 0.644 -.0656853 .1062466 1984 | .0431187 .0555848 0.78 0.438 -.0658254 .1520628 1985 | .0578155 .0645584 0.90 0.370 -.0687167 .1843476 1986 | .0919476 .0747028 1.23 0.218 -.0544671 .2383623 1987 | .1349289 .0848618 1.59 0.112 -.0313971 .3012549 | educ | .0918763 .0111455 8.24 0.000 .0700315 .1137211 black | -.1393767 .0509251 -2.74 0.006 -.2391882 -.0395653 hisp | .0217317 .0399157 0.54 0.586 -.0565015 .099965 exper | .1057545 .016379 6.46 0.000 .0736522 .1378568 | c.exper#| c.exper | -.0047239 .0007917 -5.97 0.000 -.0062756 -.0031723 | married | .063986 .0189722 3.37 0.001 .0268013 .1011708 union | .1061344 .020844 5.09 0.000 .065281 .1469879 _cons | .0235864 .1599577 0.15 0.883 -.289925 .3370977 -------------+---------------------------------------------------------------- sigma_u | .32460315 sigma_e | .35099001 rho | .46100216 (fraction of variance due to u_i) ------------------------------------------------------------------------------ . . ***Compare your estimates with the pooled OLS estimates. . *Answer: The random effects estimates on the time-constant variables are simila > r to the pooled OLS estimates. The coefficients on the quadratic in experience > for RE show an initially stronger effect of experience, but with the slope dimi > nishing more rapidly. There are important differences in the variables that cha > nge across individual and time; they are notably lower for random effects. The > random effects marriage premium is about 6.4%, while the pooled OLS estimate is > about 10.8%. For union status, the random effects estimate is 10.6% compared w > ith a pooled OLS estimate of 18.2%. Note that the RE standard errors for the co > efficients on the time-constant explanatory variables are similar to the fully > robust POLS standard errors. However, the RE standard errors for married and un > ion are substantially smaller than the robust POLS standard errors, suggestive > of the relative efficiency of RE. . . . . . . ***(c) Now estimate the equation by Fixed Effects. . xtreg lwage i.year educ black hisp c.exper##c.exper married union, fe cluster(n > r) note: educ omitted because of collinearity note: black omitted because of collinearity note: hisp omitted because of collinearity note: exper omitted because of collinearity Fixed-effects (within) regression Number of obs = 4,360 Group variable: nr Number of groups = 545 R-sq: Obs per group: within = 0.1806 min = 8 between = 0.0286 avg = 8.0 overall = 0.0888 max = 8 F(10,544) = 46.59 corr(u_i, Xb) = -0.1222 Prob > F = 0.0000 (Std. Err. adjusted for 545 clusters in nr) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- year | 1981 | .1511912 .0255648 5.91 0.000 .1009733 .2014091 1982 | .2529709 .0286624 8.83 0.000 .1966684 .3092733 1983 | .3544437 .0348608 10.17 0.000 .2859655 .422922 1984 | .4901148 .0454581 10.78 0.000 .4008199 .5794097 1985 | .6174823 .0568088 10.87 0.000 .5058908 .7290737 1986 | .7654966 .071244 10.74 0.000 .6255495 .9054436 1987 | .9250249 .0840563 11.00 0.000 .7599103 1.09014 | educ | 0 (omitted) black | 0 (omitted) hisp | 0 (omitted) exper | 0 (omitted) | c.exper#| c.exper | -.0051855 .0008102 -6.40 0.000 -.0067771 -.0035939 | married | .0466804 .0210038 2.22 0.027 .0054218 .0879389 union | .0800019 .0227431 3.52 0.000 .0353268 .1246769 _cons | 1.426019 .0209824 67.96 0.000 1.384802 1.467235 -------------+---------------------------------------------------------------- sigma_u | .39176195 sigma_e | .35099001 rho | .55472817 (fraction of variance due to u_i) ------------------------------------------------------------------------------ . . . ***Why is experit redundant in the model even though it changes over time? . *Answer: The variable experit is redundant because everyone in the sample works > every year, so experi,t+1 = experit + 1, t = 1,…,7, for all i. The effects of > the initial levels of experience, experi1, cannot be distinguished from ci beca > use we are allowing experi1 to be correlated with ci. Then, because each experi > ence variable follows the same linear time trend, the effects cannot be separat > ed from the aggregate time effects (year dummies). . . ***What happens to the marriage and union premiums as compared with the RE esti > mates? . *Answer: The marriage and union premiums are even smaller that in the RE analys > is (4.7% and 8% respectively). However, both premia are still statistically sig > nificant and economically relevant. . . . . . . ***(d) Add the interaction terms: blacki*unionit and hispi*unionit. Do the unio > n wage premiums differ by race? Obtain the usual FE statistics and those fully > robust to heteroskedasticity and serial correlation. . . *Answer: With usual (non-robust) standard errors and statistics: . xtreg lwage i.year educ c.exper##c.exper married i.black##union i.hisp##union , > fe note: educ omitted because of collinearity note: exper omitted because of collinearity note: 1.black omitted because of collinearity note: 1.hisp omitted because of collinearity Fixed-effects (within) regression Number of obs = 4,360 Group variable: nr Number of groups = 545 R-sq: Obs per group: within = 0.1830 min = 8 between = 0.0267 avg = 8.0 overall = 0.0871 max = 8 F(12,3803) = 70.99 corr(u_i, Xb) = -0.1360 Prob > F = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- year | 1981 | .1507003 .0219236 6.87 0.000 .1077172 .1936833 1982 | .2545937 .0243936 10.44 0.000 .206768 .3024194 1983 | .3576139 .029227 12.24 0.000 .3003119 .414916 1984 | .4947141 .0362132 13.66 0.000 .423715 .5657132 1985 | .6236823 .0452345 13.79 0.000 .5349961 .7123686 1986 | .7750896 .0561524 13.80 0.000 .664998 .8851813 1987 | .9344805 .0687783 13.59 0.000 .7996347 1.069326 | educ | 0 (omitted) exper | 0 (omitted) | c.exper#| c.exper | -.005308 .0007048 -7.53 0.000 -.0066898 -.0039262 | married | .0461639 .0182922 2.52 0.012 .0103004 .0820275 1.black | 0 (omitted) 1.union | .0957205 .0244326 3.92 0.000 .0478183 .1436227 | black#union | 1 1 | .0714378 .0532042 1.34 0.179 -.0328737 .1757492 | 1.hisp | 0 (omitted) | hisp#union | 1 1 | -.1302478 .0485409 -2.68 0.007 -.2254166 -.0350791 | _cons | 1.42681 .0183207 77.88 0.000 1.390891 1.462729 -------------+---------------------------------------------------------------- sigma_u | .393505 sigma_e | .35056318 rho | .55752062 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(544, 3803) = 9.17 Prob > F = 0.0000 . lincom 1.union + 1.black#1.union ( 1) 1.union + 1.black#1.union = 0 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .1671582 .0472987 3.53 0.000 .074425 .2598915 ------------------------------------------------------------------------------ . lincom 1.union + 1.hisp#1.union ( 1) 1.union + 1.hisp#1.union = 0 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -.0345273 .0419341 -0.82 0.410 -.1167428 .0476881 ------------------------------------------------------------------------------ . . *Answer: With fully robust standard errors and statistics: . xtreg lwage i.year educ c.exper##c.exper married i.black##union i.hisp##union , > fe cluster(nr) note: educ omitted because of collinearity note: exper omitted because of collinearity note: 1.black omitted because of collinearity note: 1.hisp omitted because of collinearity Fixed-effects (within) regression Number of obs = 4,360 Group variable: nr Number of groups = 545 R-sq: Obs per group: within = 0.1830 min = 8 between = 0.0267 avg = 8.0 overall = 0.0871 max = 8 F(12,544) = 40.16 corr(u_i, Xb) = -0.1360 Prob > F = 0.0000 (Std. Err. adjusted for 545 clusters in nr) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- year | 1981 | .1507003 .025519 5.91 0.000 .1005725 .2008281 1982 | .2545937 .0286062 8.90 0.000 .1984014 .3107859 1983 | .3576139 .0348463 10.26 0.000 .2891641 .4260638 1984 | .4947141 .0453929 10.90 0.000 .4055473 .5838809 1985 | .6236823 .056721 11.00 0.000 .5122633 .7351014 1986 | .7750896 .071142 10.89 0.000 .635343 .9148363 1987 | .9344805 .0838788 11.14 0.000 .7697145 1.099247 | educ | 0 (omitted) exper | 0 (omitted) | c.exper#| c.exper | -.005308 .0008095 -6.56 0.000 -.0068982 -.0037178 | married | .0461639 .0209641 2.20 0.028 .0049834 .0873444 1.black | 0 (omitted) 1.union | .0957205 .0304494 3.14 0.002 .0359077 .1555333 | black#union | 1 1 | .0714378 .0600866 1.19 0.235 -.0465925 .189468 | 1.hisp | 0 (omitted) | hisp#union | 1 1 | -.1302478 .0493283 -2.64 0.009 -.2271451 -.0333505 | _cons | 1.42681 .0209431 68.13 0.000 1.385671 1.467949 -------------+---------------------------------------------------------------- sigma_u | .393505 sigma_e | .35056318 rho | .55752062 (fraction of variance due to u_i) ------------------------------------------------------------------------------ . lincom 1.union + 1.black#1.union ( 1) 1.union + 1.black#1.union = 0 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .1671582 .05168 3.23 0.001 .0656414 .2686751 ------------------------------------------------------------------------------ . lincom 1.union + 1.hisp#1.union ( 1) 1.union + 1.hisp#1.union = 0 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | -.0345273 .0388508 -0.89 0.375 -.1108432 .0417886 ------------------------------------------------------------------------------ . . *The union premium is 9.6% for non-black, non-hispanic workers. For black worke > rs the union premium is 7.1 percentage points higher (16.7%) but this differenc > e is not statistically significant. For hispanic workers, the union premium is > 13pp lower and this difference between the non-black, non-hispanic premium and > the hispanic union premium is statistically significant. This makes the total u > nion premium for hispanic workers negative (-0.35%) but this is not statistical > ly different from zero. . . log close name: log: C:\Users\vkbostwick\Dropbox\Teaching_Grad_Metrics930\Homeworks\HW2_P > roblem4.log log type: text closed on: 10 Mar 2020, 16:13:56 ---------------------------------------------------------------------------------