** Chapter 8.4 ** for W.H. Greene, Econometric Analysis 6th ed. **************** * (c) Noel Roy 2003, 2008 * * 8.4 HETEROSKEDASTICITY * *=============================================================================== * * Example 8.1 (p. 159) Heteroskedastic Regression * READ (TableF8-1.prn) /NAMES * * First generate the variable INCOME2. * GENR Income2=Income**2 * * Use only those observations for which Avgexp is nonzero. * The SKIPIF (expression) command will cause subsequent commands to skip * observations for which the value of the expression is positive or true. * SET NOWARNSKIP SKIPIF (Avgexp .EQ. 0) * * Run the regression of Avgexp on Age, Ownrent, Income and Income squared using OLS. * ?OLS Avgexp Age Ownrent Income Income2 / RESID=U * * Replicate Figure 8.1 by plotting the residuals U against Income. * The SKIPped observations have missing U, so turn off the warnings. * SET NOWARNMISS GRAPH U Income / NOKEY * STOP *=============================================================================== * Updated September 4, 2008