* * Example 7.8 and 7.9 * 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. * cal(panelobs=2) all 366//2 open data gpa.xls data(format=xls,org=columns) / term sat tothrs cumgpa major season frstsem crsgpa $ crspop verbmath trmgpa hssize race hsrank id $ spring female black white hsperc * linreg trmgpa / resids # constant spring cumgpa crsgpa frstsem season sat verbmath hsperc hssize black female * * Test for serial correlation by rerunning the regression including the lagged * residuals as an explanatory variable. This knocks out the first observation in * each individual, so we get half the sample size. The frstsem and spring dummies * are dropped from the regression. (When using RATS, it actually doesn't hurt to * leave them in. RATS will detect the linear dependence and zero the coefficients * and their standard errors). * linreg trmgpa # constant cumgpa crsgpa season sat verbmath hsperc hssize black female resids{1}