Financial econometrics
EC395 ����ʱ��21��24��/�μ�/Difference_in_Difference_L10 (2).pptx
Chapter 13
Pooling Cross Sections across Time: Simple Panel Data Methods
Wooldridge: Introductory Econometrics: A Modern Approach, 5e
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
1
Policy analysis with pooled cross sections
Two or more independently sampled cross sections can be used to evaluate the impact of a certain event or policy change
Example: Effect of new garbage incinerator on housing prices
Examine the effect of the location of a house on its price before and after the garbage incinerator was built:
After incinerator was built
Before incinerator was built
Pooled Cross Sections and Simple Panel Data Methods
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
2
Example: Garbage incinerator and housing prices (cont.)
It would be wrong to conclude from the regression after the incinerator is there that being near the incinerator depresses prices so strongly
One has to compare with the situation before the incinerator was built:
In the given case, this is equivalent to
This is the so called difference-in-differences estimator (DiD)
Incinerator depresses prices but location was one with lower prices anyway
Pooled Cross Sections and Simple Panel Data Methods
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
3
Difference-in-differences in a regression framework
In this way standard errors for the DiD-effect can be obtained
If houses sold before and after the incinerator was built were sys-tematically different, further explanatory variables should be included
This will also reduce the error variance and thus standard errors
Before/After comparisons in “natural experiments“
DiD can be used to evaluate policy changes or other exogenous events
Differential effect of being in the location and after the incinerator was built
Pooled Cross Sections and Simple Panel Data Methods
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
4
Policy evaluation using difference-in-differences
Compare the difference in outcomes of the units that are affected by the policy change (= treatment group) and those who are not affected (= control group) before and after the policy was enacted.
For example, the level of unemployment benefits is cut but only for group A (= treatment group). Group A normally has longer unemployment durations than group B (= control group). If the diffe-rence in unemployment durations between group A and group B becomes smaller after the reform, reducing unemployment benefits reduces unemployment duration for those affected.
Caution: Difference-in-differences only works if the difference in outcomes between the two groups is not changed by other factors than the policy change (e.g. there must be no differential trends).
Compare outcomes of the two groups before and after the policy change
Pooled Cross Sections and Simple Panel Data Methods
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
5
Two-period panel data analysis
Example: Effect of unemployment on city crime rate
Assume that no other explanatory variables are available. Will it be possible to estimate the causal effect of unemployment on crime?
Yes, if cities are observed for at least two periods and other factors affecting crime stay approximately constant over those periods:
Unobserved time-constant factors (= fixed effect)
Other unobserved factors (= idiosyncratic error)
Time dummy for the second period
Pooled Cross Sections and Simple Panel Data Methods
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
6
Example: Effect of unemployment on city crime rate (cont.)
Estimate differenced equation by OLS:
Subtract:
Secular increase in crime
+ 1 percentage point unemploy-ment rate leads to 2.22 more crimes per 1,000 people
Fixed effect drops out!
Pooled Cross Sections and Simple Panel Data Methods
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
7
ESTIMATING THE EFFECT OF A MINIMUM WAGE CHANGE
Card and Krueger (1994) provide an example of a natural experiment and the differences-in-differences estimator.
On April 1, 1992, New Jersey’s minimum wage was increased from $4.25 to $5.05 per hour, while the minimum wage in Pennsylvania stayed at $4.25 per hour.
Data on 410 fast food restaurants in New Jersey (the treatment group) and eastern Pennsylvania (the control group).
The ‘‘before’’ period is February 1992, and the ‘‘after’’ period is November 1992.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Policy Analysis: Treatment Effects
Has the minimum wage increase reduced employment in these New Jersey fast food restaurants?
Treatment effect: H0 : d ≠ 0
yit = Full Time Employment = FTE = 0.5* # of part time + # of full time + # of managers
You may estimate the treatment effect using three different methods
1. Sample Means
2. OLS with pooled cross sectional data
3. Panel Data Analysis
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
David and Krueger (1994) ‘‘Minimum Wages and Employment,” American Economics Review.
| Table 7.8 Full-time Equivalent Employees by State and Period | |||
| Variable | N | mean | se |
| Pennsylvania | |||
| Before | 77 | 23.3312 | 1.3511 |
| After | 77 | 21.1656 | 0.9432 |
| New Jersey | |||
| Before | 321 | 20.4394 | 0.5083 |
| After | 319 | 21.0274 | 0.5203 |
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Method#1: Differences-in-Differences using Sample Means
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Method#2: Differences-in-Differences using OLS regression
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Method#3: Differences-in-Differences using Panel Data Analysis
The same fast food restaurants were observed on two occasions. We have ‘‘before’’ and ‘‘after’’ data on 384 of the 410 restaurants.
These are called panel data observations.
The remaining 26 restaurants had missing data on FTE either in the ‘‘before’’ or ‘‘after’’ period.
Panel data control for unobserved individual-specific characteristics such as preferred locations, some may have superior managers, and so on.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Method#3: Differences-in-Differences using Panel Data
Treatment effect: H0 : d ≠ 0
FTEit = b1 + b2NJi + b3Dt + d(NJi*Dt)+ ci +eit
Dt =1 if November = 0 if February
ci = fixed effect; unobserved characteristics of individual restaurant i that do not change over time
If we have T = 2 repeat observations we can eliminate ci by analyzing the changes in FTE from period one to period two.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Method#3: Differences-in-Differences using Panel Data
Treatment effect: H0 : d ≠ 0
FTEi2 = b1 + b2NJ2 + b31 + d(NJi*1)+ ci +ei2
FTEi1 = b1 + b2NJ2 + b30 + d(NJi*0)+ ci +ei1
Differences-in-Differences DiD mode using Panel Data:
DFTEi = b3 + dNJi +Dei
Those unobservable features ci are now gone.
Intercept b1 and b2 dropped out with b3 as new intercept.
The treatment effect is the coefficient “d “ of the indicator variable NJi
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Differences-in-Differences DiD mode using Panel Data:
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Robustness Check:
Why do the authors compare NJ to PA, not to, say, Alabama?
There are multiple ways to define the treatment and control groups. Within NJ, the restaurants that offer low wage are subject to change in minimum wage, so are in the treatment group. The NJ restaurants that offer high wage are in control group since they are unlikely to be affected by change in minimum wage. as
TREAT = 1; low wage restaurant (treatment group);
= 0; high wage restaurant (control group).
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Robustness Check: PA valid control group?
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Discussion of first-differenced panel estimator
Further explanatory variables may be included in original equation
Note that there may be arbitrary correlation between the unobserved time-invariant characteristics and the included explanatory variables
OLS in the original equation would therefore be inconsistent
The first-differenced panel estimator is thus a way to consistently estimate causal effects in the presence of time-invariant endogeneity
For consistency, strict exogeneity has to hold in the original equation
First-differenced estimates will be imprecise if explanatory variables vary only little over time (no estimate possible if time-invariant)
Pooled Cross Sections and Simple Panel Data Methods
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
21
Econometric methods
(a) Treatment (X) is “as if” randomly assigned: OLS
The differences-in-differences estimator uses two pre- and post-treatment measurements of Y, and estimates the treatment effect as the difference between the pre- and post-treatment values of Y for the treatment and control groups.
Let:
= value of Y for subject i before the treatment
= value of Y for subject i after the treatment
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The differences-in-differences estimator, ctd.
= ( – )–( – )
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The differences-in-differences estimator, ctd.
“Differences” regression formulation:
ΔYi = β0 + β1Xi + ui
where
ΔYi = –
Xi = 1 if treated, = 0 otherwise
is the diffs-in-diffs estimator
The differences-in-differences estimator allows for systematic differences in pre-treatment characteristics, which can happen in a quasi-experiment because treatment is not randomly assigned.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Differences-in-differences with control variables
ΔYit = β0 + β1Xit + β2W1it + … + β1+rWrit + uit,
Xit = 1 if the treatment is received, = 0 otherwise
Why include control variables?
For the usual reason: If the treatment (X) is “as if” randomly assigned, given W, then u is conditionally mean independent of X: E(u|X, W) = E(u|W) and including W results in the OLS estimator of β1 being unbiased.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Differences-in-differences with multiple time periods
The drunk driving law analysis of Ch. 10 can be thought of as a quasi-experiment panel data design: if (given the control variables) the beer tax is as if randomly assigned, then the causal effect of the beer tax (the elasticity) can be estimated by panel data regression.
The tools of Ch. 10 (SW) apply. Ignoring W’s, the differences-in-differences estimator obtains from including individual fixed effects and time effects:
Yit = αi + δt + β1Xit + uit.
If T = 2 (2 periods) and the treatment is in the second period, then ΔXit = Xit (why?) and the fixed effects/time effects regression becomes ΔYit = β0 + β1Xit + Δuit
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
IV estimation
If a variable (Z) that influences treatment (X) is “as if” randomly assigned, conditional on W, then Z can be used as an instrumental variable for X in an IV regression that includes the control variables W.
We encountered this in Ch. 12 (IV regression). The concept of “as-if” randomization has proven to be a fruitful way to think of instrumental variables.
One example is the location of a heart attack in the cardiac catheterization study (the location being “as if” randomly assigned)
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Regression Discontinuity Estimators
If treatment occurs when some continuous variable W crosses a threshold w0, then you can estimate the treatment effect by comparing individuals with W just below the threshold (treated) to these with W just above the threshold (untreated). If the direct effect on Y of W is continuous, the effect of treatment should show up as a jump in the outcome. The magnitude of this jump estimates the treatment effect.
In sharp regression discontinuity design, everyone above (or below) the threshold w0 gets treatment.
In fuzzy regression discontinuity design, crossing the threshold w0 influences the probability of treatment, but that probability is between 0 and 1.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Sharp Regression Discontinuity
Everyone with W < w0 gets treated, so
Xi = 1 if Wi < w0 and Xi = 0 otherwise.
The treatment effect, β1, can be estimated by OLS:
Yi = β0 + β1Xi + β2Wi + ui
If crossing the threshold affects Yi only through the treatment, then E(ui|Xi, Wi) = E(ui|Wi) so is unbiased.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Sharp regression discontinuity design in a picture:
Treatment occurs for everyone with W < w0, and the treatment effect is the jump or “discontinuity.”
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Fuzzy Regression Discontinuity
Let
Xi = binary treatment variable
Zi = 1 if W < w0 and Zi = 0 otherwise.
If crossing the threshold has no direct effect on Yi, so only affects Yi by influencing the probability of treatment, then E(ui| Zi, Wi) = 0. Thus Zi is an exogenous instrument for Xi.
Example:
Matsudaira, Jordan D. (2008). “Mandatory Summer School and Student Achievement.” Journal of Econometrics 142: 829-850. This paper studies the effect of mandatory summer school by comparing subsequent perormance of students who fell just below, and just above, the grade cutoff at which summer school was required.
© 2013 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Y
i
b
e
f
o
r
e
Y
i
a
f
t
e
r
1
ˆ
diffsindiffs
b
--
Y
t
r
e
a
t
,
a
f
t
e
r
Y
t
r
e
a
t
,
b
e
f
o
r
e
Y
c
o
n
t
r
o
l
,
a
f
t
e
r
Y
c
o
n
t
r
o
l
,
b
e
f
o
r
e
Y
i
a
f
t
e
r
1
ˆ
b
EC395 ����ʱ��21��24��/�μ�/EC395_Autocorrelation_L5.pdf
Outline
EC395 Applied Econometrics
SECTION III Autocorrelation1
1Lazaridis School of Business and Economics Wilfrid Laurier University
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Outline
1 Definition
2 Identification: Durbin Watson and LM tests
3 Consequences
4 Solution: Feasible Generalized Least Square (FGLS)
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Autocorrelation
1 Autocorrelation (serial correlation) occurs when the error terms are correlated across observations.
2 Various factors can produce residuals that are correlated with each other, such as an omitted variable or the wrong functional form.
3 If the problem cannot be resolved by improved model specification, then we need to correct for the influence of the autocorrelation through statistical means.
4 OLS assumes no autocorrelation (A3) Cov(ui ,uj ) = 0
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Time Dependence and Lagged Variables
1 We model dynamic effect using lagged variables GDPt−1,GDPt−2,Tbillt−1
ˆGDP t−1 = 0.22 + 0.85GDPt−1 + 0.13GDPt−2
2 In Stata, lagged variable can be generated as ”gen gdp lag1=gdp[ n-1]”
GDPt GDPt−1 GDPt−2 TBILLt 2017Q1 1.674 1.734 0.022 0.475 2017Q2 1.703 1.674 1.734 0.527 2017Q3 1.098 1.703 1.674 0.699 2017Q4 0.432 1.098 1.703 0.927 2018Q1 1.528 0.432 1.098 1.115 2018Q2 0.763 1.528 0.432 1.177
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Cause: Omitted Variable Bias
1 True Model
GDPt = β0 + β1GDPt−1 + β2Tbillt + vt
2 GDP depends on the last quarter (Persistent if β2 is large). 3 If you omitted this lagged dependent variable on the right hand
side, your Stata model will look like
GDPt = β0 + β2Tbillt + ut
4 Your mis-specified model will include the lagged GDP in the error term and they will be autocorrelated. Cov(ut ,ut−1) 6= 0
ut = β1GDPt−1 + vt since ut−1 is inside GDPt−1
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Causes: Market Over-reaction
1 Simple Asset Pricing Model
Googlet = β0 + β1S&P500t + ut
2 Market overreact to news announcement about the company on day t leads to first order negative autocorrelation.
ut = −0.5ut−1 + vt
3 The share price could be affected by political scandal, concerns of security issues, and revenue falling short.
4 So 2% price drop today may lead to 1% increase tomorrow because of overreaction.
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Causes: Mis-specified Functional Form
1 True model is a quadratic function
GDPt = β0 + β1Tbillt + β2Tbill2t + vt
2 You mis-specify the model as a simple linear function
GDPt = β0 + β1Tbillt + ut
3 Your mis-specified model will include the lagged GDP in the error term and they will be autocorrelated.
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Cause: Mis-specified Functional Form
1 Your mis-specified model will include the lagged GDP in the error term and they will be autocorrelated. ût = 0.9ût−1 + vt
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Cause: Mis-specified Functional Form
1 If you apply the quadratic model to the data set, the residuals will not be autocorrelated.
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Autocorrelation and Time Series data
1 Autocorrelation captures the time dependence in your data set, so you need time series analysis.
2 It doesn’t work with cross sectional data because the ordering of data is irrelevant.
3 If you do detect autocorrelation in cross sectional data, your model is mis-specified.
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Order of Autocorrelation
1 1st order Autocorrelation
ut = ρut−1 + vt
2 2nd order Autocorrelation
ut = ρ1ut−1 + ρ2ut−2 + vt
3 pth order Autocorrelation
ut = ρ1ut−1 + ρ2ut−2 + ...+ ρput−p + vt
4 The order of autocorrelation must be determined by hypothesis testing. (General to Specific)
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
General to Specific Approach: Lag Length Selection
1 Assume the highest lag order (the general model and then use F test to test it down to the simplest model.
General: GDPt = β0+β1Tbillt +β2Tbillt−1+...+β4Tbillt−4+vt
2 2nd order Autocorrelation
ut = ρ1ut−1 + ρ2ut−2 + vt
3 pth order Autocorrelation
ut = ρ1ut−1 + ρ2ut−2 + ...+ ρput−p + vt
4 The order of autocorrelation must be determined by hypothesis testing. (General to Specific)
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Positive Autocorrelation
1 Graph the residuals to check for dependence (i.e. ut = 0.8ut−1 + vt )
(a) Plot ût against ût−1 (b) Plot ût against time
Figure: 1st Order Positive Autocorrelation
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Definition Cause: Omitted Variable Bias Cause: Market Over-reaction Cause: Mis-specified Functional Form Order of Autocorrelation Positive Autocorrelation Negative Autocorrelation
Negative Autocorrelation
1 Graph the residuals to check for dependence (i.e. ut = −0.5ut−1 + vt )
(a) Plot ût against ût−1 (b) Plot ût against time
Figure: 1st Order Negative Autocorrelation
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Durbin Watson Test Durbin Watson Test Durbin h Test Durbin h Test Lagrange multiplier (LM) Test
Autocorrelation in residuals
1 After running the GDP equation
ˆGDP t−1 = 0.22 + 0.85GDPt−1 + 0.13GDPt−2
2 We look for pattern in residuals and their lags to detect autocorrelation. Cov(ût , ût−1) = 0? Cov(ût , ût−2) = 0? ......
GDPt ˆGDP t ût 2017Q1 1.77 1.67 −0.10 2017Q2 1.54 1.70 0.16 2017Q3 1.57 1.10 −0.47 2017Q4 1.16 0.43 −0.73 2018Q1 0.79 1.53 0.74 2018Q2 1.59 0.76 −0.83
Copyright 2019 Chan EC395
Durbin Watson Test
Assume that the regression we carried out is as follows
ˆGDP i = 1.99 + 0.135Tbilli − 0.161URi
Are these OLS estimates efficient?
. reg gdp_growth tbill ur
Source | SS df MS No. of obs=170 -------------+---------------------------------- F(2, 167) =21.48
Model | 52.0057378 2 26.0028689 Prob > F = 0.00 Residual | 202.141493 167 1.2104281 R-squared= 0.20
-------------+---------------------------------- Adj R-squared=0.19 Total | 254.147231 169 1.50382977 Root MSE=1.10
------------------------------------------------------------------------------ gdp | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- tbill | .1352503 .020681 6.54 0.000 .0944204 .1760802
ur | -.1612508 .0553524 -2.91 0.004 -.2705315 -.0519701 cons | 1.994768 .4330468 4.61 0.000 1.139817 2.84972 ------------------------------------------------------------------------------
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Durbin Watson Test Durbin Watson Test Durbin h Test Durbin h Test Lagrange multiplier (LM) Test
Durbin Watson Test: Null and Alternative Hypotheses
1 The Durbin-Watson (DW) is a test for first order autocorrelation - i.e. it assumes that the relationship is between the error and the previous one.
ut = ρut−1 + vt
where vt ∼ N(0, σ2) The DW test statistic actually tests
H0 : ρ = 0 and H1 : ρ 6= 0
The test statistic is calculated by
DW = ∑n
t=2(ût − ût−1)2∑n t=1 û
2 t
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Durbin Watson Test Durbin Watson Test Durbin h Test Durbin h Test Lagrange multiplier (LM) Test
Durbin Watson Test: Intuition
1 Positive Autocorrelation:
ut = ρut−1 + vt ρ > 0 (i .e. ρ = 0.9)
2 Negative Autocorrelation:
ut = ρut−1 + vt ρ < 0 (i .e. ρ = −0.5)
3 No Autocorrelation
ut = vt ∼ N(0, σ2) ρ = 0
4 Note that ρ must be between 1 and -1 to be stationary (stable).
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Durbin Watson Test Durbin Watson Test Durbin h Test Durbin h Test Lagrange multiplier (LM) Test
Durbin Watson Test: Intuition II
Based on OLS residuals, Durbin Watson test focus on the coefficient ρ
DW = ∑n
t=2(ût − ût−1)2∑n t=1 û
2 t
=
∑n t=2 û
2 t +
∑n t=2 û
2 t−1 − 2
∑n t=2 ût ût−1∑n
t=1 û 2 t
DW ≈ 2− 2 ∑n
t=2 ût ût−1∑n t=1 û
2 t
DW ≈ 2(1− ρ̂) DW → 0 ρ̂→ 1 Positive Autocorrelation / DW → 2 ρ̂→ 0 No Autocorrelation: OLS is efficient! , DW → 4 ρ̂→ −1 Negative Autocorrelation /
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Durbin Watson Test Durbin Watson Test Durbin h Test Durbin h Test Lagrange multiplier (LM) Test
Distribution of Durbin Watson Statistic
The Durbin Watson statistic has a special distribution with values between 0 and 4. The lower and upper critical values dL and dU depends on the sample size (N) and number of parameters (k)
Copyright 2019 Chan EC395
Distribution of Durbin Watson Statistic
1 Positive Autocorrelation
H0 : ρ = 0 H1 : ρ > 0
If DW < dL then reject H0. If DW > dU then cannot reject H0. dL < DW < dU is inconclusive region - rule of thumb: act as if there were auto. For example, n=20, k’=k-1=3, α = 0.05, dL = 1.00, dU = 1.68. IF DW = 0.92, reject H0 and accept positive autocorrelation.
2 Negative Correlation
H0 : ρ = 0 H1 : ρ < 0
If DW > 4− dL then reject H0. If DW < 4− dU then cannot reject H0. 4− dU < DW < 4− dL is inconclusive region - rule of thumb: act as if there were auto.
Durbin Watson Statistic 1% Significant dL and dU
k = 2 k = 3 k = 4 k = 5 k = 6 N dL dU dL dU dL dU dL dU dL dU
15 0.811 1.069 0.700 1.252 0.591 1.465 0.487 1.705 0.390 1.967 16 0.844 1.087 0.738 1.253 0.633 1.447 0.532 1.664 0.437 1.901 17 0.873 1.102 0.773 1.255 0.672 1.432 0.574 1.631 0.481 1.847 18 0.902 1.118 0.805 1.259 0.708 1.422 0.614 1.604 0.522 1.803 19 0.928 1.133 0.835 1.264 0.742 1.416 0.650 1.583 0.561 1.767 20 0.952 1.147 0.862 1.270 0.774 1.410 0.684 1.567 0.598 1.736 21 0.975 1.161 0.889 1.276 0.803 1.408 0.718 1.554 0.634 1.712 22 0.997 1.174 0.915 1.284 0.832 1.407 0.748 1.543 0.666 1.691 23 1.017 1.186 0.938 1.290 0.858 1.407 0.777 1.535 0.699 1.674 24 1.037 1.199 0.959 1.298 0.881 1.407 0.805 1.527 0.728 1.659 25 1.055 1.210 0.981 1.305 0.906 1.408 0.832 1.521 0.756 1.645
...... 100 1.522 1.562 1.502 1.582 1.482 1.604 1.461 1.625 1.441 1.647
Durbin Watson Statistic 5% Significant dL and dU
k = 2 k = 3 k = 4 k = 5 k = 6 N dL dU dL dU dL dU dL dU dL dU
15 1.077 1.361 0.945 1.543 0.814 1.750 0.685 1.977 0.562 2.220 16 1.106 1.371 0.982 1.539 0.857 1.728 0.734 1.935 0.615 2.157 17 1.133 1.381 1.015 1.536 0.897 1.710 0.779 1.900 0.664 2.104 18 1.158 1.392 1.046 1.535 0.933 1.696 0.820 1.872 0.710 2.060 19 1.180 1.401 1.075 1.535 0.967 1.685 0.859 1.848 0.752 2.022 20 1.201 1.411 1.100 1.537 0.998 1.676 0.894 1.828 0.792 1.991 21 1.221 1.420 1.125 1.538 1.026 1.669 0.927 1.812 0.828 1.964 22 1.240 1.429 1.147 1.541 1.053 1.664 0.958 1.797 0.863 1.940 23 1.257 1.437 1.168 1.543 1.078 1.660 0.986 1.786 0.895 1.919 24 1.273 1.446 1.188 1.546 1.101 1.657 1.013 1.775 0.925 1.902 25 1.288 1.454 1.206 1.550 1.123 1.654 1.038 1.767 0.953 1.886
...... 100 1.654 1.694 1.634 1.715 1.613 1.736 1.592 1.758 1.571 1.780
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Durbin Watson Test Durbin Watson Test Durbin h Test Durbin h Test Lagrange multiplier (LM) Test
Durbin Watson Test: Example I (estat dwatson)
Assume that the regression we carried out is as follows
ˆGDP i = 1.99 + 0.135Tbilli − 0.161URi
You need to use the estat dwatson command to get the DW statistic.
. estat dwatson Durbin-Watson d-statistic( 3, 170) = .929423
Since sample size is 403 and k = 3, dL = 1.634 and dU = 1.715, the DW statistic of 0.929 falls below the lower critical value, we conclude that the error term is positively autocorrelated.
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Durbin Watson Test Durbin Watson Test Durbin h Test Durbin h Test Lagrange multiplier (LM) Test
Stata Commands: estate dwatson You must first tell Stata that you have time series data before you can use Durbin Watson command. Your program should look like this format Date %tq <--- Date in quarterly format tsset Date <--- set time series data reg gdp_growth tbill ur estat dwatson <--- produce DW statistic
If your date variable look like this
Date GDPt ˆGDP t ût 2017Q1 1.77 1.67 −0.10 2017Q2 1.54 1.70 0.16 2017Q3 1.57 1.10 −0.47 2017Q4 1.16 0.43 −0.73
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Durbin Watson Test Durbin Watson Test Durbin h Test Durbin h Test Lagrange multiplier (LM) Test
Stata Commands: estate dwatson and tsset For daily formatted data, you need to convert the Date to quarterly format first format Date %td <-- data in daily format gen yq = qofd(Date) <-- retrieve quarter from daily format format yq %tq <-- data in quarterly format tsset yq reg gdp_growth tbill ur estat dwatson
Date yq GDPt ˆGDP t ût 01mar2017 2017Q1 1.77 1.67 −0.10 01jun2017 2017Q2 1.54 1.70 0.16 01sep2017 2017Q3 1.57 1.10 −0.47 01dec2017 2017Q4 1.16 0.43 −0.73
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Durbin Watson Test Durbin Watson Test Durbin h Test Durbin h Test Lagrange multiplier (LM) Test
Durbin Watson h Test: Null and Alternative Hypotheses
1 The Durbin-Watson (DW) test is not valid if you have a lagged dependent variable on the right hand side of your regression.
ˆGDP i = 0.66 + 0.047Tbilli − 0.032URi + 0.527GDPi−1 In this case, you need to use Durbin-h test which is defined by
Durbin-h Stat = (
1− DW 2
)√ N
1− N [Var(β3)] ∼ N(0,1)
The DW-h test statistic actually tests
H0 : ρ = 0 and H1 : ρ 6= 0
The test statistic has a standard normal distribution.
Copyright 2019 Chan EC395
Stata command: durbinh
* The Durbin h command produces the statistic and p value.
. durbinh Durbin-Watson h-statistic: .3999851 t = 2.756707 P-value = .0065
Since the p value is less than 0.05, we conclude that we have autocorrelation. * you may use the alternative ”estat durbinalt” command to obtain an alternative Durbin Watson test that is basically squared Durbin-h with a χ2 distribution.
. estat durbinalt Durbin’s alternative test for autocorrelation ---------------------------------------------------------------------------
lags(p) | chi2 df Prob > chi2 -------------+-------------------------------------------------------------
1 | 4.458 1 0.0347 ---------------------------------------------------------------------------
H0: no serial correlation
You will arrive at the same conclusion.
Lagrange multiplier (LM) Test
1 The Lagrange multiplier (LM) test has the following structure.
2 Step 1: We estimate the model
ˆGDP i = 0.66 + 0.047Tbilli − 0.032URi
3 Step 2: obtaining the residuals ûi .
4 Step 3: Then run the auxiliary regression assuming that at least one of the lagged residuals is affecting the residual at current period ”t”.
ut = ρ1ut−1 + ρ2ut−2 + ...+ ρput−p + vt
The LM test statistic actually tests
H0 : ρ1 = ρ2 = .. = ρp = 0 and H1 : at least one of them is not zero.
Step 4: The test statistic is defined by
LM stat = N ∗ R2 ∼ χ2(p)
Breusch-Pagan-Godfrey (LM) Test for Autocorrelation
The LM test statistic is defined by
LM Stat = N ∗ R2 ∼ χ2(m)
. estat bgodfrey, lags(5) Breusch-Godfrey LM test for autocorrelation ---------------------------------------------------------------------------
lags(p) | chi2 df Prob > chi2 -------------+-------------------------------------------------------------
5 | 6.549 5 0.2564 ---------------------------------------------------------------------------
H0: no serial correlation
The statistic is χ2 distributed with 5 degree of freedom where 5 is the number oflagged residuals in the auxiliary equation. Since the p value is 0.25 greater than 0.05, we don’t reject the null and conclude that there is no autocorrelation.
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Consequences of Autocorrelation
1 OLS is unbiased and consistent.
β̂ =
∑ (Xt − X )(Yt − Y )∑
(Xt − X )2 = β +
∑ (Xt − X )∑ (Xt − X )2
ut
E(β̂) = β
2 OLS is inefficient, it is not BLUE.
Var(β̂) = Var( ∑ (Xt − X )∑
(Xt − X )2 ut ) = Var(
∑ wtut ) (1)
= ∑
w2t Var(ut ) + 2 n∑
t=1
n∑ s=1
wswtCov(usut )
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Consequences of Autocorrelation
1 If you assume constant variance
Var(β̂) = ∑
w2t Var(ut ) + 2 n∑
t=1
n∑ s=1
wswtCov(usut )
Var(β̂) = σ2∑
(Xt − X )2 + 2
n∑ t=1
n∑ s=1
wswtCov(usut )
2 OLS efficient variance is defined by
Var(β̂) = σ2
(Xt − X )2
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Consequences of Autocorrelation
Consequences of Using OLS in the Presence of Autocorrelation
1 OLS estimation still gives unbiased coefficient estimates, but they are no longer BLUE.
2 This implies that if we still use OLS in the presence of autocorrelation, our standard errors could be inappropriate and hence any inferences we make could be misleading.
3 Whether the standard errors calculated using the usual formulae are too big or too small will depend upon the form of the autocorrelation.
Copyright 2019 Chan EC395
Generalized Least Squares (GLS) 1 If the form (i.e. the cause) of the autocorrelation is known,
then we can use an estimation method which takes this into account (called Generalised Least Squares, GLS).
GDPt = β0 + β1Tbillt + β2URt + ut
2 A simple illustration of GLS is as follows: Suppose that the error term is autocrrelated of first order:
ut = ρut−1 + vt
3 To remove the autocorrelation, subtract ρGDPt−1 from the original equation
GDPt = β0 + β1Tbillt−1 + β2URt + ut−1 ρGDPt−1 = ρβ0 + ρβ1Tbillt−1 + ρβ2URt−1 + ρut−1
GDPt − ρGDPt−1 = β0(1− ρ) + β1(Tbillt − ρTbillt−1) + β2(URt − ρURt−1) + ut − ρut−1
It is not BLUE because it lost one observation.
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Feasible Generalized Least Squares (FGLS) FGLS: Iterated Prais-Winsten Procedure Iterative Three Step Prais-Winsten Procedure Autoregressive Model: Adding lagged dependent variable Autocorrelation: Summary Autocorrelation: Summary II
Generalized Least Square (GLS) and Autocorrelation
The Generalized Least Square (GLS) Model for Autocorrelation is given by
GDPt − ρGDPt−1 = β0(1− ρ) + β1(Tbillt − ρTbillt−1) + β2(URt − ρURt−1) + ut − ρut−1︸ ︷︷ ︸
new error vt
Notice the new error term has no serial correlation.
vt = ut − ρut−1 ∼ N(0, σ2)
The only question is how to estimate ρ?
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Feasible Generalized Least Squares (FGLS) FGLS: Iterated Prais-Winsten Procedure Iterative Three Step Prais-Winsten Procedure Autoregressive Model: Adding lagged dependent variable Autocorrelation: Summary Autocorrelation: Summary II
FGLS: Three Step Cochrane-Orcutt Procedure
1 Step 1: OLS GDPt = β0 + β1Tbillt + β2URt + ut to obtain ût 2 Step 2: OLS ût = ρût−1 + v∗t i.e.
ρ̂ =
∑n t=2 ût ût−1∑n
t=2 û 2 t−1
It is consistent. 3 Step 3: OLS
GDPt − ρGDPt−1 = β0(1− ρ) + β1(Tbillt − ρTbillt−1) + β2(URt − ρURt−1) + ut − ρut−1︸ ︷︷ ︸
new error vt
β̂i are consistent and asymptotically efficient. Copyright 2019 Chan EC395
FGLS: Three Step Cochrane-Orcutt Procedure
1 First three steps are the same as the three steps in Three Step Cochrane-Orcutt Procedure and then use the residuals from step 3 to estimate ρ again as in step 2.
2 Repeat step 3 using the estimate of new ρ. Continue until
∆βi ≈ 0 ∆β0 ≈ 0 ∆ρ ≈ 0
When the change in the coefficient is less than a prescribed number we say that the procedure has converged. Iteration to convergence does not improve the asymptotic properties of the estimators because the sample size does not change. There is a belief that iteration improves the small sample performance of the estimators. This is the corc options in Stata.
FGLS: Iterative Three Step Cochrane-Orcutt Procedure
. prais gdp_growth tbill ur, corc
Iteration 0: rho = 0.0000 Iteration 1: rho = 0.5261 Iteration 2: rho = 0.5271 Cochrane-Orcutt AR(1) regression -- iterated estimates
Source | SS df MS No. of obs=169 -------------+---------------------------------- F(2, 166) =7.17
Model | 12.300144 2 6.15007198 Prob > F =0.0010 Residual | 142.394945 166 .857800876 R-squared=0.0795
-------------+---------------------------------- Adj R-sq = 0.0684 Total | 154.695089 168 .920804104 Root MSE= .92618
------------------------------------------------------------------------------ gdp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- tbill| .1283435 .0343994 3.73 0.000 .0604268 .1962601 ur | -.1701025 .0917097 -1.85 0.065 -.3511702 .0109652
_cons | 2.083528 .7303243 2.85 0.005 .6416064 3.525449 -------------+----------------------------------------------------------------
rho | .5270682 ------------------------------------------------------------------------------ Durbin-Watson statistic (original) 0.929423 Durbin-Watson statistic (transformed) 1.848922
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Feasible Generalized Least Squares (FGLS) FGLS: Iterated Prais-Winsten Procedure Iterative Three Step Prais-Winsten Procedure Autoregressive Model: Adding lagged dependent variable Autocorrelation: Summary Autocorrelation: Summary II
FGLS: Iterated Prais-Winsten Procedure
The iterated Cochrane-Orcutt procedure is not BLUE because it lost one observation. Prais-Winsten procedure is the same as the CO procedure with the exception of adding the first observation back with the following transformation:
GDP∗1 = √
1− ρ2GDP1
1 Use the residuals from iterated CO procedure to estimate ρ again
2 Repeat the same three steps using ρ̂, Continue until the estimators converge.
Copyright 2019 Chan EC395
FGLS: Iterative Three Step Prais-Winsten Procedure
. prais gdp_growth tbill ur Iteration 0: rho = 0.0000 Iteration 1: rho = 0.5261 Iteration 2: rho = 0.5287 Iteration 3: rho = 0.5287 Iteration 4: rho = 0.5287 Prais-Winsten AR(1) regression -- iterated estimates
Source | SS df MS No. of obs=170 -------------+---------------------------------- F(2, 167) =9.89
Model | 17.174482 2 8.58724102 Prob > F =0.0001 Residual | 145.02836 167 .868433292 R-squared =0.1059
-------------+---------------------------------- Adj R-sq = 0.0952 Total | 162.202842 169 .959780129 Root MSE =.9319
------------------------------------------------------------------------------ gdp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- tbil | .1367045 .0343736 3.98 0.000 .0688416 .2045674 ur | -.1947178 .0914647 -2.13 0.035 -.3752939 -.0141417
_cons| 2.273927 .7290033 3.12 0.002 .8346771 3.713177 -------------+----------------------------------------------------------------
rho | .5287142 ------------------------------------------------------------------------------ Durbin-Watson statistic (original) 0.929423 Durbin-Watson statistic (transformed) 1.818114
FGLS: Iterative Three Step Prais-Winsten Procedure
. esttab, r2 ar2 ----------------------------------------------------------------------------
(1) (2) (3) (4) dp_growth gdp_growth gdp_growth gdp_growth
---------------------------------------------------------------------------- tbill 0.135*** 0.135*** 0.128*** 0.137***
(6.54) (5.55) (3.73) (3.98)
ur -0.161** -0.161*** -0.170 -0.195* (-2.91) (-3.41) (-1.85) (-2.13)
_cons 1.995*** 1.995*** 2.084** 2.274** (4.61) (5.51) (2.85) (3.12)
---------------------------------------------------------------------------- N 170 170 169 170 R-sq 0.205 0.205 0.080 0.106 adj. R-sq 0.195 0.195 0.068 0.095 ---------------------------------------------------------------------------- t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
Autoregssive Model
1 The best solution for autocorrelation is adding lagged dependent variable as regressor.
2 This dynamic model is called Autoregressive Model. GDPt = β0 + β1Tbillt + β2URt + β3GDPt−1 + ut
. reg gdp_growth tbill ur L.gdp_growth L2.gdp_growth ------------------------------------------------------------------------------
gdp_growth | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------
tbill | .0650432 .022013 2.95 0.004 .0215759 .1085106 ur | -.0544406 .0505039 -1.08 0.283 -.1541668 .0452856
gdp_growth | L1. | .5918162 .0781966 7.57 0.000 .4374072 .7462252 L2. | -.1876013 .0786725 -2.38 0.018 -.34295 -.0322526
------------------------------------------------------------------------------ . durbinh Durbin-Watson h-statistic: .519 t = 1.30
P-value = .195
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Feasible Generalized Least Squares (FGLS) FGLS: Iterated Prais-Winsten Procedure Iterative Three Step Prais-Winsten Procedure Autoregressive Model: Adding lagged dependent variable Autocorrelation: Summary Autocorrelation: Summary II
Autocorrelation: Summary
1 GLS assume ut = ρut−1 + vt GLS : GDPt − ρGDPt−1 2 FGLS: Cochrane-Orcutt (CO) Procedure
ut = ρut−1 + vt FGLS(CO) : GLS : GDPt − ρ̂GDPt−1
3 FGLS: Prais-Winsten (PW) Procedure
ut = ρut−1 + vt FGLS(PW ) : GLS : GDPt − ρ̂GDPt−1 GDP∗1 =
√ 1− ρ2GDP1
The estimated coefficients will be consistent and asymptotically efficient.
Copyright 2019 Chan EC395
Outline Autocorrelation
Dectection of Autocorrelation Consequences of Autocorrelation Generalized Least Squares (GLS)
Feasible Generalized Least Squares (FGLS) FGLS: Iterated Prais-Winsten Procedure Iterative Three Step Prais-Winsten Procedure Autoregressive Model: Adding lagged dependent variable Autocorrelation: Summary Autocorrelation: Summary II
Autocorrelation: Summary II
1 OLS estimator is not efficient in the presence of autocorrelation.
2 The best solution is to add lagged dependent variable to the equation and test auto again.
3 If lagged dependent variable as regressor does not fix autocorrelation, use FGLS.
4 The estimated coefficients of FGLS will be consistent and asymptotically efficient.
Copyright 2019 Chan EC395
- Outline
- Main Talk
- Outline
- Autocorrelation
- Definition
- Cause: Omitted Variable Bias
- Cause: Market Over-reaction
- Cause: Mis-specified Functional Form
- Order of Autocorrelation
- Positive Autocorrelation
- Negative Autocorrelation
- Detection of Autocorrelation
- Durbin Watson Test
- Durbin Watson Test
- Durbin h Test
- Durbin h Test
- Lagrange multiplier (LM) Test
- Consequences of Autocorrelation
- Generalized Least Squares (GLS)
- Feasible Generalized Least Squares (FGLS)
- FGLS: Iterated Prais-Winsten Procedure
- Iterated Prais-Winsten Procedure
- Iterative Three Step Prais-Winsten Procedure
- Autoregressive Model: Adding lagged dependent variable
- Autocorrelation: Summary
- Autocorrelation: Summary II
EC395 ����ʱ��21��24��/�μ�/EC395_Cointegration_ECM_L6 (1).pdf
Outline
EC395 Applied Econometrics
SECTION V Cointegration and Error Correction Model (ECM) 1
1Lazaridis School of Business and Economics Wilfrid Laurier University
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Outline
1 Stationarity & First Difference
2 Unit Root test (Augmented Duckey Fuller) Test
3 Cointegration
4 Error Correction Model (ECM)
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Stationary Stationarity: Graphical Interpretation
Stationary
1 Strong Stationarity
1 The joint distribution of yt , yt+1, ...yt+h equals the joint distribution of yt+k , yt+k+1, ..., yt+k+h for all t and h
2 The joint distribution of y2015Q1, y2015Q2, ...y2016Q4 equals the joint distribution of y2016Q1, y2016Q2, ..., y2017Q4.
2 Second Order (Weak/Covariance) Stationarity
E(yt ) = µ is free of t (constant mean)
Var (yt ) = σ2y is free of t (constant variance) Cov(yt , yt+s) = γs is free of t (stable covariance)
(but not necessarily free of s)
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Stationary Stationarity: Graphical Interpretation
Stationary
1 If you have time series data, all your independent and dependent variables must be stationary.
2 Otherwise, your estimates will be biased and inference is not valid.
3 How do you define a t statistic without mean and variance?
t = β̂− β
s.e.(β̂) =
estimates− true mean standard errors
4 What about your forecasts? ˆGDP t ± critical value ∗ s.e.( ˆGDP t )
5 The true mean and standard errors are undefined with non-stationary data.
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Stationary Stationarity: Graphical Interpretation
Stationarity: Graphical Interpretation
1 Graph your data (independent and dependent variables) to check for stationarity.
(a) GDP in level (Non-stationary)
(b) Growth rate of GDP (Stationary)
Figure: Stationary vs Non-Stationary Data Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Stationary Stationarity: Graphical Interpretation
Stationarity: Graphical Interpretation
1 GDPt + β0 + β1∆Tbillt + β2CADt + ut
(a) GDP in level (Non-stationary)
(b) First differenced Treasury Bill (Stationary)
Figure: Stationary vs Non-Stationary Data
2 You can reply on a non-stationary data to forecast stationary data.
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Stationary Stationarity: Graphical Interpretation
Non-Stationary Data: Spurious Regression
1 Many macroeconomic and financial time series are nonstationary.
2 There is a danger of obtaining apparently significant regression results from unrelated data when using nonstationary series in regression analysis.
3 Such regressions are said to be spurious.
GDPt = 0.5 + 0.02Yeart + ut No. of Email accounts = 2.5 + 0.05Yeart + vt
4 The correlation between GDP and Emails will be high leading to high R2.
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Random Walk Testing Stationarity Unit Root Test: Dickey Fuller Test Order of Integration Stata Example
Random Walk
Your data is non-stationary if it is a random walk. We will consider three versions of non-stationary random walk. 1) Random Walk; 2) Random Walk with drift; 3) Random Walk with trend
1 Random walk is defined by the following general structure
yt = α + ρyt−1 + vt 2 Random Walk (or Unit Root) if intercept α = 0 and ρ = 1,
we have Random Walk
yt = yt−1 + ut 3 A random walk series shows no definite trend, and slowly
turns one way or the other. Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Random Walk Testing Stationarity Unit Root Test: Dickey Fuller Test Order of Integration Stata Example
Random Walk
1 Random Walk with drift
yt = α + yt−1 + vt
2 If the intercept is not zero and the coefficient ρ = 1, the series produced is also non-stationary and we called this process a random walk with a drift.
3 Random Walk with trend
yt = α + α1 ∗ trendt + yt−1 + vt
4 The key point is that random walk refers to the unit coefficient (ρ = 1) for the lagged variable yt−1.
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Random Walk Testing Stationarity Unit Root Test: Dickey Fuller Test Order of Integration Stata Example
Testing Stationarity
1 Testing stationarity of your data is the same as testing whether or not your data follows a random walk process.
2 In general, you have to test the null hypothesis of random walk (or unit root) as H0 : ρ = 1 for all three cases
1 Random walk yt = ρyt−1 + vt 2 Random Walk with drift yt = α + ρyt−1 + ut 3 Random Walk with trend yt = α + α1 ∗ trendt + ρyt−1 + vt
3 We can’t use OLS to test ρ because the data yt may be non-stationary and t tests are not valid.
4 Unit root test replaces the dependent variable in the first differenced form ∆yt = yt − yt−1.
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Random Walk Testing Stationarity Unit Root Test: Dickey Fuller Test Order of Integration Stata Example
Unit Root Test : Dickey Fuller Test 1 Unit root test test the null hypothesis of non-stationary data
H0 : ρ = 1 using all three cases 1 Random walk
∆yt = (ρ− 1)yt−1 + vt 2 Random Walk with drift
∆yt = α + (ρ− 1)yt−1 + ut 3 Random Walk with trend
∆yt = α + α1 ∗ trendt + (ρ− 1)yt−1 + vt 2 Since we don’t know the true process has a drift, a trend,
or other control variables, the validity of the unit root test on ρ replies on a correctly specified functional form.
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Random Walk Testing Stationarity Unit Root Test: Dickey Fuller Test Order of Integration Stata Example
Augmented Dickey Fuller Test 1 The Dickey Fuller test is not valid if we omitted any relevant
variables on the right hand side. 2 To mitigate the effect of omitted variable bias, Augmented
Dickey Fuller test introduces the lagged dependent variables on the RHS to capture the omitted variables. So the general formulae look like
1 Random walk: ∆yt = (ρ− 1)yt−1 + ∑pi=1 δi ∆yt−i + vt 2 Random Walk with drift :
∆yt = α + (ρ− 1)yt−1 + ∑pi=1 δi ∆yt−i + ut 3 Random Walk with trend:
∆yt = α + α1 ∗ trendt + (ρ− 1)yt−1 + ∑pi=1 δi ∆yt−i + vt 3 The t statistic on ρ̂ do not have a standard t distribution, so
the critical values and p values must be computed from simulations.
Copyright 2019 Chan EC395
Critical Values for Augmented Dickey Fuller Tests Probability to the Right of Critical Value
Model Statistic N 1% 2.5% 5% 10%
Model I (no constant, no trend) ADFtr 25 -2.66 -2.26 -1.95 -1.60
50 -2.62 -2.25 -1.95 -1.61 100 -2.60 -2.24 -1.95 -1.61 250 -2.58 -2.23 -1.95 -1.61 500 -2.58 -2.23 -1.95 -1.61 >500 -2.58 -2.23 -1.95 -1.61
Model II (constant, no trend) ADFtr 25 -3.75 -3.33 -3.00 -2.62
50 -3.58 -3.22 -2.93 -2.60 100 -3.51 -3.17 -2.89 -2.58 250 -3.46 -3.14 -2.88 -2.57 500 -3.44 -3.13 -2.87 -2.57 >500 -3.43 -3.12 -2.86 -2.57
Model III (constant, trend) ADFtr 25 -4.38 -3.95 -3.60 -3.24
50 -4.15 -3.80 -3.50 -3.18 100 -4.04 -3.73 -3.45 -3.15 250 -3.99 -3.69 -3.43 -3.13 500 -3.98 -3.68 -3.42 -3.13 >500 -3.96 -3.66 -3.41 -3.12
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Random Walk Testing Stationarity Unit Root Test: Dickey Fuller Test Order of Integration Stata Example
Augmented Dickey Fuller Test II
The ADF statistic is defined by
ADF = τ statistic = (ρ− 1)
s.e.(ρ̂− 1) Decision Rule: If the ADF statistic is less than the critical value, we reject the null of unit root (non-stationary and random walk).
ADF Model: ∆yt = (ρ− 1)yt−1 + ut Random walk(ρ = 1) : ∆yt = 0 ∗ yt−1 + vt → yt = yt−1 + vt
Stationary(ρ = 0.5 > 0) : ∆yt = (−0.5)yt−1 + ut Stationary(ρ = −0.5 < 0) : ∆yt = (−1.5)yt−1 + vt That’s why if the data is stationary, the ADF statistic (or tau statistic on (ρ− 1)) should be negative away from zero.
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Random Walk Testing Stationarity Unit Root Test: Dickey Fuller Test Order of Integration Stata Example
Order of Integration I(d)
If the data follows a random walk process, the only solution is to difference the data ∆yt = yt − yt−1 and test for unit root again.
1 The variable ∆yt = yt − yt−1 is called the first difference of the series yt .
2 If yt follows a random walk, taking the difference leaves the stationary component vt plus other controls.
3 Series like yt , which can be made stationary by taking the first difference, are said to be integrated of order 1, and denoted I(1).
4 Stationary series are said to be integrated of order zero, I(0).
5 In general, if a series must be differenced d times to be made stationary it is integrated of order d, or I(d).
Copyright 2019 Chan EC395
Stata Example
. dfuller gdp, lags(4) regress
Augmented Dickey-Fuller test for unit root No. of obs = 166
---------- Interpolated Dickey-Fuller --------- Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value ------------------------------------------------------------------------------ Z(t) 2.522 -3.488 -2.886 -2.576 ------------------------------------------------------------------------------ MacKinnon approximate p-value for Z(t) = 0.9991
------------------------------------------------------------------------------ D.gdp | Coef. Std. Err. t P>|t| [95% C.I.]
-------------+---------------------------------------------------------------- gdp | L1. | .0042481 .0016844 2.52 0.013 .0009215 .0075747 LD. | .6108358 .0796368 7.67 0.000 .4535609 .7681107 L2D. | -.252599 .0937671 -2.69 0.008 -.4377799 -.0674181 L3D. | -.0636636 .0946053 -0.67 0.502 -.2504998 .1231726 L4D. | -.0395037 .080826 -0.49 0.626 -.1991272 .1201197
| _cons | 4.58e+09 1.94e+09 2.36 0.020 7.45e+08 8.41e+09
------------------------------------------------------------------------------
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Random Walk Testing Stationarity Unit Root Test: Dickey Fuller Test Order of Integration Stata Example
Stata Example: ADF test
Using our quarterly GDP data, the estimated model is
∆ ˆGDP t = 4.58e+09 +0.004︸ ︷︷ ︸ (ρ−1)
GDPt−1 +0.61∆GDPt−1 − 0.25∆GDPt−2︸ ︷︷ ︸ Augmented part for OV bias
....
The coefficient on GDPt−1 is 0.004 = ρ− 1 and the t statistic 2.52 is the ADF tau statistic.
ADF = τstat = 2.52
and the ADF statistic is greater than all the critical values, we do not reject the null and conclude that the data is not stationary.
Copyright 2019 Chan EC395
Stata Example: test again with the growth rate of GDP . gen dlog_gdp=100*ln(gdp/gdp[_n-1]) (1 missing value generated)
. dfuller dlog_gdp, lags(4) regress Augmented Dickey-Fuller test for unit root No. of obs = 165
---------- Interpolated Dickey-Fuller --------- Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value ------------------------------------------------------------------------------ Z(t) -3.955 -3.488 -2.886 -2.576 ------------------------------------------------------------------------------ MacKinnon approximate p-value for Z(t) = 0.0017 ------------------------------------------------------------------------------
D.dlog_gdp | Coef. Std. Err. t P>|t| [95% C.l.] -------------+---------------------------------------------------------------- dlog_gdp |
L1. | -.3326026 .0841022 -3.95 0.000 -.4987041 -.1665011 LD. | .034283 .0924786 0.37 0.711 -.148362 .2169279
L2D. | -.1264248 .0874793 -1.45 0.150 -.2991961 .0463465 L3D. | -.0910831 .0772524 -1.18 0.240 -.2436563 .06149 L4D. | -.1595163 .074254 -2.15 0.033 -.3061677 -.0128649 _cons | .4547839 .140292 3.24 0.001 .1777077 .7318601 ------------------------------------------------------------------------------
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Random Walk Testing Stationarity Unit Root Test: Dickey Fuller Test Order of Integration Stata Example
Stata Example: ADF test
Using the growth rate of quarterly GDP data, the estimated model is
∆ ˆGDP∗t = .454− .332︸︷︷︸ (ρ−1)
GDP∗t−1 + .034∆GDP ∗ t−1 − 0.126∆GDP∗t−2︸ ︷︷ ︸
Augmented part for OV bias
....
The coefficient on GDPt−1 is -.332 = ρ− 1 and the t statistic -3.95 is the ADF tau statistic.
ADF = τstat = −3.95
Since the ADF statistic is less than all the critical values, we reject the null and conclude that the growth rate is stationary.
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Time Series Model with Stationary Data Cointegration
Stata Example: ADF test
Spurious Regression:
GDPt︸ ︷︷ ︸ I(1)
= γ0 + γ1 Tbillt︸ ︷︷ ︸ I(1)
+γ2 CADt︸ ︷︷ ︸ I(1)
+ut
All three variables are non-stationary and require the first difference transformation. Correct Specification with Stationary Data:
∆%GDPt︸ ︷︷ ︸ I(0)
= β0 + β1 ∆Tbillt︸ ︷︷ ︸ I(0)
+β2 ∆%CADt︸ ︷︷ ︸ I(0)
+vt
The data can be transformed by first difference or first log difference. ADF tests must be used to confirm stationarity for all series.
Copyright 2019 Chan EC395
Cointegration 1 As a general rule nonstationary time series variables
should not be used in regression models, in order to avoid the problem of spurious regression.
2 There is an exception to this rule. If yt and xt are nonstationary I(1) variables, then we would expect that their difference, or any linear combination of them, such as et = yt − γ0 − γ1xt , to be I(1) as well.
3 However there are important cases when et = yt − γ0 − γ1xt is a stationary I(0) process. In this case yt and xt are said to be cointegrated.
4 Cointegration implies that yt and xt share similar stochastic trends, and in fact since their difference et is stationary, they never diverge too far from each other.
5 The cointegrated variables yt and xt exhibit a long term equilibrium relationship defined by yt = γ0 + γ1xt , and et is the equilibrium error, which represents short term deviations from the long-term relationship.
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Time Series Model with Stationary Data
Stata Example: ADF test
Spurious Regression:
GDPt︸ ︷︷ ︸ I(1)
= γ0 + gamma1 Tbillt︸ ︷︷ ︸ I(1)
+gamma2 CADt︸ ︷︷ ︸ I(1)
+ ut︸︷︷︸ I(1)
If the residuals ût is non stationary, the model is spurious. Cointegration (Long-Run Relationship among GDP, Treasure Bill, and Canadian Dollar FX rate if :
GDPt︸ ︷︷ ︸ I(1)
= γ0 + gamma1 Tbillt︸ ︷︷ ︸ I(1)
+gamma2 CADt︸ ︷︷ ︸ I(1)
+ ut︸︷︷︸ I(0)
If the residuals ût is stationary, the three variables are cointegrated with a long-run equilibrium relationship.
Copyright 2019 Chan EC395
Cointegration between Consumption and Income
Cointegration among Wealth, Consumption, and Income
Ludvigson (2006) studies the wealth effect on consumption function. The results are spurious because all three variables are integrated of order one I(1).
ln(Consumptiont ) = γ0 + γ1ln(Incomet ) + γ2ln(Wealtht ) + vt
. reg ln_consumption ln_income ln_wealth
Source | SS df MS No. of obs = 263 -------------+---------------------------------- F(2, 260) = 65364.97
Model | 48.3157864 2 24.1578932 Prob > F = 0.0000 Residual | .096092017 260 .000369585 R-square = 0.9980
-------------+---------------------------------- Adj R-squared= 0.9980 Total | 48.4118784 262 .184778162 Root MSE = .01922
------------------------------------------------------------------------------ ln_consump˜n | Coef. Std. Err. t P>|t| [95% C.I.] -------------+---------------------------------------------------------------- ln_income | .7851506 .0147856 53.10 0.000 .7560 .8142653 ln_wealth | .2463438 .0131945 18.67 0.000 .2203 .2723256
_cons | -.6093355 .0313206 -19.45 0.000 -.6710 -.5476612 ------------------------------------------------------------------------------ . predict v,resid
Testing Cointegration To test cointegration, simply use the ADF test on the residuals of the models with nonstationary data. The ADF equation is
∆v̂t = −.086vt−1 . dfuller v, regress noconstant Dickey-Fuller test for unit root Number of obs = 262
---------- Interpolated Dickey-Fuller --------- Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value ------------------------------------------------------------------------------ Z(t) -3.414 -2.580 -1.950 -1.620
------------------------------------------------------------------------------ D.v | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- v |
L1. | -.0862093 .0252548 -3.41 0.001 -.1359384 -.0364803 ------------------------------------------------------------------------------
Since the tau statistic -3.414 is less than all critical values, we can reject the null and conclude that the residuals are stationary or the variables are cointegrated.
Error Correction Model (ECM)
If the data are non-stationary, but not cointegrated. The correct specification is the first differenced form.
∆%Consumptiont = β0 + β1∆%Incomet + β2∆%Wealtht + ut
If the data are non-stationary, but cointegrated. The correct specification is the Error Correction Model (ECM).
∆%Consumptiont︸ ︷︷ ︸ I(0)
= β0 + α ECTt−1︸ ︷︷ ︸ I(0)
+β1 ∆%Incomet︸ ︷︷ ︸ I(0)
+
β2 ∆%Wealtht︸ ︷︷ ︸ I(0)
+ut
where the error correction term (ECTt−1) is defined by
ECTt−1 = ln(Consumptiont−1)− γ0 − γ1ln(Incomet−1)− γ2ln(Wealtht−1)
Error Correction Model (ECM): Interpretation The Error Correction Model (ECM):
∆%Consumptiont︸ ︷︷ ︸ I(0)
= β0 + α ECTt−1︸ ︷︷ ︸ I(0)
+β1 ∆%Incomet︸ ︷︷ ︸ I(0)
+
β2 ∆%Wealtht︸ ︷︷ ︸ I(0)
+ut
ECTt−1︸ ︷︷ ︸ I(0)
= ln(Consumptiont−1)︸ ︷︷ ︸ I(1)
−γ0 − γ1 ln(Incomet−1)︸ ︷︷ ︸ I(1)
−
γ2 ln(Wealtht−1)︸ ︷︷ ︸ I(1)
1 where βi are the short-run coefficients; 2 α is the speed of adjustment and it must be negative for the
ECM to be consistent; 3 γi are the long-run equilibrium parameters.
Error Correction Model (ECM): Example
The non-stationary long-run model:
. reg ln_consumption ln_income ln_wealth
Source | SS df MS No of obs = 263 -------------+---------------------------------- F(2, 260) = 65364.97
Model | 48.3157864 2 24.1578932 Prob > F = 0.0000 Residual | .096092017 260 .000369585 R-squared = 0.9980
-------------+---------------------------------- Adj R-squared= 0.9980 Total | 48.4118784 262 .184778162 Root MSE = .01922
------------------------------------------------------------------------------ ln_consump˜n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------
ln_income | .7851506 .0147856 53.10 0.000 .756 .8142653 ln_wealth | .2463438 .0131945 18.67 0.000 .220 .2723256
_cons | -.6093355 .0313206 -19.45 0.000 -.671 -.5476612 ------------------------------------------------------------------------------ . predict ect,resid
Error Correction Model (ECM): Example The Error Correction Model (ECM) . reg D.ln_consumption L.ect D.ln_income D.wealth
Source | SS df MS No of obs = 262 -------------+---------------------------------- F(3, 258) = 35.29
Model | .003750395 3 .001250132 Prob > F = 0.0000 Residual | .009139504 258 .000035424 R-squared =0.2910
-------------+---------------------------------- Adj R-squared =0.2827 Total | .012889899 261 .000049387 Root MSE = .00595
------------------------------------------------------------------------------ D. | ln_cons˜n | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+----------------------------------------------------------------
ect | L1. | -.0518837 .019322 -2.69 0.008 -.089 -.0138348
| ln_income |
D1. | .3743477 .0416803 8.98 0.000 .292 .4564245 |
wealth | D1. | 4.95e-07 1.28e-07 3.88 0.000 2.44e-07 7.46e-07
| _cons | .003071 .0004333 7.09 0.000 .002 .0039241
------------------------------------------------------------------------------
Error Correction Model (ECM): Example The Error Correction Model (ECM):
ˆ∆%Consumptiont = .003− .051ECTt−1 + .374∆%Incomet + (4.95e− 07)∆%Wealtht
ˆECTt−1 = ln(Consumptiont−1) + .609− .785ln(Incomet−1)− −.246ln(Wealtht−1)
or
ˆln(Consumptiont ) = −.609+ .785ln(Incomet )+ .246ln(Wealtht )
1 α = −.051 is the speed of adjustment. 2 When actual consumption is below the expected
consumption by 1% last quarter, consumption this quarter will decrease by 0.051% to adjust back to equilibrium.
Error Correction Model (ECM): Numerical Example
The Error Correction Model (ECM):
ˆ∆%Consumptiont = .003− .051ECTt−1 + .374∆%Incomet + (4.95e− 07)∆%Wealtht
ˆECTt−1 = ln(Consumptiont−1) + .609− .785ln(Incomet−1)− −.246ln(Wealtht−1)
ˆln(Consumptiont ) = −.609+ .785ln(Incomet )+ .246ln(Wealtht )
1 If ln(Income2018Q1) = 10, ln(Wealth2018Q1) = 8, the economy is at equilibrium if ln(Consumption2018Q1) = 9.209.
ˆln(Consumt ) = −.609 + .785ln(Incomet ) + .246ln(Wealtht ) ˆln(Consumt ) = −.609 + .785 ∗ (10) + .246 ∗ (8) = 9.209
Error Correction Model (ECM): Dis-Equilibrium
1 If ln(Consumptiont ) = 7 in 2018Q1, consumption is below equilibrium level and the dis-equilibrium measured by the error correction term
2 ECT2018Q1 = Actual - Equilibrium 3 Dis-equilibrium = 7 - 9.209 = -2.209. 4 Based on on the Error Correction Model, the economy will
adjust in the second quarter (2018Q2) to adjust back to equilibrium
ˆ∆%Consumptiont = .003− .051ECTt−1 + ...... ˆ∆%Consumption2018Q2 = .003− .051ECT2018Q1 + ...... ˆ∆%Consumption2018Q2 = .003− .051(−2.209) + ......
]item Positive change for consumption in 2018Q2.
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Error Correction Model (ECM) Error Correction Model (ECM): Interpretation Error Correction Model (ECM): Example
Error Correction Model (ECM): Example
The Error Correction Model (ECM): 1 It is important to remember that the long run relationship
may not link all variables in the model. For example, it is possible to have cointegration without wealth.
ˆ∆%Consumptiont = β0 + β1ECTt−1 + β2∆%Incomet + β3∆%Wealtht + ut
ˆECTt−1 = ln(Consumptiont−1)− γ0 − γ1ln(Incomet−1)
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Error Correction Model (ECM) Error Correction Model (ECM): Interpretation Error Correction Model (ECM): Example
Error Correction Model (ECM) with two cointegrating vectors
The Error Correction Model (ECM) with two cointegrating vectors:
1 There may be more than one long run relationship. For k endogenous variables, at most, you can have k-1 cointegrating vectors.
ˆ∆%Consumptiont = β0 + β1ECT1t−1 + β4ECT2t−1 + β2∆%Incomet + β3∆%Wealtht + ut
ˆECT1t−1 = ln(Consumptiont−1)− γ0 − γ1ln(Incomet−1) ˆECT2t−1 = ln(Incomet−1)− γ2 − γ3ln(Wealtht−1)
Copyright 2019 Chan EC395
Outline Stationary
Unit Root test (Augmented Dickey Fuller) Test Cointegration Cointegration
Error Correction Model (ECM) Error Correction Model (ECM):Summary
Error Correction Model (ECM): Summary
1 Check stationary of your data using unit root tests; otherwise spurious regression
2 Transform variables to obtain stationary data 3 Check Cointegration with non-stationary model 4 If cointegrated, the best model is Error Correction Model.
Copyright 2019 Chan EC395
- Outline
- Main Talk
- Outline
- Stationary
- Stationary
- Stationarity: Graphical Interpretation
- Unit Root test (Augmented Dickey Fuller) Test
- Random Walk
- Testing Stationarity
- Unit Root Test: Dickey Fuller Test
- Order of Integration
- Stata Example
- Cointegration
- Time Series Model with Stationary Data
- Cointegration
- Cointegration
- Time Series Model with Stationary Data
- Error Correction Model (ECM)
- Error Correction Model (ECM)
- Error Correction Model (ECM): Interpretation
- Error Correction Model (ECM): Example
- Error Correction Model (ECM): Summary
EC395 ����ʱ��21��24��/�μ�/EC395_Heteroskedasticity_L4.pdf
Outline
EC395 Applied Econometrics
SECTION II Heteroskedastcity1
1Lazaridis School of Business and Economics Wilfrid Laurier University
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Outline
Definition
Identification: Goldfeld Quandt, White, and LM tests
Consequences
Solution: Feasible Generalized Least Square (FGLS) and Weighted Least Square (WLS)
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Definition
Heteroskedasticity
Heteroskedasticity occurs when the variance of the error terms differ across observations.
We have so far assumed that the variance of the errors is constant,Var(ut) = σ2. This is known as homoscedasticity.
If the errors do not have a constant variance, we say that they are heteroscedastic e.g. say we estimate a regression and calculate the residuals.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Definition
Heteroskedasticity: Examples
If we gathered data on the income and consumption of a large number of countries, those with high levels of income may have a greater dispersion in food expenditures than those at lower income levels
With high incomes, can afford to eat whatever individual tastes dictate With low incomes, everyone forced to eat the cheapest foods
Financial asset return during the financial crisis is more volatile than the pre-crisis periods.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
Approximate Changing Variances
After running the wage equation
Wagei = −24806 + 37.52Experi + 4295.31Edui + ui
The squared residuals can be treated as a proxy for the changing variance
educ wage exper u usquare 12 20400 6 -6846.09 4.69e+07 12 23850 12 -3396.09 1.15e+07 12 22800 12 -4446.09 1.98e+07 12 20700 12 -6546.09 4.29e+07 12 21300 12 -5946.09 3.54e+07 12 24300 12 -2946.09 8679448 12 19650 12 -7596.09 5.77e+07 17 60000 12 11283.63 1.27e+08 15 30300 12 -9828.256 9.66e+07Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
White Test Procedure
Assume that the regression we carried out is as follows
Wagei = −24806 + 37.52Experi + 4295.31Edui + ui
and we want to test Var(ut) = σ2i . We estimate the model, obtaining the residuals ûi .
Construct changing variance as squared residuals Var(ui) = û2i .
Then run the auxiliary regression assuming that at least one of the independent variables is affecting the variances.
û2i = α0 + α1edui + α2edu2i + α3Experi + α4Exper2i + α5Edui ∗ Experi + vi
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
White Test: Null and Alternative Hypotheses
The White test statistic is defined by
White Stat = N ∗ R2 ∼ χ2(m)
The statistic is χ2 distributed with m degree of freedom where m is the number of independent variables in the auxiliary equation.
The null hypothesis H0 : α1 = α2 = α3 = α4 = α5 = 0 is that we have constant variance
Var(ui) = σ2
or û2i = α0 + vi
The Alternative is that at least one of the variables is significantly different from zero.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
White Test: Example
ˆWagei = −24806 + 37.52Experi + 4295.31Edui . reg wage edu exper
Source | SS df MS Number of obs = 403 -------------+---------------------------------- F(2, 400) = 191.27
Model | 5.7071e+10 2 2.8536e+10 Prob > F = 0.0000 Residual | 5.9675e+10 400 149188425 R-squared = 0.4888
-------------+---------------------------------- Adj R-squared = 0.4863 Total | 1.1675e+11 402 290414382 Root MSE = 12214
------------------------------------------------------------------------------ wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- educ | 4295.31 219.8589 19.54 0.000 3863.087 4727.534
exper | 37.52013 348.3807 0.11 0.914 -647.3659 722.4061 _cons | -24806.84 5758.138 -4.31 0.000 -36126.84 -13486.85
------------------------------------------------------------------------------
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
White Test: Example I
ˆWagei = −24806 + 37.52Experi + 4295.31Edui . reg wage edu exper
Source | SS df MS Number of obs = 403 -------------+---------------------------------- F(2, 400) = 191.27
Model | 5.7071e+10 2 2.8536e+10 Prob > F = 0.0000 Residual | 5.9675e+10 400 149188425 R-squared = 0.4888
-------------+---------------------------------- Adj R-squared = 0.4863 Total | 1.1675e+11 402 290414382 Root MSE = 12214
------------------------------------------------------------------------------ wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- educ | 4295.31 219.8589 19.54 0.000 3863.087 4727.534
exper | 37.52013 348.3807 0.11 0.914 -647.3659 722.4061 _cons | -24806.84 5758.138 -4.31 0.000 -36126.84 -13486.85
------------------------------------------------------------------------------
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
White Test: Example II
White stat = N ∗ R2 = 403 ∗ 0.0746 = 30.06 . reg usq educ exper educsq expersq edu_exper
Source | SS df MS Number of obs = 403 -------------+---------------------------------- F(5, 397) = 6.40
Model | 4.2985e+18 5 8.5970e+17 Prob > F = 0.0000 Residual | 5.3333e+19 397 1.3434e+17 R-squared = 0.0746
-------------+---------------------------------- Adj R-squared = 0.0629 Total | 5.7631e+19 402 1.4336e+17 Root MSE = 3.7e+08
------------------------------------------------------------------------------ usq | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- educ | -1.22e+08 7.50e+07 -1.63 0.105 -2.69e+08 2.55e+07
exper | -2.48e+08 1.33e+08 -1.87 0.063 -5.09e+08 1.31e+07 educsq | 5489607 1780822 3.08 0.002 1988586 8990628
expersq | 9075341 4551368 1.99 0.047 127545.8 1.80e+07 edu_exper | -27118.3 3823351 -0.01 0.994 -7543665 7489428
_cons | 2.41e+09 1.15e+09 2.11 0.036 1.60e+08 4.67e+09 ------------------------------------------------------------------------------
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
White Test: Example III
H0 : Var(ui) = σ2 H1 : Var(ui) = σ2i The White test statistic is defined by
White stat = N ∗ R2 = 403 ∗ 0.0746 = 30.06
The statistic is χ2 distributed with 5 degree of freedom so
. display invchi2tail(5,0.05) 11.070498
Critical Value = 11.07
Since the White stat is greater than the critical value, we conclude that the variance is changing across observations.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
Stata Commands
The idea is that we use all possible combinations of independent variables to check constant variance.
reg wage edu exper <-- Step 1 gen educsq=educˆ2 gen expersq=experˆ2 gen edu_exper=educ*exper predict u,resid <-- Step 2 gen usq=uˆ2 <-- Step 2 reg usq educ exper educsq expersq edu_exper display e(N)*e(r2) <-- Step 3 display invchi2tail(5,0.05)
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
Breusch-Pagan-Godfrey (BPG) Test
The Breusch-Pagan-Godfrey (BPG) test is very similar to the White test except for the part that you get to use the variables in the auxiliary regression. Therefore we follow the same steps Assume that the regression we carried out is as follows
Wagei = −24806 + 37.52Experi + 4295.31Edui + ui and we want to test Var(ut) = σ2i . We estimate the model, obtaining the residuals ûi .
Construct changing variance as squared residuals Var(ui) = û2i .
Then run the auxiliary regression assuming that at least one of the independent variables is affecting the variances.
û2i = α0 + α3Experi + α4Exper2i + vi
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
Breusch-Pagan-Godfrey (BPG) Test
The BPG test statistic is defined by
BPG Stat = N ∗ R2 ∼ χ2(m)
The statistic is χ2 distributed with m degree of freedom where m is the number of independent variables in the auxiliary equation.
The null hypothesis H0 : α3 = α4 = 0 is that we have constant variance
Var(ui) = σ2
or û2i = α0 + vi
The Alternative is that at least one of the variables is significantly different from zero.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
Goldfeld-Quandt Test
The idea is to separate the sample into two groups and then compare the variances of the residuals. The null hypothesis is
H0 : σ21 = σ 2 2 H1 : σ
2 1 > σ
2 2
Step 1: Order observations by rank of X(variable causing heteroskedasticity) from small to largest.
Step 2: Omit ”c” central observations from data set to define two sub-sample
Step 3: Estimate with each sub-sample to get SSR1 and SSR2.
Step 4: The GQ statistic is defined by
GQ stat = SSR1/(N1 − k) SSR2/(N2 − k)
= σ̂21 σ̂22 ∼ F (N1 − k ,N2 − k)
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
GQ test: Example The idea is that we use all possible combinations of independent variables to check constant variance. Step 1 is to obtain σ21 and σ
2 2 from the two samples.
. reg wage educ exper if id<=200
Source | SS df MS Number of obs = 200 -------------+---------------------------------- F(2, 197) = 87.90
Model | 2.8046e+10 2 1.4023e+10 Prob > F = 0.0000 Residual | 3.1427e+10 197 159528314 R-squared = 0.4716
-------------+---------------------------------- Adj R-squared = 0.4662 Total | 5.9473e+10 199 298860543 Root MSE = 12630
------------------------------------------------------------------------------ wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- educ | 4357.76 329.1741 13.24 0.000 3708.603 5006.917
exper | 118.4399 447.9831 0.26 0.792 -765.0182 1001.898 _cons | -26625.08 8161.857 -3.26 0.001 -42720.91 -10529.25
------------------------------------------------------------------------------
. scalar sigmasq1=3.1427e+10/(200-3)
σ21 is 1.59e+8. Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
GQ test: Example II The idea is that we use all possible combinations of independent variables to check constant variance. Step 1 is to obtain σ21 and σ
2 2 from the two samples.
. reg wage educ exper if id>=300
Source | SS df MS Number of obs = 104 -------------+---------------------------------- F(2, 101) = 52.42
Model | 1.5735e+10 2 7.8676e+09 Prob > F = 0.0000 Residual | 1.5159e+10 101 150091182 R-squared = 0.5093
-------------+---------------------------------- Adj R-squared = 0.4996 Total | 3.0894e+10 103 299945476 Root MSE = 12251
------------------------------------------------------------------------------ wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- educ | 3997.021 435.3116 9.18 0.000 3133.48 4860.562
exper | -3789.261 1852.58 -2.05 0.043 -7464.281 -114.2418 _cons | 24474.98 24376.23 1.00 0.318 -23880.9 72830.87
------------------------------------------------------------------------------
. scalar sigmasq2=1.5159e+10/(104-3)
σ22 is 1.50e+8. Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
White Test White Test Procedure Breusch-Pagan-Godfrey (BPG) Test Goldfeld-Quandt Test
GQ Test: Example III
The null hypothesis is
H0 : σ21 = σ 2 2 H1 : σ
2 1 > σ
2 2
The GQ statistic is defined by
GQ stat = SSR1/(N1 − k) SSR2/(N2 − k)
= 1.59e + 08 1.50e + 08
= 1.062 ∼ F (197,101)
. display invFtail(200-3,104-3,0.05) 1.3409742
Critical Value = 1.34 Since the GQ stat is smaller than the critical value, we do not reject the null and conclude that the two samples have the same variance.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Consequences of Heteroskedasticity
It is not efficient with heteroskedasticity because the formula differ from the one from Gauss Markov Theorem.
Var(β̂) = Var [∑
(Xi−X i )ui∑ (Xi−X i )2
] =
∑[ (Xi−X i )∑ (Xi−X i )2
]2 Var(ui)
Without (A2): Heteroskedasticity With (A2): Homoskedasticity
Var(β̂) = ∑[ (Xi − X i)∑
(Xi − X i)2
]2 σ2i Var(β̂) =
σ2∑ (Xi − X i)2
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Consequences of Heteroscedasticity
Consequences of Using OLS in the Presence of Heteroscedasticity
OLS estimation still gives unbiased coefficient estimates, but they are no longer BLUE.
This implies that if we still use OLS in the presence of heteroscedasticity, our standard errors could be inappropriate and hence any inferences we make could be misleading.
Whether the standard errors calculated using the usual formulae are too big or too small will depend upon the form of the heteroscedasticity.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
Generalized Least Squares (GLS)
If the form (i.e. the cause) of the heteroscedasticity is known, then we can use an estimation method which takes this into account (called Generalised Least Squares, GLS).
wagei = β0 + β1edui + β2experi + ui A simple illustration of GLS is as follows: Suppose that the error variance is related to another variable incomei by
Var(ui) = σ2income2i To remove the heteroscedasticity, divide the regression equation by incomei wagei
incomei = β0
1 incomei
+β1 educi
incomei +β2
experi incomei
+ ui
incomei Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
How to obtain constant Variance
A few simple examples to understand the concept of variance. EX1 : Var(X ) = 5;Var(3X ) = 32Var(X ) = 9 ∗ Var(X ) = 45
EX2 : Var(X ) = σ2 constant variance
σ2 is unknown, but not changing. If the variance depends on income, it means that the variance is changing for different level of income. If changing variance looks like this
Var(X ) = σ2income2i The only solution is to divide your variable by a scaling factor to get rid of income.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
How to obtain constant Variance II
If changing variance looks like this
Var(X ) = σ2income2i
Var (
X incomei
) =
1 income2i
Var(X ) = σ2
The only solution is to divide your variable by a scaling factor to get rid of income. If you are estimating consumption function and your believe consumption variations depend on population. Per Capita income IncomePopulation and Per Capita Consumption
Consumption Population
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
Generalized Least Squares (GLS)
GLS Model
wagei incomei
= β0 1
incomei +β1
educi incomei
+β2 experi
incomei +
ui incomei
This model has constant variance for the error term, so OLS is BLUE again.
Var (
ui incomei
) =
Var(ui) income2i
= σ2income2i income2i
= σ2
The error term of the GLS model will have a constant variance
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
Heteroscedasticity in Multiplicative Form
If the form (i.e. the cause) of the heteroscedasticity is multiplicative but the power is unknown, we can GLS.
Var(ui) = σ2incomeδi
To remove the heteroscedasticity, divide the regression equation by incomei
wagei√ incomeδi
= β0 1√
incomeδi +β1
educi√ incomeδi
+β2 experi√ incomeδi
+ ui√
incomeδi
The question is how to get δ.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
Heteroscedasticity in Multiplicative Form II
GLS in Multiplicative form OLS the orignal model to get residuals. ûi Run the following regression to get δ̂
ln(û2i ) = lnσ 2 + δln(incomei)
Estimate GLS;
wagei√ incomeδ̂i
= β0 1√
incomeδ̂i +β1
educi√ incomeδ̂i
+β2 experi√ incomeδ̂i
+ ui√
incomeδ̂i
The estimated β will be consistent and asymptotically efficient.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
Heteroscedasticity in Additive Form
If the form (i.e. the cause) of the heteroscedasticity is additive (or linear).
Var(ui) = α1 + α2incomei
To remove the heteroscedasticity, divide the regression equation by incomei
wagei√ α1 + α2incomei
= β0 1√
α1+α2 incomei + β1
educi√ α1+α2 incomei
+
β2 experi√
α1+α2 incomei +
ui√ α1+α2 incomei
The question is how to get unknown parameters α1 and α2.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
Heteroscedasticity in Additive Form II
GLS in Additive form OLS the orignal model to get residuals. ûi Run the following regression to get α1 and α2.
û2i = α1 + α2incomei
Estimate GLS; wagei√
α̂1 + α̂2incomei = β0
1√ α̂1+α̂2 incomei
+ β1 educi√
α̂1+α̂2 incomei +
β2 experi√
α̂1+α̂2 incomei +
ui√ α̂1+α̂2 incomei
The estimated β will be consistent and asymptotically efficient.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
Heteroscedasticity: Summary
To fix the problem of changing variance, you can either assume a specific functional form or use het consistent standard errors. If the form is known, use GLS. GLS : wageiincomei If not, assume multiplicative or additive forms and estimate the FGLS
FGLS(M) : wagei√ incomeδ̂i
FGLS(A) : wagei√
α1 + α2incomei
The estimated coefficients will be consistent and asymptotically efficient.
Copyright 2019 Chan EC395
Outline Heteroskedastcity
Dectection of Heteroskedastcity Consequences of Heteroskedasticity
Generalized Least Squares (GLS)
Generalized Least Squares (GLS) Heteroscedasticity in Multiplicative Form Heteroscedasticity in Multiplicative Form II Heteroscedasticity in Additive Form Heteroscedasticity in Additive Form II Heteroscedasticity: Summary Heteroscedasticity: Summary
Heteroscedasticity: Summary
GLS assume
Var(wagei) = σ2income2i GLS : wagei
incomei FGLS multiplicative form
Var(wagei) = σ2incomeδ̂i FGLS(M) : wagei√ incomeδ̂i
FGLS: Additive form
Var(wagei) = α1+α2incomei FGLS(A) : wagei√
α̂1 + α̂2incomei The estimated coefficients will be consistent and asymptotically efficient.
Copyright 2019 Chan EC395
- Outline
- Main Talk
- Outline
- Heteroskedasticity
- Definition
- Detection of Heteroskedasticity
- White Test
- White Test Procedure
- Breusch-Pagan-Godfrey (BPG) Test
- Goldfeld-Quandt Test
- Consequences of Heteroskedasticity
- Generalized Least Squares (GLS)
- Generalized Least Squares (GLS)
- Heteroscedasticity in Multiplicative Form
- Heteroscedasticity in Multiplicative Form II
- Heteroscedasticity in Additive Form
- Heteroscedasticity in Additive Form II
- Heteroscedasticity: Summary
- Heteroscedasticity: Summary
EC395 ����ʱ��21��24��/�μ�/EC395_Instrumental_Variable_IV_Estimation_L6.pdf
Outline
EC395 Applied Econometrics
SECTION IV Instrumental Variable (IV) Estimation1
1Lazaridis School of Business and Economics Wilfrid Laurier University
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Outline
1 Definition: Stochastic Regressors
2 Identification: Hausman Test, J Test
3 Consequences
4 Solution: Instrumental Variable (IV) Estimation
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Definition Cause: Omitted Variable Bias Cause: Measurement Errors Cause: Simultaneous-equations bias (Endogeneity bias)
OLS Assumptions
OLS is Best Linear Unbiased Estimator (BLUE) if the following is true.
1 E(ut) = 0
2 Var(ut) = σ2 No heteroskedasticity
3 Cov(ui ,uj) = 0 ∀ i 6= j No autocorrelation 4 Cov(Xt ,ut) = 0 No stochastic regressors
5 ut ∼ N(0, σ2) Error terms are normally distributed
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Definition Cause: Omitted Variable Bias Cause: Measurement Errors Cause: Simultaneous-equations bias (Endogeneity bias)
Stochastic Regressors
1 In regression analysis, we assume that the independent variables have fixed values or given, so the forecasting equation will simply be
BTCt = α+ β S&P500t︸ ︷︷ ︸ fixed regressor Xt
+ut
Given the return of the market this time period t, we can accurately forecast the current price of bitcoin.
2 Assumption (A4) assumes no stochastic (random) regressors in the equation meaning your independent variables and error term are not correlated Cov(Xt ,ut) = 0.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Definition Cause: Omitted Variable Bias Cause: Measurement Errors Cause: Simultaneous-equations bias (Endogeneity bias)
Definiton: Stochastic Regressors
The independent variables are stochastic regressors, if they are correlated with the error terms. Cov(Xt ,ut) 6= 0 With stochastic regressors, OLS is biased and inconsistent. Stochastic regressors may be caused by
1 Omitted Variable Bias 2 Measurement Errors 3 Simultaneous-equations bias (Endogeneity bias)
Copyright 2019 Chan EC395
Cause: Omitted Variable Bias
1 True Model : GDPt = β0 + β1Tbillt + β2CADt + vt 2 GDP depends on both Treasury bill rate and the Canadian dollar
exchange rate.
3 If you omitted the Canada dollar exchange rate (or any relevant variable) on the right hand side, your Stata model will look like
GDPt = β0 + β2 Tbillt︸ ︷︷ ︸ Xt
+ ut︸︷︷︸ β2CADt+vt
4 Your mis-specified model will include the Canadian dollar in the error term and it will be correlated with the mis-specified error term. Cov(Xt ,ut) = Cov(Tbillt ,ut) 6= 0 if Cov(Tbillt ,CADt) 6= 0.
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Definition Cause: Omitted Variable Bias Cause: Measurement Errors Cause: Simultaneous-equations bias (Endogeneity bias)
Cause: Omitted Variable Bias II
1 Coefficient on the independent variable Xt will pick up the effects of the parts of error terms ut that are correlated with it in addition to the direct effects of Xt
β̂1 = β1 + Cov(Tbillt ,ut)
Var(Tbillt)
2 Direction of bias depends on sign of correlation between Xt and ut
3 This is exactly analogous to omitted-variables bias example in Section III Autocorrelation.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Definition Cause: Omitted Variable Bias Cause: Measurement Errors Cause: Simultaneous-equations bias (Endogeneity bias)
Causes: Measurement Errors
1 Suppose that the dependent variable is measured accurately but that we measure with error.
True Model : Test Scoret = β0+β1FIt+ut where FI = family income
But FI∗t︸︷︷︸
from survey
= FIt︸︷︷︸ actual family income
+ mt︸︷︷︸ measurement errors
2 The estimated Stata model is Test Scoret = β0 + β1FI∗t + et 3 because mt is part of et and therefore correlated with it, the
composite error term et is now correlated with the actual regressor, meaning that β1 is biased and inconsistent.
Copyright 2019 Chan EC395
Causes: Measurement Errors II
True Model : Test Scoret = β0 + β1FIt + ut
If instead you replace the true family income with the one containing measurement errors
Test Scoret = β0 + β1(FI∗t −mt) + ut Test Scoret = β0 + β1FI∗t + ut − β1mt︸ ︷︷ ︸
residuals in Stata êt
Stata Model : Test Scoret = β0 + β1FI∗t + et
Since both FI∗t and et contain measurement errors, Cov(FI∗t ,et) 6= 0 and we have stochastic regressors.
FI∗t = FIt + mt and et = ut − β1mt
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Definition Cause: Omitted Variable Bias Cause: Measurement Errors Cause: Simultaneous-equations bias (Endogeneity bias)
Causes: Simultaneous-equations bias (Endogeneity bias)
1 Suppose that quantity and prices are part of a larger theoretical system of equations:
Qt = β0 + β1Pricet + ut Pricet = β3 + β4Qt + vt
2 The two variables are jointly determined and both are endogenous. There is ”feedback” from price to quantity Q, or ”reverse causality” (actually bi-directional)
3 ut → Qt → Pricet , so ut and Pricet are correlated 4 Supply and demand curves are difficult to estimate because
both Q and Price are endogenous.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Consequences of Stochastic Regressors
Consequences of Using OLS in the Presence of Stochastic Regressors
1 OLS estimation still be biased and they are no longer BLUE.
2 The bias depends on the nature of the stochastic regressors.
3 Omitted variable bias, the same directional rules apply.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
The IV Estimator
1 The IV Estimator with a Single Regressor and a Single Instrument:
GDPt = β0 + β1 Tbillt︸ ︷︷ ︸ Xt
+ut
2 IV regression breaks Xt into two parts: a part that might be correlated with u, and a part that is not. By isolating the part that is not correlated with u, it is possible to estimate β1.
3 This is done using an instrumental variable, Zt , which is correlated with Xt but uncorrelated with ut .
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Terminology: Endogeneity and Exogeneity
1 An endogenous variable is one that is correlated with u 2 An exogenous variable is one that is uncorrelated with u 3 In IV regression, we focus on the case that X is
endogenous and there is an instrument, Z, which is exogenous.
4 Digression on terminology: ”Endogenous” literally means ”determined within the system.” If X is jointly determined with Y, then a regression of Y on X is subject to simultaneous causality bias. But this definition of endogeneity is too narrow because IV regression can be used to address OV bias and errors-in-variable bias. Thus we use the broader definition of endogeneity above.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Two Conditions for a Valid Instrument
1 The model: GDPt = β0 + β1 Tbillt︸ ︷︷ ︸
Xt
+ut
2 For an instrumental variable (an ”instrument”) Z to be valid, it must satisfy two conditions:
1 Instrument relevance: corr(Zt ,Tbillt) 6= 0 2 Instrument exogeneity: corr(Zt ,ut) = 0
3 Suppose for now that you have such a Zt (we’ll discuss how to find instrumental variables later). How can you use Zt to estimate β1?
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
The IV Estimator: Two Stage Least Square (TSLS)
1 Explanation #1: Two Stage Least Squares (TSLS) As it sounds, TSLS has two stages – two regressions:
1 Stage 1: Isolate the part of X that is uncorrelated with u by regressing X on Z using OLS:
Xt = π0 + π1Zt + vt
2 Because Zt is uncorrelated with ut , π0 + π1Zt is uncorrelated with ut . We don’t know π0 or π1 but we have estimated them, so ...
3 Compute the predicted values of Xt , , where X̂t = π̂0 + π̂1Zt , t = 1,....,n
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
The IV Estimator: Two Stage Least Square (TSLS)
1 Stage 2: Replace Xt by X̂t in the regression of interest: regress Y on X̂t using OLS:
Yt = β0 + β1X̂t + ut
2 Because X̂t is uncorrelated with ut , the first least squares assumption holds for regression (2). (This requires n to be large so that π0 and π1 are precisely estimated.)
3 Thus, in large samples, β1 can be estimated by OLS using regression (2) The resulting estimator is called the Two Stage Least Squares (TSLS) estimator, β̂TSLS
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
The IV Estimator: Two Stage Least Square (TSLS)
1 Suppose Zt , satisfies the two conditions for a valid instrument:
1 Instrument relevance: corr(Zt ,Xt) 6= 0 2 Instrument exogeneity: corr(Zt ,ut) = 0
2 Two-stage least squares: 1 Stage 1: Regress Xt on Zt (including an intercept), obtain
the X̂t predicted values 2 Stage 2: Regress Yt on X̂t (including an intercept); the
coefficient on X̂t is the TSLS estimator, β̂TSLS. 3 β̂TSLS is a consistent estimator of β1.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
The IV Estimator, one X and one Z, ctd. 1 Explanation #2: A direct algebraic derivation
Yt = β0 + β1Xt + ut
Thus,
Cov(Yt ,Zt) = Cov(Yt = β0 + β1Xt + ut ,Zt) = Cov(β0,Zt) + Cov(β1Xt ,Zt) + Cov(ut ,Zt) = 0 + Cov(β1Xt ,Zt) + 0 = β1Cov(Xt ,Zt)
where Cov(ut ,Zt) = 0 by instrument exogeneity; thus
β̂1 = Cov(Yt ,Zt) Cov(Xt ,Zt)
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
The IV Estimator, one X and one Z, ctd.
1 Explanation #2: A direct algebraic derivation
β̂1 = Cov(Yt ,Zt) Cov(Xt ,Zt)
The IV estimator replaces these population covariances with sample covariances:
β̂TSLS1 = sYZ sXZ
sYZ and sXZ are the sample covariances. This is the TSLS estimator– just a different derivation!
Copyright 2019 Chan EC395
The IV Estimator, one X and one Z, ctd.
1 Explanation #3: Derivation from the ”reduced form” The ”reduced form” relates Y to Z and X to Z:
Xt = π0 + π1Zt + vt Yt = γ0 + γ1Zt + wt
where wt is an error term. Because Z is exogenous, Z is uncorrelated with both vt and wt .
2 The idea: A unit change in Zt results in a change in Xt of π1 and a change in Yt of γ1.
3 Because that change in Xt arises from the exogenous change in Zt , that change in Xt is exogenous.
4 Thus an exogenous change in Xt of π1 units is associated with a change in Yt of γ1 units –
5 so the effect on Y of an exogenous change in X is β1 = γ1/π1 units.
The IV estimator from the reduced form, ctd.
1 The math: The ”reduced form” relates Y to Z and X to Z:
Xt = π0 + π1Zt + vt Yt = γ0 + γ1Zt + wt
Solve the X equation for Z:
Zt = −π0/π1 + (1/π1)Xt − (1/π1)vt
Substitute this into the Y equation and collect terms:
Yt = γ0 + γ1Zt + wt = γ0 + γ1[−π0/π1 + (1/π1)Xt − (1/π1)vt ] + wt = [γ0 − π0γ1/π1] + (γ1/π1)Xt + [wt − (γ1/π1)vt ] = β0 + β1Xt + ut
where β0 = γ0 − π0γ1/π1, β1 = γ1/π1, and ut = wt − (γ1/π1)vt .
The IV estimator from the reduced form, ctd.
1 The math: The ”reduced form” relates Y to Z and X to Z:
Xt = π0 + π1Zt + vt Yt = γ0 + γ1Zt + wt
where Yt = β0 + β1Xt + ut
where β1 = γ1/π1
Interpretation: An exogenous change in Xt of π1 units is associated with a change in Yt of γ1 units – so the effect on Y of an exogenous unit change in X is β1 = γ1/π1.
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Hausman Test
1 Step 1: OLS X on a constant and the instruments Z’s to get the predicted value X̂
2 Step 2: OLS Y on X and X̂ and test whether or not the coefficient on X̂ is significantly different from zero.
3 If X̂ is not significant, stochastic regressor is rejected. 4 The idea is very simple, X̂ picks up the variations in X that
are driven by the instruments Z.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Example No.1 Effect of Studying on Grades
1 What is the effect on grades of studying for an additional hour per day? Yt = β0 + β1Xt + ut
Y = GPA X = study time (hours per day)
2 Data: grades and study hours of college freshmen. 3 Would you expect the OLS estimator of β1 (the effect on
GPA of studying an extra hour per day) to be unbiased? Why or why not?
Copyright 2019 Chan EC395
Example No.1 Effect of Studying on Grades II
1 Stinebrickner, Ralph and Stinebrickner, Todd R. (2008) ”The Causal Effect of Studying on Academic Performance,” The B.E. Journal of Economic Analysis & Policy: Vol. 8: Iss. 1 (Frontiers), Article 14. n = 210 freshman at Berea College in 2001 Y = first-semester GPA X = average study hours per day (survey) Roommates were randomly assigned Z = 1 if roommate brought video game
= 0 otherwise
2 Do you think Zt (whether a roommate brought a video game) is a valid instrument?
3 Is it relevant (correlated with X)? 4 Is it exogenous (uncorrelated with u)?
Example No.1 Effect of Studying on Grades II
1 In reduced form:
Xt = π0 + π1Zt + vt Yt = γ0 + γ1Zt + wt
Y = GPA (4 point scale) X = time spent studying (hours per day) Z = 1 if roommate brought video game, = 0 otherwise
2 Stinebrinckner and Stinebrinckner’s findings
π̂1 = −0.668 γ̂1 = −0.241 β̂IV1 = γ̂1 π̂1
= −0.241 −0.668
= 0.360
3 What are the units? Do these estimates make sense in a real-world way? (Note: They actually ran the regressions including additional regressors – more on this later.)
Example #2: Supply and demand for butter
1 IV regression was first developed to estimate demand elasticities for agricultural goods, for example, butter:
ln(QButtert ) = β0 + β1ln(P Butter t ) + ut
β1= price elasticity of butter = percent change in quantity for a 1% change in price (recall log-log specification discussion) Data: observations on price and quantity of butter for different years The OLS regression of ln(QButtert ) on ln(PButtert ) suffers from simultaneous causality bias (why?)
Example #2: Supply and demand for butter II
1 Simultaneous causality bias in the OLS regression ofln(QButtert ) on ln(P
Butter t ) arises because price and
quantity are determined by the interaction of demand and supply:
Example #2: Supply and demand for butter III
1 This interaction of demand and supply produces data like ...
Would a regression using these data produce the demand curve?
Example #2: Supply and demand for butter IV
1 But ... what would you get if only supply shifted?
2 TSLS estimates the demand curve by isolating shifts in price and quantity that arise from shifts in supply.
3 The instrument Z is a variable that shifts supply but not demand.
TSLS in the supply-demand example:
1 IV regression was first developed to estimate demand elasticities for agricultural goods, for example, butter:
ln(QButtert ) = β0 + β1ln(P Butter t ) + ut
2 Let Z = rainfall in dairy-producing regions. Is Z a valid instrument?
1 Relevant? corr(raint , ln(PButtert )) 6=0? Plausibly: insufficient rainfall means less grazing means less butter means higher prices
2 Exogenous? corr(raint ,ut ) = 0? Plausibly: whether it rains in dairy-producing regions shouldn’t affect demand for butter
TSLS in the supply-demand example:
1 The model
ln(QButtert ) = β0 + β1ln(P Butter t ) + ut
2 Zt = raint = rainfall in dairy-producing regions. 1 Stage 1: regress ln( PButtert ) on rain, get ln(P̂
Butter t )
ln(P̂Buttert ) isolates changes in log price that arise from supply (part of supply, at least)
2 Stage 2: regress ln( QButtert ) on ln(P Butter t ) The regression
counterpart of using shifts in the supply curve to trace out the demand curve.
Example #3: Test scores and class size
1 The California test score/class size regressions still could have OV bias (e.g. parental involvement). In principle, this bias can be eliminated by IV regression (TSLS). IV regression requires a valid instrument, that is, an instrument that is:
1 relevant: corr(Zi ,STRi ) 6= 0 2 exogenous: corr(Zi ,ui ) = 0
Example #3: Test scores and class size II
1 Here is a (hypothetical) instrument: some districts, randomly hit by an earthquake, ”double up” classrooms: Zi = Quakei = 1 if hit by quake, = 0 otherwise
2 Do the two conditions for a valid instrument hold? 3 The earthquake makes it as if the districts were in a
random assignment experiment. Thus, the variation in STR arising from the earthquake is exogenous.
4 The first stage of TSLS regresses STR against Quake, thereby isolating the part of STR that is exogenous (the part that is ”as if” randomly assigned)
Inference using TSLS
1 In large samples, the sampling distribution of the TSLS estimator is normal
2 Inference (hypothesis tests, confidence intervals) proceeds in the usual way, e.g. +/- 1.96SE
3 The idea behind the large-sample normal distribution of the TSLS estimator is that – like all the other estimators we have considered – it involves an average of mean zero i.i.d. random variables, to which we can apply the CLT.
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Inference using TSLS
1 β̂TSLS1 is approx. distributed N(β1, σ 2 TSLS ), Statistical
inference proceeds in the usual way. 2 The justification is (as usual) based on large samples 3 This all assumes that the instruments are valid – we’ll
discuss what happens if they aren’t valid shortly. Important note on standard errors:
4 The OLS standard errors from the second stage regression aren’t right – they don’t take into account the estimation in the first stage ( X̂t is estimated).
5 Instead, use a single specialized command that computes the TSLS estimator and the correct SEs. As usual, use heteroskedasticity-robust SEs
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Stata Example: IV Estimator
1 Example #4: Demand for Cigarettes
ln(Qcigarettest ) = β0 + β1ln(P cigarettes t ) + ut
2 Why is the OLS estimator of β1 likely to be biased? Data set: Panel data on annual cigarette consumption and average prices paid (including tax), by state, for the 48 continental US states, 1985-1995.
3 Proposed instrumental variable: 4 Zi = general sales tax per pack in the state = SalesTaxi Do
you think this instrument is plausibly valid? 5 1 Relevant? corr(SalesTaxi , ln(P
cigarettes t )) 6= 0?
2 Exogenous? corr(SalesTaxi ,ui ) = 0?
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Stata Example: Cigarette demand, ctd. 1 Example #4: Demand for Cigarettes
For now, use data from 1995 only. First stage OLS regression:
ln(P̂cigarettest ) = 4.63 + 0.031SalesTaxt ,n = 48
Second stage OLS regression:
ln(Q̂cigarettest ) = 9.72− 1.08ln(P̂ cigarettes t ),n = 48
Combined TSLS regression with correct, heteroskedasticity-robust standard errors:
ln(Q̂cigarettest ) = 9.72− 1.08ln(P̂ cigarettes t ),n = 48
(1.53) (0.32) Copyright 2019 Chan EC395
Stata Example: Cigarette demand, ctd. STATA Example: Cigarette demand, First stage: Instrument = Z = rtaxso = general sales tax (real $/pack)
Stage 1 regression
Stata Example: Cigarette demand, ctd. Second Stage
Stata Example: Cigarette demand, ctd. Estimated cigarette demand equation:
ln(Q̂cigarettest ) = 9.72− 1.08ln(P̂ cigarettes t ),n = 48
(1.53) (0.32)
Combined into a single command:
Stage 2 regression with corrected standard errors
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
The General IV Regression Model(SW Section 12.2)
1 So far we have considered IV regression with a single endogenous regressor (X) and a single instrument (Z). We need to extend this to:
2 multiple endogenous regressors (X1, ..,Xk ) 3 multiple included exogenous variables (W1, ...,Wr ) or
control variables, which need to be included for the usual OV reason
4 multiple instrumental variables (Z1, ...,Zm). More (relevant) instruments can produce a smaller variance of TSLS: the R2 of the first stage increases, so you have more variation in X̂t .
5 New terminology: identification & overidentification Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Identification
1 In general, a parameter is said to be identified if different values of the parameter produce different distributions of the data.
2 In IV regression, whether the coefficients are identified depends on the relation between the number of instruments (m) and the number of endogenous regressors (k)
3 Intuitively, if there are fewer instruments than endogenous regressors, we can’t estimate β1, ..., βk For example, suppose k = 1 but m = 0 (no instruments)!
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Identification II
The coefficients β1, ..., βk are said to be: 1 exactly identified if m = k. There are just enough
instruments to estimate β1, ..., βk . 2 overidentified if m > k. There are more than enough
instruments to estimate β1, ..., βk . If so, you can test whether the instruments are valid (a test of the ”overidentifying restrictions”) – we’ll return to this later
3 underidentified if m < k. There are too few instruments to estimate β1, ..., βk . If so, you need to get more instruments!
Copyright 2019 Chan EC395
The General IV Regression Model: Summary of Jargon
Yi = β0 + β1X1i + ...+ βkXki + βk+1W1i + ...+ βk+r Wrri + ui 1 Yi is the dependent variable 2 X1i , ...,Xki are the endogenous regressors (potentially
correlated with ui ) 3 W1i , ...,Wri are the included exogenous regressors
(uncorrelated with ui ) or control variables (included so that Zi is uncorrelated with ui , once the W’s are included)
4 β0, β1, ..., βk+r are the unknown regression coefficients 5 Z1i , ...,Zmi are the m instrumental variables (the
excluded exogenous variables) 6 The coefficients are overidentified if m>k; exactly
identified if m = k; and underidentified if m < k.
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Example #4: Demand for cigarettes, ctd.
Suppose income is exogenous (this is plausible – why?), and we also want to estimate the income elasticity:
ln(Qcigarettest ) = β0 + β1ln(P cigarettes t ) + β2ln(Incomet) + ut
We actually have two instruments: 1 Z1i = general sales taxi 2 Z2i = cigarette-specific taxi 1 Endogenous variable: ln(Pcigarettest ) (”one X”) 2 Included exogenous variable: ln(Incomei ) (”one W”) 3 Instruments (excluded endogenous variables): general
sales tax, cigarette-specific tax (”two Zs”) 4 Is β1 over–, under–, or exactly identified?
Copyright 2019 Chan EC395
Example: Cigarette demand, one instrument
Example: Cigarette demand, two instrument
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Example #4: Demand for cigarettes, ctd.
TSLS estimates, Z = sales tax (m = 1)
ln(Q̂cigarettest ) = 9.43− 1.14ln(P cigarettes t ) + 0.21ln(Incomet) + ut
(1.26) (0.37) (0.31)
TSLS estimates, Z = sales tax & cig-only tax (m = 2)
ln(Q̂cigarettest ) = 9.89− 1.28ln(P cigarettes t ) + 0.28ln(Incomet) + ut
(0.96) (0.25) (0.25)
Smaller SEs for m = 2. Using 2 instruments gives more information – more ”as-if random variation.” Low income elasticity (not a luxury good); Surprisingly high price elasticity
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Checking Instrument Validity
Recall the two requirements for valid instruments: 1 Relevance (special case of one X) At least one instrument
must enter the population counterpart of the first stage regression.
2 Exogeneity All the instruments must be uncorrelated with the error term: corr(Z1i ,ui) = 0, ..., corr(Zmi ,ui) = 0
What happens if one of these requirements isn’t satisfied? How can you check? What do you do? If you have multiple instruments, which should you use?
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Checking Assumption #1: Instrument Relevance
We will focus on a single included endogenous regressor:
Yi = β0 + β1Xi + β2W1i + ...+ β1+r Wri + ui
First stage regression:
Xi = π0 + π1Z1i + ...+ πmZmi + πm+1W1i + ...+ πm+kWki + ui
1 The instruments are relevant if at least one of π1, ..., πm are nonzero.
2 The instruments are said to be weak if all the π1, ..., πm are either zero or nearly zero. Weak instruments explain very little of the variation in X, beyond that explained by the W’s
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
If instruments are weak, the sampling distribution of TSLS and its t-statistic are not (at all) normal, even with n large. Consider the simplest case:
Yi = β0 + β1Xi + ui Xi = π0 + π1Zi + ui
The IV estimator is β̂TSLS1 = sYZ sXZ
. 1 If cov(X,Z) is zero or small, then sXZ will be small: With
weak instruments, the denominator is nearly zero. 2 If so, the sampling distribution of β̂TSLS1 (and its t-statistic) is
not well approximated by its large-n normal approximation
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Measuring the Strength of Instruments
Measuring the Strength of Instruments in Practice: The First-Stage F-statistic
1 The first stage regression (one X): 2 Regress X on Z1, ...,Zm,W1, ...,Wk . 3 Totally irrelevant instruments −−− > all the coefficients
on Z1, ...,Zm are zero. 4 The first-stage F-statistic tests the hypothesis that
Z1, ...,Zm do not enter the first stage regression. Weak instruments imply a small first stage F-statistic.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Measuring the Strength of Instruments
Measuring the Strength of Instruments in Practice: The First-Stage F-statistic
1 Compute the first-stage F-statistic. 2 Rule-of-thumb: If the first stage F-statistic is less than
10, then the set of instruments is weak. If so, the TSLS estimator will be biased, and statistical inferences (standard errors, hypothesis tests, confidence intervals) can be misleading.
Why compare the first-stage F to 10? Simply rejecting the null hypothesis that the coefficients on the Z’s are zero isn’t enough – you need substantial predictive content for the normal approximation to be a good one.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
What to do if you have weak instruments
1 Get better instruments (often easier said than done!) 2 If you have many instruments, some are probably weaker
than others and it’s a good idea to drop the weaker ones (dropping an irrelevant instrument will increase the first-stage F)
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Checking Assumption #2: Instrument Exogeneity
1 Instrument exogeneity: All the instruments are uncorrelated with the error term: corr(Z1i ,ui) = 0, ..., corr(Zmi ,ui) = 0 If the instruments are correlated with the error term, the first stage of TSLS cannot isolate a component of X that is uncorrelated with the error term, so X̂ is correlated with u and TSLS is inconsistent. If there are more instruments than endogenous regressors, it is possible to test - partially – for instrument exogeneity.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Testing Overidentifying Restrictions
Consider the simplest case:
Yi = β0 + β1Xi + ui ,
1 Suppose there are two valid instruments: Z1i ,Z2i Then you could compute two separate TSLS estimates.
2 Intuitively, if these 2 TSLS estimates are very different from each other, then something must be wrong: one or the other (or both) of the instruments must be invalid.
3 The J-test of overidentifying restrictions makes this comparison in a statistically precise way. This can only be done if #Z’s > #X’s (overidentified).
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Testing Overidentifying Restrictions
Suppose #instruments = m > # X’s = k (overidentified)
Yi = β0 + β1X1i + ...+ βkXki + βk+1W1i + ...+ βk+r Wri + ui ,
The recipe: 1 First estimate the equation of interest using TSLS and all
m instruments; compute the predicted values Ŷ , using the actual X’s (not the X̂ ′s used to estimate the second stage)
2 Compute the residuals ûi = Yi − Ŷi 3 Regress residuals against Z1i , ...,Zmi ,W1i , ...Wri 4 Compute the F-statistic testing the hypothesis that the
coefficients on Z1i , ...,Zmi are all zero; The J-statistic is
J = mF ∼ χ2(m − k)
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Two Conditions for a Valid Instrument Hausman Test Stata Example: IV Estimator The General IV Regression Model Identification Checking Instrument Validity The J-test of Overidentifying Restrictions
Distribution of the J-statistic
Distribution of the J-statistic 1 Under the null hypothesis that all the instruments are
exogeneous, J has a chi-squared distribution with m-k degrees of freedom
2 If m = k, J = 0 (m= number of instrument; k = number of independent variables)
3 If some instruments are exogenous and others are endogenous, the J statistic will be large, and the null hypothesis that all instruments are exogenous will be rejected.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Checking Instrument Validity: Summary
1. Relevance 1 This summary considers the case of a single X. The two
requirements for valid instruments are: 2 At least one instrument must enter the population
counterpart of the first stage regression. If instruments are weak, then the TSLS estimator is biased and the and t-statistic has a non-normal distribution
3 To check for weak instruments with a single included endogenous regressor, check the first-stage F
4 If F>10, instruments are strong – use TSLS 5 If F<10, weak instruments – take some action.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Checking Instrument Validity: Summary
2. Exogeneity 1 All the instruments must be uncorrelated with the error
term: corr(Z1i ,ui) = 0, ..., corr(Zmi ,ui) = 0 2 We can partially test for exogeneity: if m>1, we can test
the null hypothesis that all the instruments are exogenous, against the alternative that as many as m-1 are endogenous (correlated with u)
3 The test is the J-test, which is constructed using the TSLS residuals.
4 If the J-test rejects, then at least some of your instruments are endogenous – so you must make a difficult decision and jettison some (or all) of your instruments.
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Application to the Demand for Cigarettes
1 Why are we interested in knowing the elasticity of demand for cigarettes?
2 Theory of optimal taxation. The optimal tax rate is inversely related to the price elasticity: the greater the elasticity, the less quantity is affected by a given percentage tax, so the smaller is the change in consumption and deadweight loss.
3 Externalities of smoking – role for government intervention to discourage smoking
4 health effects of second-hand smoke? (non-monetary) 5 monetary externalities
Copyright 2019 Chan EC395
Example: Cigarette demand, two instrument Use TSLS to estimate the demand elasticity by using the ”10-year changes”specification
Example: Cigarette demand, two instrument 2 Check instrument relevance: compute first-stage F
Example: Cigarette demand, two instrument 3
First-stage F – both instruments
Example: Cigarette demand, two instrument 4 Cigarette demand, 10 year changes – 2 IVs
Example: Cigarette demand, two instrument 5 Test the overidentifying restrictions
Example: Cigarette demand, two instrument 6
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Application to the Demand for Cigarettes
1 J-test rejects the null hypothesis that both the instruments are exogenous
2 This means that either rtaxso is endogenous, or rtax is endogenous, or both!
3 The J-test doesn’t tell us which! You must exercise judgment...
4 Why might rtax (cig-only tax) be endogenous? Political forces: history of smoking or lots of smokers ( political pressure for low cigarette taxes)
5 If so, cig-only tax is endogenous 6 This reasoning doesn’t apply to general sales tax 7 use just one instrument, the general sales tax
Copyright 2019 Chan EC395
Example: Cigarette demand, Summary
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Application to the Demand for Cigarettes
1 Use the estimated elasticity based on TSLS with the general sales tax as the only instrument:
2 Elasticity = -.94, SE = .21 3 This elasticity is surprisingly large (not inelastic) –a 1%
increase in prices reduces cigarette sales by nearly 1%. This is much more elastic than conventional wisdom in the health economics literature.
4 This is a long-run (ten-year change) elasticity. What would you expect a short-run (one-year change) elasticity to be –more or less elastic?
Copyright 2019 Chan EC395
Outline Stochastic Regressors
Consequences of Stochastic Regressors Instrumental Variable (IV) Estimation
Checking Instrument Validity: Summary Stochastic Regressors: Summary
Stochastic Regressors: Summary
1 OLS estimator is biased. 2 The best solution is Instrumental Variable (IV) Estimation. 3 It can be caused by omitted variable bias, measurement
errors, or endogeneity bias. 4 Two Stage Least Square(TSLS) is consistent estimator.
Copyright 2019 Chan EC395
- Outline
- Main Talk
- Outline
- Stochastic Regressors
- Definition
- Cause: Omitted Variable Bias
- Cause: Measurement Errors
- Cause: Simultaneous-equations bias (Endogeneity bias)
- Consequences of Stochastic Regressors
- Instrumental Variable (IV) Estimation
- Two Conditions for a Valid Instrument
- Hausman Test
- Stata Example: IV Estimator
- The General IV Regression Model
- Identification
- Checking Instrument Validity
- The J-test of Overidentifying Restrictions
- Checking Instrument Validity: Summary
- Stochastic Regressors: Summary
EC395 ����ʱ��21��24��/�μ�/EC395_Introduction_L1 (1).pdf
Outline
EC395 Applied Econometrics
Wing Hong Chan1
1Lazaridis School of Business and Economics Wilfrid Laurier University
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Information Objectives assessment
Information
Dr. Wing Chan Office: LH3082 Office Hours: Mon and Wed 1:00 pm - 2:30 pm Time and Location: EC395 C Mon and Wed 11:30 pm - 12:50 pm LH3101 EC395 D Tue and Thu 11:30 pm - 12:50 pm LH3101
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Information Objectives assessment
Objectives
To introduce students to panel data analysis for business economics and finance To develop an understanding of econometric methods for quantitative modeling and empirical analysis To familiarize students with the source and compilation of economic and financial data for empirical analysis To enable students to use statistical and econometric software packages for empirical analysis.
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Information Objectives assessment
Assessment
Weights Assignments 10% Midterm Exam (Feb 29) 20% Final Exam 40% (2-hour exam) Labs 5% Term Paper 30%
Midterm & Final Exam Practice Questions (50% take home) One two-sided hand-written cheat sheet; A non-programmable calculator
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Textbooks
Textbooks
Online Lecture Notes Gujarati, Damodar (G) Basic Econometrics, 4th Edition (Optional) Stock, James H. and M. Watson. (SW) Introduction to Econometrics, Updated 3rd Edition (Optional, Remember to Optout on MLS if you prefer other books) Wooldridge, Jeffrey. (W) Introductory Econometrics: A Modern Approach, 5th Edition (Optional)
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Format Software Group Policy
Term Paper Guideline I
Format 10-15 pages double spaced not including graphs and outputs in the appendix. Any topic related to Economics & Business (ECONLIT, SSRN) Data Sources:
Economics Data→ Datastream (2nd Floor Library) Financial Data→ Bloomberg
Due on the last day of class Use Checklist before submission Sample papers on MyLS
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Format Software Group Policy
Term Paper Guideline II
Software You may use any software package, but must submit a program file to duplicate results Your submission on MyLS must include MSWord file, program file, excel data file, output file, and pdf files for all cited references. Term paper program file will be posted after the midterm. You need to modify the program for your dataset and models.
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Format Software Group Policy
Term Paper Guideline III
Study Group Policy Students may work individually or in groups of two (but no more than two) on empirical paper. It is expected that all students will actively participate in both data analysis and the write-up efforts. Only one copy of a collaborative piece of work should be submitted with all names attached.
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Regression Analysis OLS Estimator Hypothesis Testing
Regression Analysis
Marginal Effect: If housing price increases by 1%, GDP growth will increase by 0.274%
Source | SS df MS Number of obs = 150 -------------+---------------------------------- F(2, 147) = 18.43
Model | 37.4224841 2 18.7112421 Prob > F = 0.0000 Residual | 149.279458 147 1.01550652 R-squared = 0.2004
-------------+---------------------------------- Adj R-squared = 0.1896 Total | 186.701942 149 1.25303317 Root MSE = 1.0077
------------------------------------------------------------------------------ gdp_growth | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- d_tbill | .3351379 .1140343 2.94 0.004 .1097794 .5604963 hprice | .2746228 .0700172 3.92 0.000 .1362524 .4129932 _cons | 1.109224 .0970093 11.43 0.000 .9175111 1.300937
------------------------------------------------------------------------------
Interpretation and Validity
ˆGDP t = 1.109 + 0.335 ˆTBill t + 0.274 ˆHPricet
Objective: Marginal Effect = ∆GDPt∆HPricet = 0.274 (Reliable?)
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Regression Analysis OLS Estimator Hypothesis Testing
OLS Estimator
OLS Estimator
Slope = β̂ = Cov(GDPt ,HPricet )Var(HPricet ) = 0.274
Standard Error of OLS Estimator s.e.(β̂) =
√ σ2∑
(HPricet−HPrice)2 = 0.070
Variance of Error Term = σ̂2 = ∑
û2t n−k =
Goodness of Fit: R2 =
∑ ( ˆGDP t−GDP)2∑ (GDPt−GDP)2
= 1− ∑
û2t∑ (GDPt−GDP)2
= ESSTSS = 1− RSS TSS
Adj-R2 = R 2 = 1− (1− R2)
( n−1 n−k
)
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Regression Analysis OLS Estimator Hypothesis Testing
Hypothesis Testing
Single Hypothesis: t Test
State the null and alternative hypotheses with degree of freedom
Write down test statistic: formula and value t = (β̂−β0)
σ̂/ √∑
(HPricet−HPrice)2 ∼ t(n − k)
Make conclusion with critical or p values
Mutliple Hypothesis: F Test
State the null and alternative hypotheses with degree of freedom
Write down test statistic: formula and value F = (RSSR−RSSUR)/qSSRUR/(n−k) ∼ F (q,n − k)
Make conclusion with critical or p values
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Regression Analysis OLS Estimator Hypothesis Testing
Unbiasedness, Efficiency, and Consistency
Gauss Markov Theorem
Given certain assumptions, OLS estimator is
Unbiased→ β̂ = Cov(GDPt ,HPricet )Var(HPricet ) = 0.274 on average equal to the true value Efficient→ β̂ has the smallest variance among all linear estimators Consistent→ β̂ converges to the true value with large sample
Copyright 2019 Chan EC395
Introduction Texbooks & Lecture Notes
Term Paper Review
Regression Analysis OLS Estimator Hypothesis Testing
Assumptions for Unbiasedness, Efficiency, and Consistency
Assumptions Forecasting Equation GDP t = 1.109+0.335 ˆTBill t+0.274 ˆHPricet+ût = ˆGDP t+ût (A1) No error on average (A2) No Heterskedasticity: constant variance of error terms (A3) No Autocorrelation: errors are not related over time. (A4) No stochastic regressor: Omitted variables in error terms do not affect the regressors. (A5) Errors are normally distributed (A6) Independent variable has finite constant variance
Copyright 2019 Chan EC395
- Outline
- Main Talk
- Introduction
- Information
- Objectives
- Assessment
- Texbooks & Lecture Notes
- Textbooks
- Term Paper
- Format
- Software
- Group Policy
- Review
- Regression Analysis
- OLS Estimator
- Hypothesis Testing
EC395 ����ʱ��21��24��/�μ�/EC395_Review_Hypothesis_Testing_L3.pdf
Outline
EC395 Applied Econometrics
SECTION I Review of Hypothesis Testing and Stata1
1Lazaridis School of Business and Economics Wilfrid Laurier University
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Outline
Individual Hypothesis : t test
Multiple hypotheses: F test
Testing equality of variances: F test
Testing Normality: χ2 test
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Hypothesis Testing: OLS Estimator
OLS Estimator and t test
Model GDPi = α+ βHPricei + µi
OLS Estimator = β̂ = Cov(GDPt ,HPricet )Var(HPricet )
Precision of Estimator Standard Error of OLS Estimator s.e.(β̂) =
√ σ2∑
(HPricet−HPrice)2
The t test statistic for the hypothesis on the true β is given by
t = β̂ − β√
σ2
/ ∑
((HPricet−HPrice)2
Copyright 2019 Chan EC395
Example: Cigarette Smoking
Applications to Models of Cigarette Smoking Behavior A data.frame with 807 observations on 10 variables:
cigsi = β0+β1cigprici+β2incomei+β3educi+β4agei+β5age2i +ui
educ: years of schooling cigpric: state cig. price, cents/pack white: =1 if white age: in years income: annual income, $ cigs: cigs. smoked per day restaurn: =1 if rest. smk. restrictions lincome: log(income) agesq: ageˆ2 lcigpric: log(cigprice)
Example: Cigarette Smoking
. reg cigs cigpric income edu age agesq
Source | SS df MS Number of obs = 807 -------------+---------------------------------- F(5, 801) = 7.43
Model | 6727.35668 5 1345.47134 Prob > F = 0.0000 Residual | 145026.326 801 181.056587 R-squared = 0.0443
-------------+---------------------------------- Adj R-squared = 0.0384 Total | 151753.683 806 188.280003 Root MSE = 13.456
------------------------------------------------------------------------------ cigs | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- cigpric | -.0345002 .1002163 -0.34 0.731 -.2312179 .1622175 income | .0000413 .0000569 0.73 0.468 -.0000704 .000153
educ | -.504037 .1686589 -2.99 0.003 -.8351027 -.1729714 age | .7960472 .1598379 4.98 0.000 .4822966 1.109798
agesq | -.0092707 .0017415 -5.32 0.000 -.0126891 -.0058522 _cons | 1.877739 6.872869 0.27 0.785 -11.61322 15.3687
------------------------------------------------------------------------------
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Hypothesis Testing: OLS Estimator
Estimated Equation
ˆcigsi = 1.87− 0.034cigprici + 0.001incomei − 0.504educi (6.87) (0.10) (0001) (0.168)
+0.796agei − 0.009age2i (0.159) (0.001)
n = 807 R2 = 0.044 RMSE = 13.456
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Statistical Table: t distribution t test: Stata Command t test: invttail and critical value t test: ttail and p-value
[Individual Hypothesis: two-sided t test
Testing the hypothesis that the price effect on cigarette smoking is significantly different from zero.
H0 : β1 = 0 H1 : β1 6= 0
t = β̂1 − 0
s.e.(β̂1) = ∼ t(N − k)
Critical Value = or P-value =
Conclusion
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Statistical Table: t distribution t test: Stata Command t test: invttail and critical value t test: ttail and p-value
Statistical Table: t distribution
STUDENT’S t PERCENTAGE POINTS
ν 60.0% 66.7% 75.0% 80.0% 87.5% 90.0% 95.0% 97.5% 99.0% 99.5% 99.9%
1 0.325 0.577 1.000 1.376 2.414 3.078 6.314 12.706 31.821 63.657 318.31 2 0.289 0.500 0.816 1.061 1.604 1.886 2.920 4.303 6.965 9.925 22.327 3 0.277 0.476 0.765 0.978 1.423 1.638 2.353 3.182 4.541 5.841 10.215 4 0.271 0.464 0.741 0.941 1.344 1.533 2.132 2.776 3.747 4.604 7.173 5 0.267 0.457 0.727 0.920 1.301 1.476 2.015 2.571 3.365 4.032 5.893 6 0.265 0.453 0.718 0.906 1.273 1.440 1.943 2.447 3.143 3.707 5.208
......... 50 0.255 0.433 0.679 0.849 1.164 1.299 1.676 2.009 2.403 2.678 3.261 55 0.255 0.433 0.679 0.848 1.163 1.297 1.673 2.004 2.396 2.668 3.245 60 0.254 0.433 0.679 0.848 1.162 1.296 1.671 2.000 2.390 2.660 3.232 ∞ 0.253 0.431 0.674 0.842 1.150 1.282 1.645 1.960 2.326 2.576 3.090
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Statistical Table: t distribution t test: Stata Command t test: invttail and critical value t test: ttail and p-value
[Individual Hypothesis: one-sided t test
Testing the hypothesis that the price effect on cigarette smoking is negative.
H0 : β1 = 0 H1 : β1 < 0
t = β̂1 − 0
s.e.(β̂1) = ∼ t(N − k)
Critical Value = or P-value =
Conclusion
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Statistical Table: t distribution t test: Stata Command t test: invttail and critical value t test: ttail and p-value
Stata Command for t test
Stata ”test” command produces only F statistic for hypothesis testing. To produce critical value and p-value, test cigpric=0 ( 1) cigpric = 0
F (1,801) = 0.12
Prob > F = 0.7307
This is two-sided test equivalent to the two-sided t test. The p value indicates that there is 73% change that you will get 0.12 if the null of no impact is true. We conclude that there is no significant price impact.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Statistical Table: t distribution t test: Stata Command t test: invttail and critical value t test: ttail and p-value
Stata Command for t test: invttail and critical value
Critical value (invttail): Use ”invttail” command to obtain the critical value for a one-sided test.
display invttail(807-6,0.05)
1.6467582
The critical value for our hypothesis of negative impact is -1.646.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Statistical Table: t distribution t test: Stata Command t test: invttail and critical value t test: ttail and p-value
Stata Command for t test: ttail and p-value
P-value (ttail): The p value is the probability of getting the t statistic less than and equal to -0.34 if the true value of negative. Using ”ttail” command gives the p value.
display 1-ttail(807,-0.34)
.3669725
There is 36% change of getting -0.34 if the null hypothesis of no price impact is true.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
F test Statistical Table: F distribution Stata Command: F test
Testing Joint Hypotheses
Testing the null hypothesis of no age effect.
H0 : β4 = β5 = 0 H1 : at least of the hypotheses is not true.
F = (SSRR − SSRUR)/q (SSRUR/(N − k)
= ∼ F (q,N − k)
Critical Value = or P-value =
N = k=
Conclusion
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
F test Statistical Table: F distribution Stata Command: F test
Sum of Squared Residuals (SSRR) from the restricted model
. reg cigs cigpric income edu
Source | SS df MS Number of obs = 807 -------------+---------------------------------- F(3, 803) = 2.15
Model | 1210.07593 3 403.358644 Prob > F = 0.0924 Residual | 150543.607 803 187.476472 R-squared = 0.0080
-------------+---------------------------------- Adj R-squared = 0.0043 Total | 151753.683 806 188.280003 Root MSE = 13.692
------------------------------------------------------------------------------ cigs | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- cigpric | -.0372331 .1019117 -0.37 0.715 -.2372779 .1628117 income | .0001182 .000056 2.11 0.035 8.29e-06 .0002282
educ | -.3350103 .1674121 -2.00 0.046 -.6636273 -.0063932 _cons | 12.82677 6.409489 2.00 0.046 .2454342 25.4081
------------------------------------------------------------------------------
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
F test Statistical Table: F distribution Stata Command: F test
Statistical Table: F distribution
PERCENTAGE POINTS OF THE F DISTRIBUTION
ν2\νl 2 3 4 5 6 7 8 10 12 15 20 30 50 ∞ q
100 0.900 2.36 2.14 2.00 1.91 1.83 1.78 1.73 1.66 1.61 1.56 1.49 1.42 1.35 1.21 0.950 3.09 2.70 2.46 2.31 2.19 2.10 2.03 1.93 1.85 1.77 1.68 1.57 1.48 1.28 0.975 3.83 3.25 2.92 2.70 2.54 2.42 2.32 2.18 2.08 1.97 1.85 1.71 1.59 1.35 0.990 4.82 3.98 3.51 3.21 2.99 2.82 2.69 2.50 2.37 2.22 2.07 1.89 1.74 1.43 0.999 7.41 5.86 5.02 4.48 4.11 3.83 3.61 3.30 3.07 2.84 2.59 2.32 2.08 1.62
120 0.900 2.35 2.13 1.99 1.90 1.82 1.77 1.72 1.65 1.60 1.54 1.48 1.41 1.34 1.19 0.950 3.07 2.68 2.45 2.29 2.18 2.09 2.02 1.91 1.83 1.75 1.66 1.55 1.46 1.25 0.975 3.80 3.23 2.89 2.67 2.52 2.39 2.30 2.16 2.05 1.94 1.82 1.69 1.56 1.31 0.990 4.79 3.95 3.48 3.17 2.96 2.79 2.66 2.47 2.34 2.19 2.03 1.86 1.70 1.38 0.999 7.32 5.78 4.95 4.42 4.04 3.77 3.55 3.24 3.02 2.78 2.53 2.26 2.02 1.54
∞ 0.900 2.30 2.08 1.94 1.85 1.77 1.72 1.67 1.60 1.55 1.49 1.42 1.34 1.26 1.00 0.950 3.00 2.60 2.37 2.21 2.10 2.01 1.94 1.83 1.75 1.67 1.57 1.46 1.35 1.00 0.975 3.69 3.12 2.79 2.57 2.41 2.29 2.19 2.05 1.94 1.83 1.71 1.57 1.43 1.00 0.990 4.61 3.78 3.32 3.02 2.80 2.64 2.51 2.32 2.18 2.04 1.88 1.70 1.52 1.00 0.999 6.91 5.42 4.62 4.10 3.74 3.47 3.27 2.96 2.74 2.51 2.27 1.99 1.73 1.00
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
F test Statistical Table: F distribution Stata Command: F test
Stata command: Testing Joint Hypotheses
Testing the null hypothesis of no age effect.
test (age=0) (agesq=0)
F( 2, 801) = 15.24
Prob > F = 0.0000
Conclusion: reject the null of no age effect because the p value is smaller than 0.05.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Testing Equality of Variances: F test F test: Example F test: invFtail and critical value F test: Ftail and p value
Testing Equality of Variances
Testing the null hypothesis of constant variance for high and low income groups. First report the summary statistics for the number of cigarettes smoked per day. sum cigs
Variable | Obs Mean Std. Dev. -------------+-------------------------------------------
cigs | 807 8.686493 13.72152 income | 807 19304.83 9142.958
The reported average income is 19304.83.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Testing Equality of Variances: F test F test: Example F test: invFtail and critical value F test: Ftail and p value
Testing Equality of Variances
Now report the same number for the two groups
. sum cigs if income>19304.83
Variable | Obs Mean Std. Dev. Min Max -------------+-----------------------------------------------------
cigs | 517 9.195358 14.46241 0 80
. sum cigs if income<=19304.83
Variable | Obs Mean Std. Dev. Min Max -------------+-----------------------------------------------------
cigs | 290 7.77931 12.26211 0 50
Do they have the same variance in cigarette consumption?
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Testing Equality of Variances: F test F test: Example F test: invFtail and critical value F test: Ftail and p value
Testing Equality of Variances: F test
F test is defined by a ratio of two variances.
F = χ21/df1 χ22/df2
∼ F (df1,df2)
Examples are F = (SSRR−SSRUR)/q(SSRUR/(N−k) ∼ t(N − k) and
F = Var(Portfolio Return1) Var(Portfolio Return2)
∼ F (N1 − 1,N2 − 1)
F = ∑N1
i=1(R1 − R1) 2/(N1 − 1)∑N2
i=1(R2 − R2)2/(N2 − 1) ∼ F (N1 − 1,N2 − 1)
Remember to put the large variance in the numerator because F is a one-sided test.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Testing Equality of Variances: F test F test: Example F test: invFtail and critical value F test: Ftail and p value
Testing Equality of Variances II
Testing the null hypothesis of constant variance for high and low income groups.
H0 : σ2low income = σ 2 high income H1 : σ
2 low income < σ
2 high income
F = ∑N1
i=1(Rhigh − Rhigh) 2/(N1 − 1)∑N2
i=1(Rlow − R low )2/(N2 − 1) =
14.4622
12.2622 = 1.391 ∼ F (516,289)
df1 = df2 =
Critical Value = p-value =
Conclusion
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Testing Equality of Variances: F test F test: Example F test: invFtail and critical value F test: Ftail and p value
Stata Command for F test: invFtail and critical value
Critical value (invFtail): Use ”invFtail” command to obtain the critical value for F test.
display invFtail(516,289,0.05)
1.1895037
The critical value for our hypothesis of negative impact is 1.1895.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Testing Equality of Variances: F test F test: Example F test: invFtail and critical value F test: Ftail and p value
Stata Command for F test: Ftail and p value
p value (Ftail): Use ”Ftail” command to obtain the p value for F test.
display Ftail(516,289,1.391)
.00093645
The p value for our hypothesis of negative impact is 0.0009. The probability of getting this F value of 1.391 is less than 1%. We can conclude that the variances are not the same for the two groups.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
Testing for Normality
Normal distribution implies a symmetric distribution with no excess kurtosis. The first four moments of a variable are defined by
Mean = X = ∑
X 1i /N
Variance = σ2 = ∑
(Xi − X )2/(N − 1)
Skewness = (1/N)
∑ (Xi − X )3
σ3 (= 0 if normal)
Kurtosis = (1/N)
∑ (Xi − X )4
σ4 (= 3 if normal)
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
Jarque-Bera test
The null hypothesis is normal distribution and the Jarque-Bera test relies on the skewness and kurtosis coefficients. The Jarque-Bera test
Jarque-Bera statistic = (
N 6
) ∗ [ skewness2 +
(kurtosis− 3)2
4
] The statistic has a χ2 distribution with 2 degrees of freedom, (one for skewness one for kurtosis). Normal distribution implies JB statistic ≈ 0.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
Jarque-Bera test: Example
. sum cigs, detail cigs
------------------------------------------------------------- Percentiles Smallest
1% 0 0 5% 0 0 10% 0 0 Obs 807 25% 0 0 Sum of Wgt. 807
50% 0 Mean 8.686493 Largest Std. Dev. 13.72152
75% 20 60 90% 30 60 Variance 188.28 95% 40 60 Skewness 1.651144 99% 60 80 Kurtosis 5.413087
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
Jarque-Bera test: Example II
The null hypothesis is normal distribution. A normal random variable should have zero skewness and excess kurtosis (meaning kurtosis equal to 3).
Construct Jarque-Bera test
Jarque-Bera statistic = (
N 6
) ∗ [ skewness2 +
(kurtosis− 3)2
4
]
JB statistic = [
807 6
] ∗ [ 1.6512 +
(5.413− 3)2
4
] = 562.4
The statistic has a χ2 distribution with 2 degrees of freedom. Since JB>critical value = 5.99, so reject null that cigarette consumption is normally distributed.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
Statistical Table: χ2 Distribution
CHI-SQUARED PERCENTAGE POINTS
ν 60.0% 66.7% 75.0% 80.0% 87.5% 90.0% 95.0% 97.5% 99.0% 99.5% 99.9%
1 0.708 0.936 1.323 1.642 2.354 2.706 3.841 5.024 6.635 7.879 10.828 2 1.833 2.197 2.773 3.219 4.159 4.605 5.991 7.378 9.210 10.597 13.816 3 2.946 3.405 4.108 4.642 5.739 6.251 7.815 9.348 11.345 12.838 16.266 4 4.045 4.579 5.385 5.989 7.214 7.779 9.488 11.143 13.277 14.860 18.467 5 5.132 5.730 6.626 7.289 8.625 9.236 11.070 12.833 15.086 16.750 20.515 6 6.211 6.867 7.841 8.558 9.992 10.645 12.592 14.449 16.812 18.548 22.458 7 7.283 7.992 9.037 9.803 11.326 12.017 14.067 16.013 18.475 20.278 24.322 8 8.351 9.107 10.219 11.030 12.636 13.362 15.507 17.535 20.090 21.955 26.125 9 9.414 10.215 11.389 12.242 13.926 14.684 16.919 19.023 21.666 23.589 27.877
10 10.473 11.317 12.549 13.442 15.198 15.987 18.307 20.483 23.209 25.188 29.588
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
Stata Command: Jarque-Bera test and chi2tail
To get the JB statistic, you need to use the following command
sum cigs, detail display (807/6)*(r(skewness)ˆ2+ ///
((r(kurtosis)-3)ˆ2)/4) 562.48227
The p value can be obtained by
display chi2tail(2,562.48) 7.23e-123
You may also use sktest with small data set.
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
No. of Cigarettes smoked per day is normally distributed? Using the following command to check the histogram of the data
histogram cigs, frequency normal
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
Is log(No. of Cigarettes smoked per day) normally distributed?
gen ln cigs=log(cigs) histogram ln cigs, frequency normal
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
OLS with Log transformation
log(cigsi) = β0+β1cigprici+β2incomei+β3educi+β4agei+β5age2i +ui . reg ln_cigs cigpric income edu age agesq
Source | SS df MS Number of obs = 310 -------------+---------------------------------- F(5, 304) = 4.51
Model | 13.4251515 5 2.68503029 Prob > F = 0.0006 Residual | 181.06391 304 .595604968 R-squared = 0.0690
-------------+---------------------------------- Adj R-squared = 0.0537 Total | 194.489062 309 .62941444 Root MSE = .77175
------------------------------------------------------------------------------ ln_cigs | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------- cigpric | .0039311 .0090014 0.44 0.663 -.0137819 .021644 income | 4.76e-06 5.04e-06 0.94 0.346 -5.17e-06 .0000147
educ | .023358 .0179431 1.30 0.194 -.0119504 .0586664 age | .0605514 .016861 3.59 0.000 .0273724 .0937305
agesq | -.0006392 .0001937 -3.30 0.001 -.0010203 -.0002581 _cons | 1.035584 .6319707 1.64 0.102 -.2080064 2.279175
------------------------------------------------------------------------------
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
Normality of Residuals (A5) To check the validaity of Assumption 5 (A5), you test the normality assumption of OLS residuals
reg cigs cigpric income edu age agesq predict u,residual histogram u, frequency normal
Copyright 2019 Chan EC395
Outline Hypothesis Testing
Individual Hypothesis: t test Multiple Hypotheses: F test
Testing Equality of Variances Testing for Normality
Jarque-Bera test Jarque-Bera test: Example Jarque-Bera test: Example II Statistical Table: χ2 Distribution Stata Command: Jarque-Bera test Normality of Residuals
Normality of Residuals (A5) To check the validaity of Assumption 5 (A5), you test the normality assumption of OLS residuals
reg ln_cigs cigpric income edu age agesq predict u_logmodel,residual histogram u_logmodel, frequency normal
Copyright 2019 Chan EC395
- Outline
- Main Talk
- Outline
- Hypothesis Testing
- Hypothesis Testing: OLS Estimator
- Individual Hypothesis: t test
- Statistical Table: t distribution
- t test: Stata Command
- t test: invttail and critical value
- t test: ttail and p-value
- Multiple Hypotheses: F test
- F test
- Statistical Table: F distribution
- Stata Command: F test
- Testing Equality of Variances
- Testing Equality of Variances: F test
- F test: Example
- F test: invFtail and critical value
- F test: Ftail and p value
- Testing for Normality
- Jarque-Bera test
- Example: JB test
- Jarque-Bera test
- Statistical Table: 2 Distribution
- Stata Command: Jarque-Bera test
- Normality of Residuals
EC395 ����ʱ��21��24��/�μ�/EC395_Review_L2.pdf
Outline
EC395 Applied Econometrics
SECTION I Review of OLS Estimator1
1Lazaridis School of Business and Economics Wilfrid Laurier University
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Performance Metrics
OLS Estimator
Model GDPi = α+ βHPricei + µi OLS minimizes sum of square residuals
S(α̂, β̂) = n∑
i=1
(GDPi − ˆGDP i)2
and the first order condition is ∂S ∂α̂
= 2 ∑
(GDPi − α̂− β̂HPricei)(−1) = 0
∂S ∂β̂
= 2 ∑
(GDPi − α̂− β̂HPricei)(−HPricei) = 0
Slope = β̂ = Cov(GDPt ,HPricet )Var(HPricet ) = 0.274
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Performance Metrics
How to Measure Model Performance
Precision of Estimator Standard Error of OLS Estimator s.e.(β̂) =
√ σ2∑
(HPricet−HPrice)2 = 0.070
leads to confidence interval β within [0.274 +/- 1.96*0.07]
Adjusted average prediction error
Variance of Error Term = σ̂2 = ∑
û2t n−k
Variation of GDP explained Goodness of Fit: R2 = ESSTSS = 1−
RSS TSS
These are sufficient for forecasting, but what about inference? What if the main objective is to test H0 : βHPrice = 0? Robust to specification, omitted variable bias, measurement errors...
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Performance Metrics
Phillips Curve Example
Objective: Study the relationship between unemployment gap and inflation rate Model: Inflationt = α+ β(URt − NAIRU) + ut NAIRU is the non-accelerating inflation rate of unemployment and URt − NAIRU is the unemployment gap. Phillips curve refers to significant negative β. Empirical Analysis: Quarterly data from 1976Q1 to 2010Q1 Rolling Window Estimation: 8-year Windows β̂ and t statistics
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Performance Metrics
Phillips Curve Example II
Model: Inflationt = α+ β(URt − NAIRU) + ut Empirical Analysis: Quarterly data from 1976Q1 to 2010Q1 Rolling Window Estimation: 8-year Windows β̂ and t statistics iteration 1 (1976Q1 to 1983Q4) → β̂1 = −0.0014 and t stat=3.12 iteration 2 (1976Q2 to 1984Q1) → β̂2 = −0.00142 and t stat=3.26 ... iteration 80 (2002Q2 to 2010Q1 → β̂2 = −0.0037 and t stat=1.71
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Performance Metrics
Phillips Curve Example III
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Performance Metrics
Phillips Curve Example IV
Can we conclude that there is no Phillips Curve in Canada between 1976 to 2010? Robustness Tests? Model Specification: Linear or Non-Linear Omitted Variable Bias: Interest Rates Changing Variance: Policy Change Inflation Targeting since 1995 keep total CPI inflation at the 2 per cent midpoint of a target range of 1 to 3 per cent over the medium term.
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Performance Metrics
Inflation Rate in Canada
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Assumptions
OLS Estimator in Stata
OLS Estimator in Stata
Model GDPt = α+ βHPricet + ut
Intercept = α̂ = GDP − β̂HPricet
Slope = β̂ = Cov(GDPt ,HPricet )Var(HPricet )
Standard Error of OLS Estimator s.e.(β̂) = √
σ2∑ (HPricet−HPrice)2
Variance of Error Term = σ̂2 = ∑
û2t n−k
The formulae are valid if the assumptions hold for your data set.
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Assumptions
Unbiasedness, Efficiency, and Consistency
Gauss Markov Theorem
Given certain assumptions, OLS estimator is
Unbiased→ β̂ = Cov(GDPt ,HPricet )Var(HPricet ) = 0.274 on average equal to the true value Efficient→ β̂ has the smallest variance among all linear estimators Consistent→ β̂ converges to the true value with large sample
Gauss Markov Theorem states OLS estimator is the Best Unbiased Linear Estimator (BLUE) given the assumptions.
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
OLS Estimator Assumptions
Assumptions for Unbiasedness, Efficiency, and Consistency
(A1) No error on average E(ut) = 0
(A2) No Heterskedasticity: constant variance of error terms
Var(ut) = σ2
(A3) No Autocorrelation: errors are not related over time.
Cov(ui ,uj) = 0 or E(uiuj) = 0
(A4) No stochastic regressor: Omitted variables in error terms do not affect the regressors. Cov(Xt ,ut) = 0 or E(Xtut) = 0
(A5) Errors are normally distributed
ut ∼ N(0, σ2)
(A6) Independent variable has finite constant varianceCopyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Stochastic Regressor
OLS Estimator has two forms Model GDPt = α+ βHPricet + ut
OLS estimator can be written as
β̂ = Cov(GDPt ,HPricet)
Var(HPricet) (OLS EQ1)
or β̂ = β +
Cov(ut ,HPricet) Var(HPricet)
(OLS EQ2)
where β̂ is the estimator and β is the true value.
Unbiased estimator means the estimator on average equal to the true value
E(β̂) = β OLS estimator is unbiased if (A4) no stochastic regressor Cov(ut ,HPricet) = 0 is true.
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Stochastic Regressor
What is stochastic regressor? True Model GDPt = α+ βHPricet + β2Tbillt + ut True Model GDPt = 0.5 + 0.75HPricet − 0.02Tbillt + ut
You model suffers from omitted variable bias because of omitting interest rate (Tbill) Mis-specified Model GDPt = 0.45 + 2.5HPricet + vt OLS estimator β̂ = 2.5 is biased because the true value is 0.75 and the bias is defined by
β̂ = β + β2 Cov(Tbillt ,HPricet)
Var(HPricet)
2.5 = 0.75− 0.02Cov(Tbillt ,HPricet) Var(HPricet)
(1)
Stochastic regressor refers to independent variable that is affected by omitted variable bias.
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Stochastic Regressor
(A3) No stochastic regressor
True Model GDPt = 0.5 + 0.75HPricet − 0.02Tbillt + ut Mis-specified Model GDPt = 0.45 + 2.5HPricet + vt Since the error term vt includes all missing variables −0.02Tbillt + ut .
No Stochastic regressor refers to Cov(vt ,HPricet) = 0 or Cov(−0.02Tbillt + ut ,HPricet) = 0
Therefore, (A4) No stochastic regressor Cov(HPricet , vt) = 0 for unbiased OLS estimator
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Stochastic Regressor
Example Class size and test score
True Model
Test scoret = 0.25 + 0.05Incomet − 30.0Class sizet + ut
Mis-specified Model
Test scoret = 0.65− 28.0Class sizet + vt
We omit family income because of measurement errors on survey.
Therefore, (A4) No stochastic regressor Cov(Class sizet , vt) = 0 for unbiased OLS estimator
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Variance of OLS estimator
Efficiency of OLS Estimator
OLS Estimator has smallest variance among linear estimators. Model GDPt = α+ βHPricet + ut
The variance of OLS estimator can be written as
Var(β̂) = σ2∑
(HPricet − HPrice)2
This formula is efficient and the proof is provided in the textbook.
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Variance of OLS estimator
Derivation I: Variance of OLS Estimator
Model GDPt = α+ βHPricet + ut
The variance of OLS estimator can be written as
β̂ = β + Cov(ut ,HPricet)
Var(HPricet)
β̂ = β +
∑ ut(HPricet − HPrice)∑ (HPricet − HPrice)2
in summation form
Var(β̂) = Var
[∑ ut(HPricet − HPrice)∑ (HPricet − HPrice)2
] Drop β (it’s a constant)
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Variance of OLS estimator
Derivation II: Variance of OLS Estimator
The variance of OLS estimator can be written as
Var(β̂) = Var
[∑ ut (HPricet − HPrice)∑ (HPricet − HPrice)2
]
Var(β̂) = ∑
Var(ut )
[ (HPricet − HPrice)∑ (HPricet − HPrice)2
]2 +
∑∑ [i][j]Cov(ui , uj )
Var(β̂) = ∑
Var(ut )
[ (HPricet − HPrice)∑ (HPricet − HPrice)2
]2 with (A3)Cov(ui , uj ) = 0
Var(β̂) = σ2∑
(HPricet − HPrice)2 with (A2) Var(ut ) = σ2
Remember the two assumptions made in OLS to use this variance formula for hypothesis testing.
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Large sample variance of OLS estimator
OLS Estimator is Consistent OLS estimator is consistent if for large sample
lim n→∞
E(β̂) = β and lim n→∞
Var(β̂) = 0
OLS esitmator is consistent if it is unbiased and variance goes to zero with large sample size.
This is true if variance of the independent variable has a finite variance (A6) The OLS estimator is consistent if the followings are true
lim n→∞
Var(β̂) = lim n→∞
σ2∑ (HPricet − HPrice)2
= lim n→∞
σ2
n n∑
(HPricet − HPrice)2 = 0 ∗Q−1 = 0
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Large sample variance of OLS estimator
Normality Assumption (A5) Model GDPt = α+ βHPricet + ut The OLS estimator is a linear function of the error terms
β̂ = β + Cov(ut ,HPricet)
Var(HPricet)
Since the error term is normally distributed (A5) ut ∼ N(0, σ2), the OLS estimator as a linear combination of normal variables is also normally distributed.
β̂ − β0 s.e.(β̂)
∼ Normal
That’s why we can use t test on OLS estimator
β̂ − β0 ˆs.e.(β̂)
∼ t(n − k)
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Why Assumptions? Average Income Average Income II Average Income III Average Income IV Average Income V Efficiency
OLS Estimator is BLUE
Gauss Markov Theorem: OLS estimator is Best Linear Unbiased Estimator (BLUE) if it is unbiased, efficient, and consistent.
Assumptions (A2) constant variance and (A3) no autocorrelation give us efficiency for OLS estimator
We need (A4) no stochastic regressors to obtain unbiased OLS estimator
(A5) states that the error term is normally distributed, therefore we can use t test on the OLS estimators.
OLS estimator is consistent if variance of the independent variable has a finite variance (A6)
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Why Assumptions? Average Income Average Income II Average Income III Average Income IV Average Income V Efficiency
Random Income data from 4 individuals Y1,Y2,Y3,Y4
The average income is $86,000 and standard deviation is $50,000. Testing true population income = $90,000
H0 : µ = $90,000 H1 : µ 6= $90,000
t = Y − µ s/ √
n
Conclusion:
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Why Assumptions? Average Income Average Income II Average Income III Average Income IV Average Income V Efficiency
What if the data look like this?
Y1 = $150,000,Y2 = $100,000,Y3 = $45,000,Y4 = $50,000 The average income is $86,000 and standard deviation is $50,000. Testing true population income = $90,000
H0 : µ = $90,000 H1 : µ 6= $90,000
t = Y − µ s/ √
n
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Why Assumptions? Average Income Average Income II Average Income III Average Income IV Average Income V Efficiency
Modified t test with changing variance
Y1 = $150,000,Y2 = $100,000,Y3 = $45,000,Y4 = $50,000 The average income is $86,000 and standard deviation is $50,000. Testing true population income = $90,000
H0 : µ = $90,000 H1 : µ 6= $90,000
t = Y − µ√ s21 2 +
s22 2
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Why Assumptions? Average Income Average Income II Average Income III Average Income IV Average Income V Efficiency
Modified t test with serial correlation
Y1 = $150,000,Y2 = $100,000,Y3 = $45,000,Y4 = $50,000 The average income is $86,000 and standard deviation is $50,000. Testing true population income = $90,000
H0 : µ = $90,000 H1 : µ 6= $90,000
t = Y − µ√
s21 2 +
s22 2 + Cov(Yi ,Yj)......
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Why Assumptions? Average Income Average Income II Average Income III Average Income IV Average Income V Efficiency
Variance depends on Eduation?
Y1 = $150,000,Y2 = $100,000,Y3 = $45,000,Y4 = $50,000 The average income is $86,000 and standard deviation is $50,000. Testing true population income = $90,000
H0 : µ = $90,000 H1 : µ 6= $90,000
t = Y − µ
(α+ α2 ∗ Edui)/ √
n
Copyright 2019 Chan EC395
OLS OLS Assumptions
Unbiasedness Efficiency
Consistency Summary
Why Assumptions? Average Income Average Income II Average Income III Average Income IV Average Income V Efficiency
Which one is more efficient?
Y1 = $150,000,Y2 = $100,000,Y3 = $45,000,Y4 = $50,000 Sample Mean
Y = ∑
Yi n
Maximum and Minimum
Ymaxmin = Ymax + Ymin
2
Median The value separating the higher half from the lower half of a data sample.
Copyright 2019 Chan EC395
- Outline
- Main Talk
- Ordinary Least Square (OLS Estimation)
- OLS Estimator
- Model Performance
- OLS Assumptions
- OLS Estimator
- Unbiasedness, Efficiency, and Consistency
- Unbiasedness
- Stochastic Regressor
- Efficiency
- Variance of OLS estimator
- Consistency
- lLarge sample variance of OLS estimator
- Summary
- Why Assumptions?
- Average Income
- Average Income II
- Average Income III
- Average Income IV
- Average Income V
- Efficiency
EC395 ����ʱ��21��24��/�μ�/Gauss_Markov_Unbiased_Efficiency (1).pdf
OLS Unbiased and Efficiency Copyright c©2019 Wing Hong Chan EC395
1. Model Yi = α + βXi + ui
and we are trying to estimate α, β and σ2. OLS estimates those parameters by minimizing sum of square residuals which can be represented as first defining the sum of squared residuals as
S(α̂, β̂) = n∑ i=1
(Yi − ˆE(Yi))2
S(α̂, β̂) = n∑ i=1
(Yi − α̂− β̂Xi)2 = n∑ i=1
û2i (1)
ûi = Yi − Ŷi
Then the minimization is min α̂,β̂
S(α̂, β̂)
Then the first order condition is
∂S
∂α̂ = 2
∑ (Yi − α̂− β̂Xi)(−1) = 0
∂S
∂β̂ = 2
∑ (Yi − α̂− β̂Xi)(−Xi) = 0
Then we can solve for α̂ and β̂ by using these normal equations. If we divide both sides of the first normal equation by n, we get
α̂ = Y − β̂X (2)
Substituting this α̂ into the second normal equation we get
(Y − β̂X) ∑
Xi + β̂ ∑
X2i = ∑
YiXi
β̂( ∑
X2i − X ∑
Xi) = ∑
YiXi − Y ∑
Xi
β̂ =
∑ YiXi − n−1
∑ Xi
∑ Yi∑
X2i − n−1( ∑ Xi)2
=
∑ (Xi −X)(Yi − Y )∑
(Xi −X)2
β̂ = Cov(X, Y )
V ar(X)
2. Unbiasedness
β̂ = Cov(X,α + βXi + ui)
V ar(X)
β̂ = β + Cov(X, u)
V ar(X)
E(β̂) = β (3)
1
3. Efficient V ar(β̂)
β̂ = Cov(X,α + βXi + ui)
V ar(X) = β +
∑ (Xi −X)ui∑ (Xi −X)2
V ar(β̂) = V ar
[∑ (Xi −X)ui∑ (Xi −X)2
]
= ∑[ (Xi −X)∑
(Xi −X)2
]2 V ar(ui) +
∑∑ [i][j]Covij
(4)
Assume (A3) no correlation Cov(ui, uj) = 0
β̂ = ∑[ (Xi −X)∑
(Xi −X)2
]2 V ar(ui) (5)
Assume constanat variance (A2) V ar(ut) = σ 2
β̂ = σ2∑
(Xi −X)2 (6)
2
EC395 ����ʱ��21��24��/�μ�/Panel_Data_Analysis_L8 (2).pptx
Regression with Panel Data
Chapter 10
Copyright © 2015 Pearson, Inc. All rights reserved.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
1
Outline
Panel Data: What and Why
Panel Data with Two Time Periods
Fixed Effects Regression
Regression with Time Fixed Effects
Standard Errors for Fixed Effects Regression
Application to Drunk Driving and Traffic Safety
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
2
Panel Data: What and Why (SW Section 10.1)
A panel dataset contains observations on multiple entities (individuals, states, companies…), where each entity is observed at two or more points in time.
Hypothetical examples:
Data on 420 California school districts in 1999 and again in 2000, for 840 observations total.
Data on 50 U.S. states, each state is observed in 3 years, for a total of 150 observations.
Data on 1000 individuals, in four different months, for 4000 observations total.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Notation for panel data
A double subscript distinguishes entities (states) and time periods (years)
i = entity (state), n = number of entities,
so i = 1,…,n
t = time period (year), T = number of time periods
so t =1,…,T
Data: Suppose we have 1 regressor. The data are:
(Xit, Yit), i = 1,…,n, t = 1,…,T
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Panel data notation, ctd.
Panel data with k regressors:
(X1it, X2it,…,Xkit, Yit), i = 1,…,n, t = 1,…,T
n = number of entities (states)
T = number of time periods (years)
Some jargon…
Another term for panel data is longitudinal data
balanced panel: no missing observations, that is, all variables are observed for all entities (states) and all time periods (years)
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Why are panel data useful?
With panel data we can control for factors that:
Vary across entities but do not vary over time
Could cause omitted variable bias if they are omitted
Are unobserved or unmeasured – and therefore cannot be included in the regression using multiple regression
Here’s the key idea:
If an omitted variable does not change over time, then any changes in Y over time cannot be caused by the omitted variable.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Example of a panel data set: Traffic deaths and alcohol taxes
Observational unit: a year in a U.S. state
48 U.S. states, so n = # of entities = 48
7 years (1982,…, 1988), so T = # of time periods = 7
Balanced panel, so total # observations = 7×48 = 336
Variables:
Traffic fatality rate (# traffic deaths in that state in that year, per 10,000 state residents)
Tax on a case of beer
Other (legal driving age, drunk driving laws, etc.)
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
7
U.S. traffic death data for 1982:
Higher alcohol taxes, more traffic deaths?
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Why might there be higher more traffic deaths in states that have higher alcohol taxes?
Other factors that determine traffic fatality rate:
Quality (age) of automobiles
Quality of roads
“Culture” around drinking and driving
Density of cars on the road
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
These omitted factors could cause omitted variable bias.
Example #1: traffic density. Suppose:
High traffic density means more traffic deaths
(Western) states with lower traffic density have lower alcohol taxes
Then the two conditions for omitted variable bias are satisfied. Specifically, “high taxes” could reflect “high traffic density” (so the OLS coefficient would be biased positively – high taxes, more deaths)
Panel data lets us eliminate omitted variable bias when the omitted variables are constant over time within a given state.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Example #2:Cultural attitudes towards drinking and driving:
(i) arguably are a determinant of traffic deaths; and
(ii) potentially are correlated with the beer tax.
Then the two conditions for omitted variable bias are satisfied. Specifically, “high taxes” could pick up the effect of “cultural attitudes towards drinking” so the OLS coefficient would be biased
Panel data lets us eliminate omitted variable bias when the omitted variables are constant over time within a given state.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Panel Data with Two Time Periods (SW Section 10.2)
Consider the panel data model,
FatalityRateit = β0 + β1BeerTaxit + β2Zi + uit
Zi is a factor that does not change over time (density), at least during the years on which we have data.
Suppose Zi is not observed, so its omission could result in omitted variable bias.
The effect of Zi can be eliminated using T = 2 years.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
The key idea:
Any change in the fatality rate from 1982 to 1988 cannot be caused by Zi, because Zi (by assumption) does not change between 1982 and 1988.
The math: consider fatality rates in 1988 and 1982:
FatalityRatei1988 = β0 + β1BeerTaxi1988 + β2Zi + ui1988
FatalityRatei1982 = β0 + β1BeerTaxi1982 + β2Zi + ui1982
Suppose E(uit|BeerTaxit, Zi) = 0.
Subtracting 1988 – 1982 (that is, calculating the change), eliminates the effect of Zi…
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
FatalityRatei1988 = β0 + β1BeerTaxi1988 + β2Zi + ui1988
FatalityRatei1982 = β0 + β1BeerTaxi1982 + β2Zi + ui1982
so
FatalityRatei1988 – FatalityRatei1982 =
β1(BeerTaxi1988 – BeerTaxi1982) + (ui1988 – ui1982)
The new error term, (ui1988 – ui1982), is uncorrelated with either BeerTaxi1988 or BeerTaxi1982.
This “difference” equation can be estimated by OLS, even though Zi isn’t observed.
The omitted variable Zi doesn’t change, so it cannot be a determinant of the change in Y
This differences regression doesn’t have an intercept – it was eliminated by the subtraction step
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Example: Traffic deaths and beer taxes
1982 data:
= 2.01 + 0.15BeerTax (n = 48)
(.15) (.13)
1988 data:
= 1.86 + 0.44BeerTax (n = 48)
(.11) (.13)
Difference regression (n = 48)
= –.072 – 1.04(BeerTax1988–BeerTax1982)
(.065) (.36)
An intercept is included in this differences regression allows for the mean change in FR to be nonzero – more on this later…
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
ΔFatalityRate v. ΔBeerTax:
Note that the intercept is nearly zero…
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Fixed Effects Regression (SW Section 10.3)
What if you have more than 2 time periods (T > 2)?
Yit = β0 + β1Xit + β2Zi + uit, i =1,…,n, T = 1,…,T
We can rewrite this in two useful ways:
“n-1 binary regressor” regression model
“Fixed Effects” regression model
We first rewrite this in “fixed effects” form. Suppose we have n = 3 states: California, Texas, and Massachusetts.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Yit = β0 + β1Xit + β2Zi + uit, i =1,…,n, T = 1,…,T
Population regression for California (that is, i = CA):
YCA,t = β0 + β1XCA,t + β2ZCA + uCA,t
= (β0 + β2ZCA) + β1XCA,t + uCA,t
Or
YCA,t = αCA + β1XCA,t + uCA,t
αCA = β0 + β2ZCA doesn’t change over time
αCA is the intercept for CA, and β1 is the slope
The intercept is unique to CA, but the slope is the same in all the states: parallel lines.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
For TX:
YTX,t = β0 + β1XTX,t + β2ZTX + uTX,t
= (β0 + β2ZTX) + β1XTX,t + uTX,t
or
YTX,t = αTX + β1XTX,t + uTX,t, where αTX = β0 + β2ZTX
Collecting the lines for all three states:
YCA,t = αCA + β1XCA,t + uCA,t
YTX,t = αTX + β1XTX,t + uTX,t
YMA,t = αMA + β1XMA,t + uMA,t
or
Yit = αi + β1Xit + uit, i = CA, TX, MA, T = 1,…,T
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
19
The regression lines for each state in a picture
Recall that shifts in the intercept can be represented using binary regressors…
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
In binary regressor form:
Yit = β0 + γCADCAi + γTXDTXi + β1Xit + uit
DCAi = 1 if state is CA, = 0 otherwise
DTXt = 1 if state is TX, = 0 otherwise
leave out DMAi (why?)
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Summary: Two ways to write the fixed effects model
“n-1 binary regressor” form
Yit = β0 + β1Xit + γ2D2i + … + γnDni + uit
where D2i = , etc.
“Fixed effects” form:
Yit = β1Xit + αi + uit
αi is called a “state fixed effect” or “state effect” – it is the constant (fixed) effect of being in state i
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Fixed Effects Regression: Estimation
Three estimation methods:
“n-1 binary regressors” OLS regression
“Entity-demeaned” OLS regression
“Changes” specification, without an intercept (only works for T = 2)
These three methods produce identical estimates of the regression coefficients, and identical standard errors.
We already did the “changes” specification (1988 minus 1982) – but this only works for T = 2 years
Methods #1 and #2 work for general T
Method #1 is only practical when n isn’t too big
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
1. “n-1 binary regressors” OLS regression
Yit = β0 + β1Xit + γ2D2i + … + γnDni + uit (1)
where D2i = etc.
First create the binary variables D2i,…,Dni
Then estimate (1) by OLS
Inference (hypothesis tests, confidence intervals) is as usual (using heteroskedasticity-robust standard errors)
This is impractical when n is very large (for example if n = 1000 workers)
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
2. “Entity-demeaned” OLS regression
The fixed effects regression model:
Yit = β1Xit + αi + uit
The entity averages satisfy:
= αi + β1 +
Deviation from entity averages:
Yit – = β1 +
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Entity-demeaned OLS regression, ctd.
Yit – = +
or
= β1 +
where = Yit – and = Xit –
and are “entity-demeaned” data
For i=1 and t = 1982, is the difference between the fatality rate in Alabama in 1982, and its average value in Alabama averaged over all 7 years.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Entity-demeaned OLS regression, ctd.
= β1 + (2)
where = Yit – , etc.
First construct the entity-demeaned variables and
Then estimate (2) by regressing on using OLS
This is like the “changes” approach, but instead Yit is deviated from the state average instead of Yi1.
Standard errors need to be computed in a way that accounts for the panel nature of the data set (more later)
This can be done in a single command in STATA
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Example: Traffic deaths and beer taxes in STATA
First let STATA know you are working with panel data by defining the entity variable (state) and time variable (year):
. xtset state year;
panel variable: state (strongly balanced)
time variable: year, 1982 to 1988
delta: 1 unit
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
. xtreg vfrall beertax, fe vce(cluster state)
Fixed-effects (within) regression Number of obs = 336
Group variable: state Number of groups = 48
R-sq: within = 0.0407 Obs per group: min = 7
between = 0.1101 avg = 7.0
overall = 0.0934 max = 7
F(1,47) = 5.05
corr(u_i, Xb) = -0.6885 Prob > F = 0.0294
(Std. Err. adjusted for 48 clusters in state)
------------------------------------------------------------------------------
| Robust
vfrall | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
beertax | -.6558736 .2918556 -2.25 0.029 -1.243011 -.0687358
_cons | 2.377075 .1497966 15.87 0.000 2.075723 2.678427
------------------------------------------------------------------------------
The panel data command xtreg with the option fe performs fixed effects regression. The reported intercept is arbitrary, and the estimated individual effects are not reported in the default output.
The fe option means use fixed effects regression
The vce(cluster state) option tells STATA to use clustered standard errors – more on this later
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Example, ctd. For n = 48, T = 7:
= –.66BeerTax + State fixed effects
(.29)
Should you report the intercept?
How many binary regressors would you include to estimate this using the “binary regressor” method?
Compare slope, standard error to the estimate for the 1988 v. 1982 “changes” specification (T = 2, n = 48) (note that this includes an intercept – return to this below):
= –.072 – 1.04(BeerTax1988–BeerTax1982)
(.065) (.36)
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Regression with Time Fixed Effects (SW Section 10.4)
An omitted variable might vary over time but not across states:
Safer cars (air bags, etc.); changes in national laws
These produce intercepts that change over time
Let St denote the combined effect of variables which changes over time but not states (“safer cars”).
The resulting population regression model is:
Yit = β0 + β1Xit + β2Zi + β3St + uit
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Time fixed effects only Yit = β0 + β1Xit + β3St + uit
This model can be recast as having an intercept that varies from one year to the next:
Yi,1982 = β0 + β1Xi,1982 + β3S1982 + ui,1982
= (β0 + β3S1982) + β1Xi,1982 + ui,1982
= λ1982 + β1Xi,1982 + ui,1982,
where λ1982 = β0 + β3S1982 Similarly,
Yi,1983 = λ1983 + β1Xi,1983 + ui,1983,
where λ1983 = β0 + β3S1983, etc.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Two formulations of regression with time fixed effects
1. “T-1 binary regressor” formulation:
Yit = β0 + β1Xit + δ2B2t + … δTBTt + uit
where B2t = , etc.
2. “Time effects” formulation:
Yit = β1Xit + λt + uit
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Time fixed effects: estimation methods
1. “T-1 binary regressor” OLS regression
Yit = β0 + β1Xit + δ2B2it + … δTBTit + uit
Create binary variables B2,…,BT
B2 = 1 if t = year #2, = 0 otherwise
Regress Y on X, B2,…,BT using OLS
Where’s B1?
2. “Year-demeaned” OLS regression
Deviate Yit, Xit from year (not state) averages
Estimate by OLS using “year-demeaned” data
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Estimation with both entity and time fixed effects
Yit = β1Xit + αi + λt + uit
When T = 2, computing the first difference and including an intercept is equivalent to (gives exactly the same regression as) including entity and time fixed effects.
When T > 2, there are various equivalent ways to incorporate both entity and time fixed effects:
entity demeaning & T – 1 time indicators (this is done in the following STATA example)
time demeaning & n – 1 entity indicators
T – 1 time indicators & n – 1 entity indicators
entity & time demeaning
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
. gen y83=(year==1983); First generate all the time binary variables
. gen y84=(year==1984);
. gen y85=(year==1985);
. gen y86=(year==1986);
. gen y87=(year==1987);
. gen y88=(year==1988);
. global yeardum "y83 y84 y85 y86 y87 y88";
. xtreg vfrall beertax $yeardum, fe vce(cluster state);
Fixed-effects (within) regression Number of obs = 336
Group variable: state Number of groups = 48
R-sq: within = 0.0803 Obs per group: min = 7
between = 0.1101 avg = 7.0
overall = 0.0876 max = 7
corr(u_i, Xb) = -0.6781 Prob > F = 0.0009
(Std. Err. adjusted for 48 clusters in state)
------------------------------------------------------------------------------
| Robust
vfrall | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
beertax | -.6399799 .3570783 -1.79 0.080 -1.358329 .0783691
y83 | -.0799029 .0350861 -2.28 0.027 -.1504869 -.0093188
y84 | -.0724206 .0438809 -1.65 0.106 -.1606975 .0158564
y85 | -.1239763 .0460559 -2.69 0.010 -.2166288 -.0313238
y86 | -.0378645 .0570604 -0.66 0.510 -.1526552 .0769262
y87 | -.0509021 .0636084 -0.80 0.428 -.1788656 .0770615
y88 | -.0518038 .0644023 -0.80 0.425 -.1813645 .0777568
_cons | 2.42847 .2016885 12.04 0.000 2.022725 2.834215
-------------+----------------------------------------------------------------
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Are the time effects jointly statistically significant?
. test $yeardum;
( 1) y83 = 0
( 2) y84 = 0
( 3) y85 = 0
( 4) y86 = 0
( 5) y87 = 0
( 6) y88 = 0
F( 6, 47) = 4.22
Prob > F = 0.0018
Yes
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
The Fixed Effects Regression Assumptions and Standard Errors for Fixed Effects Regression (SW Section 10.5 and App. 10.2)
Under a panel data version of the least squares assumptions, the OLS fixed effects estimator of β1 is normally distributed. However, a new standard error formula needs to be introduced: the “clustered” standard error formula. This new formula is needed because observations for the same entity are not independent (it’s the same entity!), even though observations across entities are independent if entities are drawn by simple random sampling.
Here we consider the case of entity fixed effects. Time fixed effects can simply be included as additional binary regressors.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
LS Assumptions for Panel Data
Consider a single X:
Yit = β1Xit + αi + uit, i = 1,…,n, t = 1,…, T
E(uit|Xi1,…,XiT,αi) = 0.
(Xi1,…,XiT,ui1,…,uiT), i =1,…,n, are i.i.d. draws from their joint distribution.
(Xit, uit) have finite fourth moments.
There is no perfect multicollinearity (multiple X’s)
Assumptions 3&4 are least squares assumptions 3&4
Assumptions 1&2 differ
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Assumption #1: E(uit|Xi1,…,XiT,αi) = 0
uit has mean zero, given the entity fixed effect and the entire history of the X’s for that entity
This is an extension of the previous multiple regression Assumption #1
This means there are no omitted lagged effects (any lagged effects of X must enter explicitly)
Also, there is not feedback from u to future X:
Whether a state has a particularly high fatality rate this year doesn’t subsequently affect whether it increases the beer tax.
Sometimes this “no feedback” assumption is plausible, sometimes it isn’t. We’ll return to it when we take up time series data.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Assumption #2: (Xi1,…,XiT,ui1,…,uiT), i =1,…,n, are i.i.d. draws from their joint distribution.
This is an extension of Assumption #2 for multiple regression with cross-section data
This is satisfied if entities are randomly sampled from their population by simple random sampling.
This does not require observations to be i.i.d. over time for the same entity – that would be unrealistic. Whether a state has a high beer tax this year is a good predictor of (correlated with) whether it will have a high beer tax next year. Similarly, the error term for an entity in one year is plausibly correlated with its value in the year, that is, corr(uit, uit+1) is often plausibly nonzero.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Autocorrelation (serial correlation)
Suppose a variable Z is observed at different dates t, so observations are on Zt, t = 1,…, T. (Think of there being only one entity.) Then Zt is said to be autocorrelated or serially correlated if corr(Zt, Zt+j) ≠ 0 for some dates j ≠ 0.
“Autocorrelation” means correlation with itself.
cov(Zt, Zt+j) is called the jth autocovariance of Zt.
In the drunk driving example, uit includes the omitted variable of annual weather conditions for state i. If snowy winters come in clusters (one follows another) then uit will be autocorrelated (why?)
In many panel data applications, uit is plausibly autocorrelated.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Independence and autocorrelation in panel data in a picture:
Sampling is i.i.d. across entities
If entities are sampled by simple random sampling, then (ui1,…, uiT) is independent of (uj1,…, ujT) for different entities i ≠ j.
But if the omitted factors comprising uit are serially correlated, then uit is serially correlated.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Under the LS assumptions for panel data:
The OLS fixed effect estimator is unbiased, consistent, and asymptotically normally distributed
However, the usual OLS standard errors (both homoskedasticity-only and heteroskedasticity-robust) will in general be wrong because they assume that uit is serially uncorrelated.
In practice, the OLS standard errors often understate the true sampling uncertainty: if uit is correlated over time, you don’t have as much information (as much random variation) as you would if uit were uncorrelated.
This problem is solved by using “clustered” standard errors.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Clustered Standard Errors
Clustered standard errors estimate the variance of when the variables are i.i.d. across entities but are potentially autocorrelated within an entity.
Clustered SEs are easiest to understand if we first consider the simpler problem of estimating the mean of Y using panel data…
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Clustered SEs for the mean estimated using panel data
Yit = μ + uit, i = 1,…, n, t = 1,…, T
The estimator of μ mean is = .
It is useful to write as the average across entities of the mean value for each entity:
= = = ,
where = is the sample mean for entity i.
Copyright © 2015 Pearson, Inc. All rights reserved.
10-‹#›
Because observations are i.i.d. across entities, ( ,… ) are i.i.d. Thus, if n is large, the CLT applies and
= N(0, /n), where = var( ).
The SE of is the square root of an estimator of /n.
The natural estimator of is the sample variance of , . This delivers the clustered standard error formula for computed using panel data:
Clustered SE of = , where =