Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

Econometrics I

Nicolás Corona Juárez, Ph.D.


4.11.2020
Heteroscedasticity

Usually we assume 𝐸 𝑢𝑖2 = 𝜎 2 𝑖 = 1,2, … . , 𝑛

This is the homoscedasticity assumption (constant variance of the error term).

Variance of 𝑢𝑖 is supposed
to be constant.

2
Heteroscedasticity

What happens if the variance of the error term is not constant?

𝑌𝑖 = 𝛽1 + 𝛽2 𝑋2 + 𝛽3 𝑋3 + 𝑢𝑖

This is called heteroscedasticity.


Important questions:
Why is there heteroscedasticity?

• Heteroscedasticity: Consequences?
• Heteroscedasticity: How to detect it?
• Heteroscedasticity: How to fix this?

3
Heteroscedasticity

𝑢𝑖 has no constant Density


variance

𝑌 Savings
The variance of 𝑢𝑖 , that is
𝜎𝑖2 , increases with the
income level.
𝛽1 + 𝛽2 𝑋𝑖

𝑋
More savings and more
Income
possibilities to make use
of those savings
4
Number of employees
The problem of heteroscedasticity
is more common in cross sectional
data than in time series data.

1. On average, big firms pay more


than small firms.

2. There is wide variation in


income among the different
types of employees (see the
standard deviation).
5
OLS estimation under heteroscedasticity

• Consider the previous dataset.

• Research question: Is the wage per worker (employee) explained by the number of employees?

𝑌𝑖 = 𝛽1 + 𝛽2 𝑋𝑖 + 𝑢𝑖

Wage per Number of


worker employees
(employee)

6
OLS estimation under heteroscedasticity

1. We know that there is a


𝑌𝑖 = 𝛽1 + 𝛽2 𝑋𝑖 + 𝑢𝑖 3. The observations
wide variation in wages
stemming from populations
across the different types of
with higher variation: get
employees.
less weight.

Wage per Number of


The observations stemming
worker employees
2. This information is from populations with less
(employee)
important and we need to variation: get higher weight.
keep this in mind.

7
OLS estimation under heteroscedasticity

What happens with the OLS estimators and their variances if there is
heteroscedasticity but all other OLS assumptions hold?

Homoscedastic variance Heteroscedastic variance

𝜎2 σ 𝑥𝑖2 𝜎𝑖2
𝑉𝑎𝑟 𝛽መ2 = 𝑉𝑎𝑟 𝛽መ2 = 2
σ 𝑥𝑖2 σ 𝑥𝑖2

8
OLS estimation under heteroscedasticity

With heteroscedasticity:

• 𝛽መ2 is still lineal and unbiased.


• 𝛽መ2 is still consistent.

• 𝛽መ2 has no minimum variance (it is not efficient).

If this is the case, then which estimator should we use?

9
Generalized Least Squares (GLS)

𝑌𝑖 = 𝛽1 𝑋0𝑖 + 𝛽2 𝑋𝑖 + 𝑢𝑖 Equation 1
Where 𝑋0𝑖 = 1 for each 𝑖

Suppose we know the heteroscedastic variances 𝜎𝑖2 .

𝑌𝑖 𝑋0𝑖 𝑋𝑖 𝑢𝑖
= 𝛽1 + 𝛽2 + Equation 2
𝜎𝑖 𝜎𝑖 𝜎𝑖 𝜎𝑖

𝑌𝑖∗ = 𝛽1∗ 𝑋0𝑖



+ 𝛽2∗ 𝑋𝑖∗ + 𝑢𝑖∗ Equation 3

10
Generalized Least Squares (GLS)

Why do we transform the model?

Let us see what happens with the transformed error:


2
𝑢𝑖
𝑣𝑎𝑟 𝑢𝑖∗ = 𝐸 𝑢𝑖∗ 2
=𝐸
𝜎𝑖

1
𝑣𝑎𝑟 𝑢𝑖∗ =𝐸 𝑢𝑖∗ 2 = 2 𝐸 𝑢𝑖2 Because 𝜎𝑖2 is known.
𝜎𝑖

