* R. Carter Hill, William E. Griffiths and Guay C. Lim, * Principles of Econometrics, Third Edition, Wiley, 2008. * Chapter 8 Heteroskedasticity * Data set on food expenditure and weekly income from a * random sample of 40 households. SAMPLE 1 40 READ (food.shd) FOOD INCOME * Chapter 8.2 White standard errors - results on page 202. * Least squares estimation of the food expenditure model OLS FOOD INCOME * A 95% confidence interval estimate for the slope coefficient. CONFID INCOME / TCRIT=2.024 * The HETCOV option on the OLS command reports the * White's heteroskedasticity-consistent 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 at top of page 202 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.9) * page 201 to get White standard errors. STAT INCOME / CPDEV=SSX2 MEAN=XBAR OLS FOOD INCOME / RESID=E GENR XE=(INCOME-XBAR)*E * White variance estimator, Equation (8.9) MATRIX VARB2=(XE'XE)/(SSX2*SSX2) * White standard error GEN1 SEB2=SQRT(VARB2) PRINT SEB2 * --------------------------------------------------------------- * Chapter 8.3.1 Weighted Least Squares * Specify a weight variable (SHAZAM works with the inverse) GENR W=1/INCOME * Equation (8.16), p. 204 OLS FOOD INCOME / WEIGHT=W * 95% confidence interval, p. 205 CONFID INCOME / TCRIT=2.024 * Chapter 8.3.2 Multiplicative Heteroskedasticity * The HET command can be used for Maximum Likelihood Estimation of * the model given in Equations (8.25) and (8.26), p. 207. * This method is an alternative estimation method to the GLS * method discussed in the text. HET FOOD INCOME (INCOME) / MODEL=MULT * Chapter 8.4 Testing for Heteroskedasticity * Sort the data by income SORT INCOME FOOD / DESC OLS FOOD INCOME * On the DIAGNOS command the CHOWONE= option reports the * Goldfeld-Quandt test for heteroskedasticity (bottom of page 212) * with a p-value for a one-sided test. * The HET option reports the tests for heteroskedasticity * reported on page 215. DIAGNOS / CHOWONE=20 HET STOP