* * Example 6.3 * J. Wooldridge, Econometrics of Cross Section and Panel Data * * Note: The sample data files include all required data transformations. * However, in many cases we show how these data transformations would * be created in RATS from the basic data, as this is something you will * need to know how to do in practice. * open data mroz.raw data(format=free,org=columns) 1 428 inlf hours kidslt6 kidsge6 age educ wage repwage $ hushrs husage huseduc huswage faminc mtr motheduc fatheduc $ unem city exper nwifeinc lwage expersq * set lwage = log(wage) set expersq = exper**2 * * Test overidentification by performing 2SLS using all instruments, then * regressing the residuals on all the instruments. The TRSQ from that regression * is approximately chi-squared with degrees of freedom equal to # of instruments * - # of explanatory variables, here 2. * instruments constant exper expersq motheduc fatheduc huseduc linreg(instruments) lwage / resids # constant exper expersq educ linreg resids # constant exper expersq motheduc fatheduc huseduc cdf(title="Overidentification Test by Auxiliary Regression") chisqr %trsq 2 * * Other method (not described in the text). When you use LINREG with the * INSTRUMENTS option, RATS computes a "J-statistic" and its significance level, * which you can see in the output from the first LINREG. In this case, this will * be equal to the sum of squared residuals from the auxiliary regression used * above (the resids on instruments) divided by the estimated variance. This will * be almost exactly the same as the %trsq statistic above, differing only in the * included estimate of the residual variance. * * Heteroskedasticity-robust form of the test * * Get fitted values from educ on the instruments * linreg educ # constant exper expersq motheduc fatheduc huseduc prj educhat * * Get residuals from two of the instruments on the other explanatory * variables and educhat (rather than educ). * linreg motheduc / rmoth # constant exper expersq educhat linreg fatheduc / rfath # constant exper expersq educhat * * The test is now an "OPG" (outer product of the gradient) test which can be done * by a single calculation off an MCOV applied to the residuals from the * instruments auxiliary regressions with the 2SLS residuals. This is equivalent * to the (uncentered) TR**2 from the regression of 1's on the "Rxu" series, but * can be done without generating extra series.. * mcov(opgstat=lmrobust) / resids # rmoth rfath cdf(title="Robust Overidentification Test") chisqr lmrobust 2