1
𝑣𝑎𝑟 𝑢𝑖∗ = 𝐸 𝑢𝑖∗ 2 = 𝜎𝑖
2
𝜎𝑖2
The variance of the transformed
error is a constant. 𝑣𝑎𝑟 𝑢𝑖∗ = 𝐸 𝑢𝑖∗ 2 =𝟏 A constant

11
Generalized Least Squares (GLS)

• If we apply OLS to the transformed model 𝑌𝑖∗ = 𝛽1∗ 𝑋0𝑖



+ 𝛽2∗ 𝑋𝑖∗ + 𝑢𝑖∗ , we get BLUE
estimators.

• Now 𝛽መ1∗ and 𝛽መ2∗ are BLUE.

• 𝛽መ1∗ and 𝛽መ2∗ are the Generalized Least Squares (GLS) estimators.

• Note that 𝛽መ1 and 𝛽መ2 are not BLUE (they are not efficient; i.e. do not have
minimum variance).

12
Generalized Least Squares (GLS): How do we estimate 𝜷∗𝒌 ?

We have the Sample Regression Function:

𝑌𝑖∗ = 𝛽መ1∗ 𝑋0𝑖



+ 𝛽መ2∗ 𝑋𝑖∗ + 𝑢ො 𝑖∗
In order to obtain the GLS estimators, we need to minimize:

2
σ 𝑢ො 𝑖2∗ =σ 𝑌𝑖∗ − 𝛽መ1∗ 𝑋0𝑖

− 𝛽መ2∗ 𝑋𝑖∗

2 2
𝑢ො 𝑖 𝑌𝑖 𝑋0𝑖 𝑋𝑖
This is the same: ෍ =෍ መ
− 𝛽1 ∗ መ
− 𝛽2∗
𝜎𝑖 𝜎𝑖 𝜎𝑖 𝜎𝑖

13
Generalized Least Squares (GLS): How do we estimate 𝜷∗𝒌 ?

This means that GLS reduces the weighted sum of squares of the residuals:

2
σ 𝑤𝑖 𝑢ො 𝑖2 = σ 𝑤𝑖 𝑌𝑖 − 𝛽መ1∗ − 𝛽መ2∗ 𝑋𝑖∗

1
The weights are: 𝑤𝑖 =
𝜎𝑖2

14
Generalized Least Squares (GLS): How do we estimate 𝜷∗𝒌 ?

Get the partical derivatives with respect to 𝛽መ1∗ and 𝛽መ2∗ :

ෝ𝑖2
𝜕 σ 𝑤𝑖 𝑢
= 2 σ 𝑤𝑖 𝑌𝑖 − 𝛽መ1∗ − 𝛽መ2∗ 𝑋𝑖 −1
𝜕𝛽1∗

𝜕 σ 𝑤𝑖 𝑢ො 𝑖2
= 2 ෍ 𝑤 𝑌
𝑖 𝑖 − መ
𝛽1

− መ
𝛽 ∗
2 𝑋𝑖 −𝑋𝑖

𝜕𝛽2

15
Generalized Least Squares (GLS): How do we estimate 𝜷∗𝒌 ?

Set both expressions equal to zero:

2 σ 𝑤𝑖 𝑌𝑖 − 𝛽መ1∗ − 𝛽መ2∗ 𝑋𝑖 −1 = 0

2 ෍ 𝑤𝑖 𝑌𝑖 − 𝛽መ1∗ − 𝛽መ2∗ 𝑋𝑖 −𝑋𝑖 = 0

16
Generalized Least Squares (GLS): How do we estimate 𝜷∗𝒌 ?

Then, get the normal equations:

σ 𝑤𝑖 𝑌𝑖 = 𝛽መ1∗ σ 𝑤𝑖 + 𝛽መ2∗ σ 𝑤𝑖 𝑋𝑖

෍ 𝑤𝑖 𝑋𝑖 𝑌𝑖 = 𝛽መ1∗ ෍ 𝑤𝑖 𝑋𝑖 + 𝛽መ2∗ ෍ 𝑤𝑖 𝑋𝑖2

