F8: Heteroscedastcty Feng L Department of Statstcs, Stockholm Unversty
What s so-called heteroscedastcty In a lnear regresson model, we assume the error term has a normal dstrbuton wth mean zero and varance of σ 2,.e. Var(u ) = σ 2 whch s called homoscedastcty. But when the error term does not have constant varance,.e. Var(u ) = σ 2 we call t heteroscedastcty. See the dfferences between the two pctures for the model Savng = α + βincome + u Feng L (Stockholm Unversty) Econometrcs 2 / 1
An OLS example Recall the model Y = α 1 + α 2 X + u. If the error term u s homoscedastc wth varance σ 2, we know we have BLUE estmators and ř x y ˆα 2 = ř x 2, Var(ˆα 2 ) = ř σ2 x 2. If the error term u s homoscedastc wth varance σ 2, we have ř x 2 σ 2 ˆα 2 = why? see Appendx 11A.1. ř x y ř x 2, Var(ˆα 2 ) = ř x 2. ( ř σ2 x 2 )2 ˆα2 s stll lnear and unbased, why? But t s not best anymore,.e. wll not grant the mnmum varance. Feng L (Stockholm Unversty) Econometrcs 3 / 1
Use GLS to take heteroscedastcty nto account (1) The OLS method treats every observaton equally and does not take heteroscedastcty nto account. The generalzed least squares (GLS) wll. Consder the heteroscedastcty model Y = β 1 + β 2 X 1 + u, where Var(u ) = σ 2? If we transform the model by dvdng 1/ w where w = 1/σ 2 at both sdes (assume σ s known), whch can be rewrtten as Y 1 X = β 1 + β 2 + u σ σ σ σ Y = β 1X 0 + β 2X 1 + u, and u = u /σ s the new error term for the new model. Var(u /σ ) = 1 s now a constant. why? We call ˆβ 1 ˆβ 2 as GLS estmators Ŷ = ˆβ 1 X 0 + ˆβ 2 X 1, Feng L (Stockholm Unversty) Econometrcs 4 / 1
Use GLS to take heteroscedastcty nto account (2) To obtan GLS estmators, we mnmze ÿ ((û ) 2 ) = ÿ (Ŷ ˆβ 1 X 0 ˆβ 2 X 1 )2 whch s done by the usual way we have done n OLS. The GLS estmator of β 2 s ř ř w w X Y ř ř w X w Y ˆβ 2 = ř ř w w X 2 (ř w X ) 2 and the varance s ) ř w Var (ˆβ 2 = ř ř w w X 2 (ř w X ) 2 where w = 1/σ 2. When w = w = 1/σ 2, the GLS estmator wll reduce to the OLS estmator. Can you prove ths? ˆβ 1 = Ȳ ˆβ 2 X where Ȳ = ( ř w Y )/ ř (w ), X = ( ř w X )/ ř (w ). At ths partcular settng w = 1/σ 2, we call ths s weghted least squares (WLS) whch s a specal case of GLS. ˆβ 2 s unbased and Var(ˆβ 2 ) ă Var(ˆβ 2 ). Feng L (Stockholm Unversty) Econometrcs 5 / 1
Use GLS to take heteroscedastcty nto account (2)* It can be shown that and β 2 = ř w x y ř w ( x ) 2 Var (β 2 ) = 1 ř w ( x ) 2 where See Exercse 11.5. x = X X, y = Y Ȳ Feng L (Stockholm Unversty) Econometrcs 6 / 1
WLS example Example 11.7 (1) Assume we want to make WLS regresson wth the gve data. What can you do then? Opton 1: Apply the general GLS formula n p.5 to obtan the estmators. Opton 2: Use OLS to regress Y/σ wth 1/σ and X /σ wthout ntercept. Can you obtan the same results? Feng L (Stockholm Unversty) Econometrcs 7 / 1
WLS example Example 11.7 (2) Compare the WLS results wth OLS results. How do the standard errors and t statstcs change? Feng L (Stockholm Unversty) Econometrcs 8 / 1
Consequences of usng when heteroscedastc Suppose there are heteroscedastc but we nsst usng OLS. What wll go wrong? whatever conclusons we draw may be msleadng. We could not establsh confdence ntervals and test hypotheses wth usual t, F tests. The usual tests are lkely to gve larger varance than the true varance. The varance estmator of ˆβ by OLS s a based estmator of the true varance. The usual estmator of σ 2 whch was ř û 2 /(n 2) s based. Feng L (Stockholm Unversty) Econometrcs 9 / 1
Detecton of heteroscedastcty (1) ï Plot û 2 aganst Ŷ Feng L (Stockholm Unversty) Econometrcs 10 / 1
Detecton of heteroscedastcty (2) ï Plot û 2 aganst X Feng L (Stockholm Unversty) Econometrcs 11 / 1
Detecton of heteroscedastcty (3) ï QQ plot If the resdual s normally dstrbuted, plot sample quantle for the resdual aganst the theoretcal quantle from standard normal dstrbuton should on the 45 degree lne. 2 1 0 1 2 2 1 0 1 2 Normal Q Q Plot Theoretcal Quantles Sample Quantles Feng L (Stockholm Unversty) Econometrcs 12 / 1
Detecton of heteroscedastcty (4) ï Whte s general heteroscedastcty test H 0 : No heteroscedastcty. Consder Y = β 1 + β 2 X 2 + β 3 X 3 + u, (other models are the same) step 1: Do the OLS to obtan the resduals û. step 2: Run the followng model wth the covarates and ther crossproducts û 2 1 = α 1 + α 2 X 2 + α 3 X 3 + α 4 X 2 2 + α 5 X 2 3 + α 6 X 2 X 3 + v and obtan R 2. step 3: nr 2 χ 2 (k 1) where k s no. of unknown parameters n step 2. step 4: If χ 2 obs (k 1) ą χ2 crt (k 1), reject H 0. Queston: How do Whte s test wth Y = β 1 + β 2 X 2 + β 3 X 3 + β 4 X 4 + u? Feng L (Stockholm Unversty) Econometrcs 13 / 1
Example of Whte s test Consder the followng regresson model wth 41 observatons, lny = β 1 + β 2 lnx 2 + β 3 lnx 3 + u where Y = rato of trade taxes (mport and export taxes) to total government revenue, X 2 = rato of the sum of exports plus mports to GNP, and X 3 = GNP per capta. By applyng Whte s heteroscedastcty test. We frst obtan the resduals from regresson. Then we do the followng auxlary regresson û 2 = 5.8+2.5 ln X 2 +0.69 ln X 3 0.4(ln X 2 ) 2 0.04(ln X 3 ) 2 +0.002 ln X 2 ln X 3 and R 2 = 0.1148. Can you compute the whte s test statstc? What s your concluson of heteroscedastcty? Feng L (Stockholm Unversty) Econometrcs 14 / 1
Detecton of heteroscedastcty (5) ï Goldfeld-Quandt test It s popular to assume σ 2 s postvely related to one of the covarates e.g. σ 2 = σ2 X 2 2 n a three covarates model. The bgger X we have, the bgger σ 2 s. H 0 : Homoscedastcty step 1: Sort covarates wth the order of X 2 step 2: Delete the c central observatons and dved the remanng parts nto two groups. step 3: Ft the two groups separately wth OLS and obtan RSS 1 (for the small values group) and RSS 2 (for the large values group) wth both (n c)/2 k degrees of freedom. Why? step 4: Compute the rato λ = RSS 2/[(n c)/2 k] F(((n c)/2 k), ((n c)/2 k)) RSS 1 /[(n c)/2 k] Reject H 0 f λ ą F crt (((n c)/2 k), ((n c)/2 k)). Feng L (Stockholm Unversty) Econometrcs 15 / 1
Detecton of heteroscedastcty (6) ï Breusch-Pagan-Godfrey test Consder the model Y = β 1 + β 2 X 2 +... + +β k X k + u Assume that σ 2 = α 1 + α 2 Z 2 +... + α m Z m where Z are known varables whch can be X. If there no heteroscedastcty, then α 2 =... = α m = 0 and σ 2 = α 1. step 1: Obtan û 1,..., û n by the model. step 2: Obtan σ 2 = ř û 2 /n. step 3: Construct varable p = û 2 / σ2 step 4: Regress p = α 1 + α 2 Z 2 +... + α m Z m + v step 5: Obtan ESS/2 χ 2 (m 1) Evdence of heteroscedastcty when ESS/2 ą χ 2 crt (m 1). Feng L (Stockholm Unversty) Econometrcs 16 / 1
How to obtan estmators ï wth Y = β 1 + β 2 X + u when E(u ) = 0 and Var(u ) = σ 2 When σ s known: use WLS method to obtan BLUE estmators. pp. 4 5 When σ s not known: If V(u ) = σ 2 X 2, do OLS wth model Y 1 = β 2 + β 1 + u X X X and Var(u /X ) = σ 2. Why? If Var(u ) = σ 2 X (X ą 0), do OLS wth model Y? 1 = β 2 + β 1? + u? X X X and Var(u /? X ) = σ 2. Why? If Var(u ) = σ 2 [E(Y )] 2 (X ą 0), do OLS wth model Y 1 = β 2 + β 1 + u Ŷ Ŷ Ŷ and Var(u /Ŷ ) «Var(u )/[EŶ ] 2 = Var(u )/Y 2 = σ 2. Do OLS wth log transformed data lny = β 1 + β 2 lnx + v can also reduce heteroscedastcty. Feng L (Stockholm Unversty) Econometrcs 17 / 1