Download presentation
Presentation is loading. Please wait.
Published byLinda Hawkins Modified over 8 years ago
1
Heteroskedasticity Adapted from Vera Tabakova’s notes ECON 4551 Econometrics II Memorial University of Newfoundland
2
8.1 The Nature of Heteroskedasticity 8.2 Using the Least Squares Estimator 8.3 The Generalized Least Squares Estimator 8.4 Detecting Heteroskedasticity
4
Figure 8.1 Heteroskedastic Errors
5
Food expenditure example:
6
Figure 8.2 Least Squares Estimated Expenditure Function and Observed Data Points
7
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.
10
We can use a robust estimator: GRETL offers several options…check the defaults
11
The existence of heteroskedasticity implies: Why not use robust estimation all the time? Well, that is a good idea for large samples but for small samples, homoskedasticity plus normality guarantees that the t ratios are distributed as t But robust estimates do not guarantee that, so our inference could be misleading! If you have a small sample, check whether there is homoskedasticity or not!
15
To obtain the best linear unbiased estimator for a model with heteroskedasticity of the type specified in equation (8.11): 1. Calculate the transformed variables given in (8.13). 2. Use least squares to estimate the transformed model given in (8.14).
16
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.
17
Food example again, where was the problem coming from? regress food_exp income [aweight = 1/income]
23
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
24
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.
25
For our food expenditure example (GRETL: #Estimating the skedasticity function and GLS ols y const x genr lnsighat = log($uhat*$uhat) genr z = log(x) #Obtain prediction of variance: ols lnsighat const z genr predsighat = exp($yhat) #generate weights; genr w = 1/predsighat wls w y const x
26
For our food expenditure example (STATA): gen z = log(income) regress food_exp income predict ehat, residual gen lnehat2 = log(ehat*ehat) regress lnehat2 z * -------------------------------------------- * Feasible GLS * -------------------------------------------- predict sig2, xb gen wt = exp(sig2) regress food_exp income [aweight = 1/wt]
27
Using our wage data (cps2.dta): ???
30
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
32
* -------------------------------------------- * Rural subsample regression * -------------------------------------------- regress wage educ exper if metro == 0 scalar rmse_r = e(rmse) scalar df_r = e(df_r) * -------------------------------------------- * Urban subsample regression * -------------------------------------------- regress 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_r^2*rural) + (rmse_m^2*metro) regress wage educ exper metro [aweight = 1/wt] STATA Commands:
33
#Wage Example open "c:\Program Files\gretl\data\poe\cps2.gdt" ols wage const educ exper metro # Use only metro observations smpl metro --dummy ols wage const educ exper scalar stdm = $sigma #Restore the full sample smpl full GRETL Commands:
34
#Create a dummy variable for rural genr rural = 1-metro #Restrict sample to rural observations smpl rural --dummy ols wage const educ exper scalar stdr = $sigma #Restore the full sample smpl full GRETL Commands:
35
#Generate standard deviations for each metro and rural obs genr wm = metro*stdm genr wr = rural*stdr #Make the weights (reciprocal) #Remember, Gretl's wls needs these to be variances so you'll need to square them genr w = 1/(wm + wr)^2 #Weighted least squares wls w wage const educ exper metro Principles of Econometrics, 3rd Edition
36
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.
37
8.4.1Residual 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.
38
8.4.2The Goldfeld-Quandt Test
39
STATA: * -------------------------------------------- * Goldfeld Quandt test * -------------------------------------------- scalar GQ = rmse_m^2/rmse_r^2 scalar crit = invFtail(df_m,df_r,.05) scalar pvalue = Ftail(df_m,df_r,GQ) scalar list GQ pvalue crit GRETL: #Goldfeld Quandt statistic scalar fstatistic = stdm^2/stdr^2
40
8.4.2The Goldfeld-Quandt Test More generally, the test can be based Simply on a continuous variable Split the sample in halves (usually omitting some from the middle) after ordering them according to the suspected variable (income in our food example)
41
8.4.2The 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 Remember that you can probably use the one-tail version of this test Why?
42
8.4.3Testing the Variance Function For the mean: For the variance, in general: For example::
43
8.4.3Testing the Variance Function
44
S is the number of variables used
45
This is a large sample test It is a Lagrange Multiplier (LM) test, which are based on an auxiliary regression In this case named after Breusch and Pagan Here (and in the textbook) we saw a test statistic based on a linear function of the squared residual, but the good thing about this test is that this form can be used to test for any form of heteroskedasticity Principles of Econometrics, 3rd Edition
46
8.4.3a The White Test Since we may not know which variables explain heteroskedasticity…
47
8.4.3b Testing the Food Expenditure Example whitetst Or estat imtest, white Breusch-Pagan test White test STATA: GRETL: ols y const x modtest --breusch-pagan modtest –white
48
Slide 8-48 Principles of Econometrics, 3rd Edition 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
49
Slide 8-49 Principles of Econometrics, 3rd Edition
50
Slide 8-50 Principles of Econometrics, 3rd Edition (8A.1)
51
Slide 8-51 Principles of Econometrics, 3rd Edition
52
Slide 8-52 Principles of Econometrics, 3rd Edition (8A.2)
53
Slide 8-53 Principles of Econometrics, 3rd Edition (8A.3)
54
Slide 8-54 Principles of Econometrics, 3rd Edition (8B.2) (8B.1)
55
Slide 8-55 Principles of Econometrics, 3rd Edition (8B.4) (8B.3) (8B.5)
56
Slide 8-56 Principles of Econometrics, 3rd Edition (8B.6) (8B.7)
57
Slide 8-57 Principles of Econometrics, 3rd Edition (8B.8)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.