Solve for 𝛽መ1∗ and 𝛽መ2∗

17
Generalized Least Squares (GLS): How do we estimate 𝜷∗𝒌 ?

𝛽መ1∗ = 𝑌ത ∗ − 𝛽መ2∗ 𝑋ത ∗

σ 𝑤𝑖 σ 𝑤𝑖 𝑋𝑖 𝑌𝑖 − σ 𝑤𝑖 𝑋𝑖 σ 𝑤𝑖 𝑌𝑖
𝛽መ2∗ =
σ 𝑤𝑖 σ 𝑤𝑖 𝑋𝑖2 − σ 𝑤𝑖 𝑋𝑖 2

18
Generalized Least Squares (GLS): How do we estimate 𝜷∗𝒌 ?

The variance is given by:

σ 𝑤𝑖
𝑣𝑎𝑟(𝛽መ2∗ ) =
σ 𝑤𝑖 σ 𝑤𝑖 𝑋𝑖2 − σ 𝑤𝑖 𝑋𝑖 2

1
Where 𝑤𝑖 =
𝜎𝑖2

19
OLS and GLS: Difference
Here we minimize the sum of
squared residuals (observations
In OLS we reduce: are given the same weight).
2
σ 𝑢ො 𝑖2 = σ 𝑌𝑖 − 𝛽መ1 − 𝛽መ2 𝑋𝑖

Here we minimize the sum of


In GLS we reduce: squared residuals (observations
2 are given a different weight).
σ 𝑤𝑖 𝑢ො 𝑖2 = σ 𝑤𝑖 𝑌𝑖∗ − 𝛽መ1∗ 𝑋0𝑖 − 𝛽መ2∗ 𝑋𝑖

a) Observations from a b) Observations from a population with a


population with a larger 𝝈𝒊 will be smaller𝝈𝒊 will be given a higher weight.
given a lower weight.

20
OLS and GLS: Difference
In GLS the observation C will be
given a lower weight than A and B
In OLS each 𝑢ො 𝑖2 belonging to the when minimizing the SSR.
points A, B and C will be given
the same weight when
minimizing the SSR.

21
OLS and GLS: Difference

Given that in GLS we minimize:


2
σ 𝑤𝑖 𝑢ො 𝑖2 = σ 𝑤𝑖 𝑌𝑖∗ − 𝛽መ1∗ 𝑋0𝑖 − 𝛽መ2∗ 𝑋𝑖

.. note that this is a weighted RSS; thus, this procedure is also known as Weighted
Least Squares.

22
OLS and Heteroscedasticity: What happens if we estimate the model?

Situation 1: OLS with heteroscedasticity vs GLS estimate

a. We have 𝑣𝑎𝑟 𝛽መ𝑘∗ ≤ 𝑣𝑎𝑟 𝛽መ𝑘 .

b. Confidence intervals under the OLS estimate 𝛽መ𝑘 will be larger.

c. Wrong conclusion about 𝑡 and 𝐹: a coefficient is statistically not significant (but


in reality the opposite could be true).

23
OLS and Heteroscedasticity: What happens if we estimate the model?

Situation 2: Run OLS and do not care about heteroscedasticity

• Overestimation or underestimation of the variance of 𝛽መ2 .

24
OLS and Heteroscedasticity: What happens if we estimate the model?

Situation 2: Run OLS and do not care about heteroscedasticity

• Overestimation or underestimation of the variance of 𝛽መ2 depends on the nature


of the relationship between 𝜎𝑖2 and the data of the control 𝑋2 .

• Wrong conclusion about 𝑡 and 𝐹: a coefficient is statistically not significant (but in


reality the opposite could be true).

25
How to detect the presence of Heteroscedasticity?

• It is not easy given that we do not observe 𝑢𝑖 .

• We can get an estimate of 𝑢𝑖 , that is 𝑢ො 𝑖 and use it to estimate 𝜎ො𝑖2 .

• There are formal and informal methods to detect heteroscedasticity.

