* * Example BMS.DAT from pp 475-479 * open data bms.dat data(format=free,org=columns) 1 100 sales advertising comp pop * * First stage regressions * linreg sales # constant comp pop linreg advertising # constant comp pop * * Two Stage Least Squares. The first stage regressions shown above aren't * actually used, because the full calculation is done with a single LINREG * instruction with the INSTRUMENTS options. This is preceded by an INSTRUMENTS * instruction which lists the predetermined variables. * instruments constant comp pop linreg sales ;* OLS estimates # constant advertising comp linreg(instruments) sales # constant advertising comp * linreg advertising # constant sales pop linreg(instruments) advertising # constant sales pop * * Hausman test done using auxiliary regressions. * linreg advertising # constant pop comp set v1 = %resids linreg sales # constant advertising comp v1 exclude(title="Hausman Specification Test for endogeneity of advertising") # v1 * * Hausman test doing using the RegWuTest procedure. (The Wu test is a special case * of the Hausman test applied to 2SLS). * linreg(instruments) sales # constant advertising comp @RegWuTest