Title: Heteroskedasticity
1Chapter 8
ECON 4550 Econometrics Memorial University of
Newfoundland
Adapted from Vera Tabakovas notes
2Chapter 8 Heteroskedasticity
- 8.1 The Nature of Heteroskedasticity
- 8.2 Using the Least Squares Estimator
- 8.3 The Generalized Least Squares Estimator
- 8.4 Detecting Heteroskedasticity
38.1 The Nature of Heteroskedasticity
(8.1)
(8.2)
(8.3)
48.1 The Nature of Heteroskedasticity
- Figure 8.1 Heteroskedastic Errors
58.1 The Nature of Heteroskedasticity
(8.4)
Food expenditure example
68.1 The Nature of Heteroskedasticity
- Figure 8.2 Least Squares Estimated Expenditure
Function and Observed Data Points
78.2 Using the Least Squares Estimator
- The existence of heteroskedasticity implies
- The least squares estimator is still a linear and
unbiased estimator, but it is no longer best.
There is another estimator with a smaller
variance. - The standard errors usually computed for the
least squares estimator are incorrect. Confidence
intervals and hypothesis tests that use these
standard errors may be misleading.
88.2 Using the Least Squares Estimator
(8.5)
(8.6)
(8.7)
98.2 Using the Least Squares Estimator
(8.8)
(8.9)
108.2 Using the Least Squares Estimator
We can use a robust estimator regress food_exp
income, robust
118.2 Using the Least Squares Estimator
In SHAZAM the HETCOV option on the OLS command
reports the White's heteroskedasticity-consistent
standard errors OLS FOOD INCOME / HETCOV
Confidence interval estimate using the White
standard errors CONFID INCOME / TCRIT2.024 But
the White standard errors reported by SHAZAM have
numeric differences compared to our textbook
results. There is a correction we could apply,
but we will not worry about it for now
Slide 8-11
Principles of Econometrics, 3rd Edition
128.3 The Generalized Least Squares Estimator
(8.10)
138.3.1 Transforming the Model
(8.11)
(8.12)
(8.13)
148.3.1 Transforming the Model
(8.14)
(8.15)
158.3.1 Transforming the Model
- To obtain the best linear unbiased estimator for
a model with heteroskedasticity of the type
specified in equation (8.11) - Calculate the transformed variables given in
(8.13). - Use least squares to estimate the transformed
model given in (8.14).
168.3.1 Transforming the Model
- The generalized least squares estimator is as a
weighted least squares estimator. Minimizing the
sum of squared transformed errors that is given
by - When is small, the data contain more
information about the regression function and the
observations are weighted heavily. When is
large, the data contain less information and the
observations are weighted lightly.
178.3.1 Transforming the Model
Food example again, where was the problem coming
from? regress food_exp income aweight
1/income
(8.16)
188.3.1 Transforming the Model
Food example again, where was the problem coming
from? Specify a weight variable (SHAZAM works
with the inverse) GENR W1/INCOME OLS FOOD
INCOME / WEIGHTW 95 confidence interval, p.
205 CONFID INCOME / TCRIT2.024
(8.16)
Slide 8-18
Principles of Econometrics, 3rd Edition
19Note that
- The residual statistics reported in a WLS
regression (SIGMA2, STANDARD ERROR OF THE
ESTIMATE-SIGMA, and SUM OF SQUARED ERRORS-SSE)
are all based on the transformed (weighted)
residuals - You should remember when making model
comparisons, that the high-variance observations
are systematically underweighted by this
procedure - This may be a good thing, if you want to avoid
having these observations dominate the model
selection comparisons. - But if you want model selection to be based on
how well the alternative models fit the original
(untransformed) data, you must base the model
selection tests on the untransformed residuals.
208.3.2 Estimating the Variance Function
(8.17)
(8.18)
218.3.2 Estimating the Variance Function
(8.19)
(8.20)
228.3.2 Estimating the Variance Function
(8.21)
238.3.2 Estimating the Variance Function
(8.22)
(8.23)
(8.24)
248.3.2 Estimating the Variance Function
(8.25)
(8.26)
258.3.2 Estimating the Variance Function
- The steps for obtaining a feasible generalized
least squares estimator for
are - 1. Estimate (8.25) by least squares and compute
the squares of the least squares residuals . - 2. Estimate by applying least
squares to the equation
268.3.2 Estimating the Variance Function
- 3. Compute variance estimates
. - 4. Compute the transformed observations defined
by (8.23), including if
. - 5. Apply least squares to (8.24), or to an
extended version of (8.24) if .
(8.27)
278.3.2 Estimating the Variance Function
For our food expenditure example gen z
log(income) regress food_exp income predict ehat,
residual gen lnehat2 log(ehatehat) regress
lnehat2 z -------------------------------------
------- Feasible GLS -------------------------
------------------- predict sig2, xb gen wt
exp(sig2) regress food_exp income aweight 1/wt
Slide 8-27
Principles of Econometrics, 3rd Edition
288.3.2 Estimating the Variance Function
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 (so the results
will also be different) HET FOOD INCOME
(INCOME) / MODELMULT
Slide 8-28
Principles of Econometrics, 3rd Edition
298.3.3 A Heteroskedastic Partition
Using our wage data (cps2.dta)
(8.28)
(8.29a)
(8.29b)
???
308.3.3 A Heteroskedastic Partition
(8.30)
318.3.3 A Heteroskedastic Partition
(8.31a)
(8.31b)
328.3.3 A Heteroskedastic Partition
- Feasible generalized least squares
- 1. Obtain estimated and by applying
least squares separately to the metropolitan and
rural observations. - 2.
-
- 3. Apply least squares to the transformed model
-
(8.32)
338.3.3 A Heteroskedastic Partition
(8.33)
348.3.3 A Heteroskedastic Partition
--------------------------------------------
Rural subsample regression ---------------------
----------------------- regress wage educ exper
if metro 0 scalar rmse_r e(rmse) scalar
df_r e(df_r) ---------------------------------
----------- Urban subsample regression
-------------------------------------------- regre
ss wage educ exper if metro 1 scalar rmse_m
e(rmse) scalar df_m e(df_r)
--------------------------------------------
Groupwise heteroskedastic regression using FGLS
-------------------------------------------- gen
rural 1 - metro gen wt(rmse_r2rural)
(rmse_m2metro) regress wage educ exper metro
aweight 1/wt
STATA Commands
Slide 8-34
Principles of Econometrics, 3rd Edition
358.3.3 A Heteroskedastic Partition
Remark To implement the generalized least squares estimators described in this Section for three alternative heteroskedastic specifications, an assumption about the form of the heteroskedasticity is required. Using least squares with White standard errors avoids the need to make an assumption about the form of heteroskedasticity, but does not realize the potential efficiency gains from generalized least squares.
368.4 Detecting Heteroskedasticity
- 8.4.1 Residual Plots
- Estimate the model using least squares and plot
the least squares residuals. - With more than one explanatory variable, plot
the least squares residuals against each
explanatory variable, or against , to see if
those residuals vary in a systematic way relative
to the specified variable.
378.4 Detecting Heteroskedasticity
- 8.4.2 The Goldfeld-Quandt Test
-
(8.34)
(8.35)
388.4 Detecting Heteroskedasticity
- 8.4.2 The Goldfeld-Quandt Test
-
--------------------------------------------
Goldfeld Quandt test ---------------------------
----------------- scalar GQ rmse_m2/rmse_r2 s
calar crit invFtail(df_m,df_r,.05) scalar
pvalue Ftail(df_m,df_r,GQ) scalar list GQ
pvalue crit
Principles of Econometrics, 3rd Edition
Slide 8-38
398.4 Detecting Heteroskedasticity
- 8.4.2 The Goldfeld-Quandt Test
-
For the food expenditure data You should now be
able to obtain this test statistic And check
whether it exceeds the critical value
408.4 Detecting Heteroskedasticity
- 8.4.2 The Goldfeld-Quandt Test
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 / CHOWONE20 HET
Principles of Econometrics, 3rd Edition
Slide 8-40
418.4 Detecting Heteroskedasticity
- 8.4.2 The Goldfeld-Quandt Test
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 / CHOWONE20 HET Of course, this
option also computes the Chow test statistic for
structural change (that is, tests the null of
parameter stability in the two subsamples).
Principles of Econometrics, 3rd Edition
Slide 8-41
428.4 Detecting Heteroskedasticity
- 8.4.2 The Goldfeld-Quandt Test
SEQUENTIALÂ CHOWÂ ANDÂ GOLDFELD-QUANDTÂ TESTS Â Â Â Â N1Â Â
 N2    SSE1        SSE2       CHOW    PVALUE    G-
