* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Fourth Edition, Wiley, 2011. * Chapter 8 Heteroskedasticity * Data set on food expenditure and weekly income from a * random sample of 40 households. SAMPLE 1 40 READ (food.dat) / names * Chapter 8.2 Testing for Heteroskedasticity * Sort the data by income SORT INCOME FOOD / DESC * Least squares estimation of the food expenditure model * The RESID= option is used to save the residuals for use later. OLS FOOD INCOME / RESID=E * After equation estimation the DIAGNOS command reports a variety * of test statistics. * The HET option reports the White tests for heteroskedasticity * (page 306). * On the DIAGNOS command the CHOWONE= option reports the * Goldfeld-Quandt test for heteroskedasticity (top of page 309) * with a p-value for a one-sided test. DIAGNOS / CHOWONE=20 HET * Chapter 8.3 White standard errors - results on page 310. * A 95% confidence interval estimate for the slope coefficient * using least squares standard errors. CONFID INCOME / TCRIT=2.024 * The HETCOV option on the OLS command reports the * White's heteroskedasticity-consistent standard errors * The STDERR= option is used to save the White standard errors OLS FOOD INCOME / HETCOV STDERR=SD * A Confidence interval estimate using the White standard errors CONFID INCOME / TCRIT=2.024 * The White standard errors reported on page 310 are calculated * with an adjustment that scales the variance matrix using N/(N-K) * as follows. GEN1 SEB2=(SD:1)*sqrt(40/38) PRINT SEB2 * --------------------------------------------------------------- * The next commands show the calculations using Equation (8.24) * page 309 to get White standard errors. STAT INCOME / CPDEV=SSX2 MEAN=XBAR * The least squares residuals are saved in the variable E. GENR XE=(INCOME-XBAR)*E * White variance estimator, Equation (8.24), page 309. MATRIX VARB2=(XE'XE)/(SSX2*SSX2) * White standard error GEN1 SEB2=SQRT(VARB2) PRINT SEB2 * --------------------------------------------------------------- * Chapter 8.4.1 Weighted Least Squares * Specify a weight variable (SHAZAM works with the inverse) GENR W=1/INCOME * Equation (8.32), p. 313 OLS FOOD INCOME / WEIGHT=W * 95% confidence interval, p. 313 CONFID INCOME / TCRIT=2.024 * Chapter 8.5 Multiplicative Heteroskedasticity * The HET command can be used for Maximum Likelihood Estimation of * the model given in Equations (8.45) and (8.46), p. 318. * This method is an alternative estimation method to the GLS * method discussed in the text. HET FOOD INCOME (INCOME) / MODEL=MULT STOP