* * Example 18.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 fertil2.raw data(format=free,org=columns) 1 4361 mnthborn yearborn age electric radio tv bicycle educ $ ceb agefbrth children knowmeth usemeth monthfm yearfm agefm $ idlnchld heduc agesq urban urb_educ spirit protest catholic $ frsthalf educ0 evermarr educ7 * set educ7 = educ>=7 set agesq = age**2 * * Estimate OLS regression. * linreg children # constant educ7 age agesq evermarr urban electric tv * * Now 2SLS with frsthalf as an instrument for educ7. * instruments constant frsthalf age agesq evermarr urban electric tv linreg(instruments) children # constant educ7 age agesq evermarr urban electric tv * * Use first stage probit probabilities as an instrument instead. * ddv(dist=probit) educ7 # constant frsthalf age agesq evermarr urban electric tv prj(dist=probit,cdf=propensity) instruments constant propensity age agesq evermarr urban electric tv linreg(instruments) children # constant educ7 age agesq evermarr urban electric tv * * Same thing with robust errors * linreg(instruments,robusterrors) children # constant educ7 age agesq evermarr urban electric tv