* * Griliches exercise from page 236 * open data grilic.xls data(org=columns,format=xls) 1 758 $ rns rns80 mrt mrt80 smsa smsa80 $ med iq kww year $ age age80 s s80 expr expr80 tenure tenure80 lw lw80 * * Generate year dummies * set y66 = year(t).eq.66 set y67 = year(t).eq.67 set y68 = year(t).eq.68 set y69 = year(t).eq.69 set y70 = year(t).eq.70 set y71 = year(t).eq.71 set y73 = year(t).eq.73 * * (a) Table I * table cmom(print,corr) # s iq * * (b1) wage equation by OLS, ability ignored * linreg(title="OLS, Ability ignored") lw # s expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 * * (b2) wage equation by OLS, IQ included * linreg(title="OLS, IQ included") lw # s iq expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 * * (b3) 2SLS on wage equation: schooling predetermined * instruments s expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 med kww mrt age linreg(inst,title="IV with Schooling Predetermined") lw / res0 # s iq expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 * * (c) Sargan statistic. This differs from the "J" statistic in the regression output * only by a degrees of freedom correction in the variance estimator * compute sargan=%uzwzu/(%rss/%nobs) cdf(title="Sargan Specification Test") chisquare sargan 3 * * (d) 2SLS as two OLS's * linreg iq # s expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 med kww mrt age prj iqhat linreg lw # s iqhat expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 * * (e) 2SLS on wage equation: schooling endogenous * instruments expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 med kww mrt age linreg(inst,title="IV with Schooling Endogenous") lw # s iq expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 compute sargan=%uzwzu/(%rss/%nobs) cdf(title="Sargan Specification Test") chisquare sargan 2 * * (f) GMM estimation of wage equation * * 1st GMM: schooling predetermined * * Method 1 - using the OPTIMALWEIGHTS option. This will pick the "optimal" * weights for this regression. You don't have to use ROBUSTERRORS with this. * instruments s expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 med kww mrt age linreg(inst,optimalweights) lw # s iq expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 * * Method 2 - computing the weight matrix directly. We need to do this in this * application, because we want to make sure that the same set of residuals go * into each weight matrix or we might end up with a poorly behaved test statistic * instruments s expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 med kww mrt age mcov(instruments) / res0 linreg(inst,wmatrix=inv(%cmom),robusterrors) lw # s iq expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 compute j0=%uzwzu * * 2nd GMM: schooling endogenous * instruments expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 med kww mrt age mcov(instruments) / res0 linreg(inst,wmatrix=inv(%cmom),robusterrors) lw # s iq expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 compute j1=%uzwzu compute cstat=j0-j1 cdf(title="Test for Exogeneity of Schooling") chisquare cstat 1 * * (g) 2SLS on wage equation: don't use MED and KWW * instruments expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 mrt age linreg(inst) lw # s iq expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 * * What's going on? * linreg s # expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 mrt age linreg iq # expr tenure rns smsa y66 y67 y68 y69 y70 y71 y73 mrt age