* * Example 8.7 from page 278 * open data smoke.raw data(format=free,org=columns) 1 807 educ cigpric white age income cigs restaurn lincome agesq lcigpric * linreg cigs / u # constant lincome lcigpric educ age agesq restaurn * * Tests for heteroscedasticity * set usq = u**2 linreg(noprint) usq # constant lincome lcigpric educ age agesq restaurn exclude(title="Breusch-Pagan, F Form") # lincome lcigpric educ age agesq restaurn cdf(title="Breusch-Pagan, LM Form") chisqr %trsquared 5 * * Feasible GLS * set logusq = log(u**2) linreg logusq # constant lincome lcigpric educ age agesq restaurn prj fitlog linreg(spread=exp(fitlog)) cigs # constant lincome lcigpric educ age agesq restaurn