QÂ Â Â Â Â Â Â DF1Â Â DF2Â PVALUE Â Â Â Â 20Â Â Â 20Â 0.23259E06Â Â 6
4346.     0.45855     0.636  3.615       18   18 0
.005 Â Â Â Â Â Â Â Â Â Â Â Â Â CHOWÂ TESTÂ -Â FÂ DISTRIBUTIONÂ WITHÂ
DF1Â Â Â 2Â ANDÂ DF2Â Â 36
Principles of Econometrics, 3rd Edition
Slide 8-42
438.4 Detecting Heteroskedasticity
- 8.4.2 The Goldfeld-Quandt Test
SHAZAM considers that the alternative hypothesis
is smaller error variance in the second subset
relative to the first subset. Some authors
present the alternative as larger variance in the
second subset. Goldfeld and Quandt recommend
ordering the observations by the values of one of
the explanatory variables. This can be done
with the SORT command in SHAZAM. The DESC option
on the SORT command should be used if it is
assumed that the variance is positively related
to the value of the sort variable.
Principles of Econometrics, 3rd Edition
Slide 8-43
448.4 Detecting Heteroskedasticity
- 8.4.3 Testing the Variance Function
-
(8.36)
(8.37)
458.4 Detecting Heteroskedasticity
- 8.4.3 Testing the Variance Function
-
(8.38)
(8.39)
468.4 Detecting Heteroskedasticity
- 8.4.3 Testing the Variance Function
-
(8.40)
(8.41)
(8.42)
(8.43)
478.4 Detecting Heteroskedasticity
488.4 Detecting Heteroskedasticity
- 8.4.3b Testing the Food Expenditure Example
-
whitetst Or estat imtest, white
49Further testing in SHAZAM
- DIAGNOS / HET
- Will yield a battery of heteroskedasticity tests
using different specifications
50SHAZAM for food example
- DIAGNOS\HET
- Â REQUIREDÂ MEMORYÂ ISÂ PARÂ Â Â Â Â Â Â 7Â CURRENTÂ PARÂ Â Â 22
480 - Â DEPENDENTÂ VARIABLEÂ Â FOODÂ Â Â Â Â Â Â Â Â Â Â Â 40Â OBSERVATI
ONS - Â REGRESSIONÂ COEFFICIENTS
- Â Â Â Â 10.2096426868Â Â Â Â Â Â Â 83.4160065402
- Â HETEROSKEDASTICITYÂ TESTS
-                              CHI-SQUARE     D.F. Â
 P-VALUE -                            TEST STATISTIC