26
How to detect Heroscedasticity: Informal methods

• The heteroscedasticity can be present in cross sectional data.

• Cross sectional data contain heterogeneous units.

• Plot the estimated residuals vs the fitted values or the estimated residuals vs
some of the control variables in the model.

27

ෝ 𝟐 vs. 𝒀
Plot 𝒖

In (a) there is no
systematic pattern.

In graphs (b) to (e) there are


clear defined patterns.

28
ෝ 𝟐 vs. 𝑿
Plot 𝒖

In (a) there is no
systematic pattern.

In graphs (b) to (e) there are


clear defined patterns.

29
How to detect Heteroscedasticity: Formal methods

Park test
Consider the model:

𝑌𝑖 = 𝛽1 + 𝛽2 𝑋𝑖 + 𝑢𝑖

Average wage in Average productivity in


thousands of dollars. thousands of dollars.

30
How to detect Heteroscedasticity: Formal methods

Park (1966) suggests that 𝜎𝑖2 is some type of function of the control variable 𝑋𝑖 :

𝛽
𝜎𝑖2 = 𝜎 2 𝑋𝑖 𝑒 𝑣𝑖
or
𝑙𝑛𝜎𝑖2 = 𝑙𝑛𝜎 2 + 𝛽𝑙𝑛𝑋𝑖 + 𝑣𝑖

Given that we do not know about 𝜎𝑖2 , we use 𝑢ො 𝑖2 :

𝑙𝑛𝑢ො 𝑖2 = 𝑙𝑛𝜎 2 + 𝛽𝑙𝑛𝑋𝑖 + 𝑣𝑖

𝑙𝑛𝑢ො 𝑖2 = 𝛼 + 𝛽𝑙𝑛𝑋𝑖 + 𝑣𝑖
31
How to detect Heteroscedasticity: Formal methods

The Park test is a two step test.

Step 1: Run OLS and ignore whether there is heteroscedasticity or not.

𝑌𝑖 = 𝛽1 + 𝛽2 𝑋𝑖 + 𝑢𝑖

Obtain the residuals 𝑢ො 𝑖 from this regression.

32
How to detect Heteroscedasticity: Formal methods

Step 2: Use 𝑢ො 𝑖 as follows:

𝑙𝑛𝑢ො 𝑖2 = 𝛽1 + 𝛽2 𝑋𝑖 + 𝑣𝑖
We want to test 𝐻0 : 𝛽መ2 = 0

If there is no evidence to reject 𝐻0 : 𝛽መ2 = 0 , conclude: There is no


heteroscedasticity.

33
Breusch-Pagan-Godfrey Test

Consider the model:

𝑌𝑖 = 𝛽1 + 𝛽2 𝑋2𝑖 + ⋯ + 𝛽𝑘 𝑋𝑘𝑖 + 𝑢𝑖

Suppose the variance of the error is:


𝜎𝑖2 = 𝑓 𝛼1 + 𝛼2 𝑍2𝑖 + ⋯ + 𝛼𝑚 𝑍𝑚𝑖

𝜎𝑖2 is a type of function of the Some of the 𝑋 or all could serve


variables 𝑍 which are non as 𝑍.
stochastic.

34
Breusch-Pagan-Godfrey Test

Put it differently, 𝜎𝑖2 is a linear function of the variables 𝑍.

𝜎𝑖2 = 𝛼1 + 𝛼2 𝑍2𝑖 + ⋯ + 𝛼𝑚 𝑍𝑚𝑖

If 𝛼2 = 𝛼3 = ⋯ = 𝛼𝑚 = 0, then 𝜎𝑖2 = 𝛼1 and this is a constant.

It follows that, in order to test if 𝜎𝑖2 is homoscedastic we can test:

𝐻0 : 𝛼2 = 𝛼3 = ⋯ = 𝛼𝑚 = 0

This is the basic idea of the Breusch-Pagan-Godfrey test.

35
Breusch-Pagan-Godfrey Test: Steps

