* * Example 4.1 * 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 * * Estimate regression with non-robust standard errors. * linreg lwage # constant exper expersq educ age kidslt6 kidsge6 * * Test exclusion of age and kids variables * exclude(title="Wald Test") # age kidslt6 kidsge6 * * Do LM version of test - * start with restricted regression and save the residuals * linreg lwage / resids # constant exper expersq educ * * Now regress residuals on the full set of variables. The variable %TRSQ is the * test statistic. It's asymptotically chisquared with 3 df. * linreg resids # constant exper expersq educ age kidslt6 kidsge6 cdf(title="LM Test") chisqr %trsq 3 * * Reestimate using robust standard errors * linreg(robusterrors) lwage # constant exper expersq educ age kidslt6 kidsge6 * * Repeat exclusion restriction (from Example 4.1, continued) * with the robust covariance matrix. * exclude(title="Heteroskedasticity Consistent Wald Test") # age kidslt6 kidsge6 * * Robust LM test (from Example 4.1 continued) * There's a procedure (described below) to do this, but this goes through the * steps described in the text. * linreg(noprint) age / rage # constant exper expersq educ linreg(noprint) kidslt6 / rlt6 # constant exper expersq educ linreg(noprint) kidsge6 / rge6 # constant exper expersq educ * * An OPG test like this can be done using MCOV with the OPGSTAT option. This * produces the test statistic, and CDF can then be used to compute and print the * significance level. * mcov(opgstat=lmrobust) / resids # rage rlt6 rge6 cdf(title="Robust LM Test") chisqr lmrobust 3 * * Same test done using the RobustLMTest procedure. You follow the regression with * @RobustLMTest and list the test variables below. * linreg lwage # constant exper expersq educ @RobustLMTest # age kidslt6 kidsge6