- Â E2Â ONÂ YHATÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 7.384Â Â Â Â Â 1Â Â Â
 0.00658 -  E2 ON YHAT2                   7.549     1  Â
 0.00600 -  E2 ON LOG(YHAT2)              6.516     1  Â
 0.01069 -  E2 ON LAG(E2) ARCH TEST       0.089     1  Â
 0.76544 -  LOG(E2) ON X (HARVEY) TEST     10.654     1  Â
 0.00110 -  ABS(E) ON X (GLEJSER) TEST       11.466     1  Â
 0.00071 -  E2 ON X                 TEST
- Â Â Â Â Â Â Â Â Â Â Â KOENKER(R2)Â Â Â Â Â Â Â Â Â Â Â Â Â 7.384Â Â Â Â Â 1Â Â Â
 0.00658 -            B-P-G (SSR)             7.344     1  Â
 0.00673 -  E2 ON X X2    (WHITE) TEST
- Â Â Â Â Â Â Â Â Â Â Â KOENKER(R2)Â Â Â Â Â Â Â Â Â Â Â Â Â 7.555Â Â Â Â Â 2Â Â Â
 0.02288
Same in SLR
51Keywords
- Breusch-Pagan test
- generalized least squares
- Goldfeld-Quandt test
- heteroskedastic partition
- heteroskedasticity
- heteroskedasticity-consistent standard errors
- homoskedasticity
- Lagrange multiplier test
- mean function
- residual plot
- transformed model
- variance function
- weighted least squares
- White test
52Chapter 8 Appendices
- Appendix 8A Properties of the Least Squares
Estimator - Appendix 8B Variance Function Tests for
Heteroskedasticity
53Appendix 8A Properties of the Least Squares
Estimator
(8A.1)
54Appendix 8A Properties of the Least Squares
Estimator
55Appendix 8A Properties of the Least Squares
Estimator
(8A.2)
56Appendix 8A Properties of the Least Squares
Estimator
(8A.3)
57Appendix 8B Variance Function Tests for
Heteroskedasticity
(8B.1)
(8B.2)
58Appendix 8B Variance Function Tests for
Heteroskedasticity
(8B.3)
(8B.4)
(8B.5)
59Appendix 8B Variance Function Tests for
Heteroskedasticity
(8B.6)
(8B.7)
60Appendix 8B Variance Function Tests for
Heteroskedasticity
(8B.8)