* * Examples 19.1, 19.2 * 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 agesq = age**2 * * OLS regression. * linreg children # educ age agesq evermarr urban electric tv constant * * Poisson regression. * ddv(type=count,robusterrors) children / resids # educ age agesq evermarr urban electric tv constant * * Example 19.2 * Test of exogeneity of educ. * Do first stage regression for educ, using frsthalf as an instrument. * linreg educ / reduc # frsthalf age agesq evermarr urban electric tv constant * ddv(type=count,robusterrors) children # educ age agesq evermarr urban electric tv constant reduc