Step 1. Estimate 𝑌𝑖 = 𝛽1 + 𝛽2 𝑋2𝑖 + ⋯ + 𝛽𝑘 𝑋𝑘𝑖 + 𝑢𝑖 with OLS and obtain the


residuals 𝑢ො1 , 𝑢ො 2 , … , 𝑢ො 𝑛

ෝ𝑖2
σ𝑢
Step 2. Obtain 𝜎෤ 2 =
𝑛

ෝ𝑖2
𝑢
Step 3. Build up the variables 𝑝𝑖 defined as: 𝑝𝑖 = ෥2
𝜎

Step 4. Estimate 𝑝𝑖 = 𝛼1 + 𝛼2 𝑍2𝑖 + ⋯ + 𝛼𝑚 𝑍𝑚𝑖 + 𝑣𝑖

36
Breusch-Pagan-Godfrey Test: Steps

Step 5. Obtain the ESS from previous regression and define :

1
Φ = (𝑆𝐸𝐶)
2
We have that:
2
Φasym
~ 𝜒𝑚−1

(“asym” means asymptotically)


Degrees of
freedom

37
Breusch-Pagan-Godfrey Test: Steps

Step 5. If Φ𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒𝑑 > Φ𝑐𝑟𝑖𝑡𝑖𝑐𝑎𝑙 at the chosen significance level, then reject:

𝐻0 : 𝛼2 = 𝛼3 = ⋯ = 𝛼𝑚 = 0

…it follows then, that there is no heteroscedasticity.

38
White Test

Consider the model:

𝑌𝑖 = 𝛽1 + 𝛽2 𝑋2𝑖 + 𝛽3 𝑋3𝑖 + 𝑢𝑖

Step 1. Estimate the model with OLS and obtain the residuals 𝑢ො 𝑖
Step 2. Estimate the auxiliary regression:

𝑢ො 𝑖2 = 𝛼1 + 𝛼2 𝑋2𝑖 + 𝛼3 𝑋3𝑖 + 𝛼4 𝑋2𝑖


2 2
+ 𝛼5 𝑋3𝑖 +𝛼6 𝑋2𝑖 𝑋3𝑖 + 𝑣𝑖

Obtain the 𝑅2 from this regression.

39
White Test

Step 3. Null hypothesis is “there is no heteroscedasticity”

𝐻0 : 𝛼2 = 𝛼3 = ⋯ = 𝛼6 = 0
If this is fulfilled then:
𝑢ො 𝑖2 = 𝛼1

The squared residuals are explained by a constant (homoscedastic variance).

How do we test this?

40
White Test

Step 3. Calculate:
2
𝑛𝑅2 asym
~ 𝜒𝑔𝑙
In this example we have that 𝑔𝑙 = 5 given that we have 5 control variables in the
auxiliary regression.

41
White Test

2 2
Step 4. If 𝜒𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒𝑑 > 𝜒𝑐𝑟𝑖𝑡𝑖𝑐𝑎𝑙 at the chosen significance level, then reject:

𝐻0 : 𝛼2 = 𝛼3 = ⋯ = 𝛼𝑚 = 0

…there is evidence of heteroscedasticity.

42
Heteroscedasticity: Corrective measures

There are two approaches to correct for Heteroscedasticity:

1. If we know 𝜎𝑖2 : Weighted Least Squares (WLS) (i.e. GLS).

2. If we do not know 𝜎𝑖2 : Variances and standard errors with White


heteroscedasticity.

43
Heteroscedasticity: Corrective measures

Variances and standard errors with White heteroscedasticity.

• In applied work, the standard errors corrected by heteroscedasticity (White


method) are larger than OLS.

• This means that once the problem of heteroscedasticity has been corrected, the
significance of a variable can disappear.

44
Heteroscedasticity: Corrective measures

You can have a look at the appendix 11 A.4 for a general description of the method.
The standard errors corrected using the White method are called:

I. Robust standard errors


II. White standard errors

More details in:


A Heteroscedasticity-Consistent Covariance Matrix Estimator and a Direct Test for
Heteroscedasticity.
Halbert White. Econometrica, Vol. 48 No. 4 (1980)

45

You might also like