* * Example 9.5 and 9.6 * 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 the labor supply function by OLS. * linreg hours # constant lwage educ age kidslt6 kidsge6 nwifeinc * * Now by 2SLS * instruments constant educ age kidslt6 kidsge6 nwifeinc exper expersq linreg(instruments) hours / resids # constant lwage educ age kidslt6 kidsge6 nwifeinc * * Test the one overidentifying restriction. (Again, you can look at the * J-statistic in the previous output to get almost the identical test value). * linreg(noprint) resids # constant constant educ age kidslt6 kidsge6 nwifeinc exper expersq cdf(title="Test of Overidentification") chisqr %trsq 1 * * Estimate the reduced form for hours to see whether the instruments excluded * from the wage equation will work. * linreg hours # constant educ age kidslt6 kidsge6 nwifeinc exper expersq exclude # age kidslt6 kidsge6 nwifeinc * * Estimate the wage equation by 2SLS. * linreg(instruments) lwage # constant hours educ exper expersq * * Check the reduced form for log(wage) and see if the instruments excluded from a * renormalized labor demand function work. * linreg lwage # constant educ age kidslt6 kidsge6 nwifeinc exper expersq exclude # age kidslt6 kidsge6 nwifeinc * * Estimate the labor demand function by 2SLS - (results will be suspect). * linreg(instruments) hours # constant lwage educ exper expersq * * Estimate the model by 3SLS (from problem 9.9) * * Define the two equations to be estimated * equation hourseq hours # constant lwage educ age kidslt6 kidsge6 nwifeinc equation wageeq lwage # constant hours educ exper expersq sur(instruments) 2 # hourseq # wageeq * * Example 9.6 * Add log(wage)**2 to the supply equation and add some squared terms to the list * of instruments. * set lwagesq = lwage**2 set agesq = age**2 set educsq = educ**2 set nwifeincsq = nwifeinc**2 * instruments constant educ age kidslt6 kidsge6 nwifeinc exper expersq agesq educsq nwifeincsq linreg(instruments) hours / resids # constant lwage lwagesq educ age kidslt6 kidsge6 nwifeinc * * Do a test of overidentifying restrictions. * linreg(noprint) resids # constant educ age kidslt6 kidsge6 nwifeinc exper expersq agesq educsq nwifeincsq cdf(title="Test of Overidentication") chisqr %trsq 3