程序代写代做代考 C flex ECONOMETRICS I ECON GR5411 Lecture 22 – Panel Data I

ECONOMETRICS I ECON GR5411 Lecture 22 – Panel Data I
by
Seyhan Erden Columbia University MA in Economics

Hypothesis Testing:
𝐻”: 𝑐𝜃=0
These three tests are asymptotically equivalent under 𝐻” (however they
behave differently in finite samples)
1. Likelihood ratio test: if the restriction is valid, then imposing it
should not cause a large reduction in 𝐿𝑛𝐿, thus 𝐿𝑛𝐿* ≈ 𝐿𝑛𝐿,
2. Wald test: if the restriction is valid, 𝑐 𝜃- should be close to zero ,
since 𝜃- →/ 𝜃 (consistency of MLE) * *
Reject 𝐻” if different than zero.
3. Lagrange multiplier test: if restriction is valid, the restricted estimator should be near the point that maximizes log-likelihood, thus the slope of log-likelihood evaluated at 𝜃- should be close to
zero , 12/2/20 Lectures 21 – GR5411 by Seyhan Erden
2

The Lagrange Multiplier (Score) Test:
The test’s reasoning is analogous to that of the Wald test Lagrange multiplier test statistic
𝜕𝐿𝑛𝐿𝜃- 2 45 𝜕𝐿𝑛𝐿𝜃- 𝐿𝑀=,𝐼𝜃- ,~𝜒9 𝜕𝜃- , 𝜕𝜃- 8
Under 𝐻”, 𝐿𝑀 ~ 𝜒89
𝐿𝑀 test has a useful form….. Next slide
12/2/20 Lectures 21 – GR5411 by Seyhan Erden 3
,,

The Lagrange Multiplier (Score) Test:
𝐿𝑀 test has a useful form: (𝑛×𝑘) 𝑖@A row of 𝑔BD, ↑
R e c a l l 𝑔B , = K L H L NM O KNMO
𝑔B, = ∑H 𝑔BD, = 𝐺-,2 𝑖 DG5
↓ 𝑖@A term
of the gradient
of the log-likelihood function
→ column of 1’s
12/2/20
Lectures 21 – GR5411 by Seyhan Erden
4

The Lagrange Multiplier (Score) Test:
Using the outer product of gradient to estimate 𝐿𝑀, 𝐿𝑀 = 𝑖2𝐺- 𝐺-2 𝐺- 45𝐺-2 𝑖
,,,,
=𝑛 𝑖2𝐺- 𝐺-2𝐺- 45𝐺-2𝑖/𝑛 ,,,,
= 𝑛𝑅9
Note that because 𝑖2𝑖 = 𝑛 the term 𝑖2𝐺- 𝐺-2 𝐺- 45𝐺-2 𝑖 /𝑛 is the ,,,,
uncentered squared multiple correlation coefficient in a linear
regression of a column of 1s on the derivatives of the log-likelihood
function computed at the restricted estimator.
12/2/20 Lectures 21 – GR5411 by Seyhan Erden 5

The Lagrange Multiplier (Score) Test:
You can think of this result as follows
𝑖→y 𝐺- , → 𝑋
Then, 45 𝑖2𝐺-, 𝐺-,2 𝐺-,
𝐺-,2 𝑖 → 𝑦2𝑋 𝑋2𝑋 45𝑋2𝑖 = 𝑦2𝑃𝑦 = 𝑦B′𝑦B 𝑛=𝑖2𝑖 → 𝑦2𝑦
Note that because 𝑖2𝑖 = 𝑛 the term 𝑖2𝐺- 𝐺-2 𝐺- 45𝐺-2 𝑖 /𝑛 is the ,,,,
uncentered squared multiple correlation coefficient in a linear
regression of a column of 1s on the derivatives of the log-likelihood
function computed at the restricted estimator.
12/2/20 Lectures 21 – GR5411 by Seyhan Erden 6

Models for Panel Data
Panel data gives flexibility in modeling differences across entities.
𝑦D@ =𝑥2 𝛽+𝑧2𝛼+𝜀D@ D@ D
= 𝑥2 𝛽 + 𝑐D + 𝜀D@ D@
𝑥D@ does not include a constant term, we later explain the constant term issue below. The heterogeneity, or entity effect, is 𝑧D2𝛼 where 𝑧D contains a constant term and a set of entity
specific variables.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 7

Models for Panel Data
Sometimes textbook use 𝑢D instead of 𝑐D. We will do that too below. Examples: say the entity is individuals then 𝑧D contains observed variables such as race, gender, location, etc, and unobserved variables such as skills, preferences, family characteristics and so on, all of which are taken to be constant over time.
𝑦D@ =𝑥2 𝛽+𝑧2𝛼+𝜀D@ D@ D
= 𝑥2 𝛽 + 𝑐D + 𝜀D@ D@
= 𝑥2 𝛽 + 𝑢D + 𝜀D@ D@
12/2/20
Lecture 22 – GR5411 by Seyhan Erden 8

If 𝑧D is observed for all individuals, then the model can be treated as an ordinary linear model and fit by least squares.
Complications arise when 𝑐D is unobserved (this is common in most applications). For example ability will always be missing because it is impossible to measure ability.
The main objective of the analysis is to find consistent
and efficient 𝛽^ for the partial effects 𝛽
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 9

The main objective of the analysis is to find consistent and efficient 𝛽^ for the partial effects 𝛽 such that
𝜕𝐸 𝑦D@|𝑥D@
𝜕𝑥D@
To find a consistent and efficient estimator for these partial effects we consider the following assumptions:
Strict exogeneity:
𝐸 𝜀D@|𝑥D5,𝑥D9,…,𝑐D = 𝐸 𝜀D@|𝑋D,𝑐D = 0
𝛽=
12/2/20 Lecture 22 – GR5411 by Seyhan Erden
10

Strict exogeneity:
𝐸 𝜀D@|𝑥D5,𝑥D9,…,𝑐D = 𝐸 𝜀D@|𝑋D,𝑐D = 0
Meaning: current disturbances is uncorrelated with the independent variables in every period, past, present and future.
A looser assumption is contemporaneous exogeneity, is sometimes more useful:
then
𝐸𝑦D@|𝑥D@,𝑐D =𝑥2𝛽+𝑐D D@
𝐸𝜀D@|𝑥D@,𝑐D =0
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 11

Without strict endogeneity, we must rule out dynamic models with lagged dependent variables on the right hand side of the regression.
In some cases strict exogeneity is stronger than necessary, we will loosen it as we need to.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 12

Examples:
ØProgram Evaluation: A standard model for estimating the effects of job training or other programs on subsequent wages is
𝐿𝑛 𝑤𝑎𝑔𝑒D@ =𝜃@ +𝑧D@𝛾+𝛿5𝑝𝑟𝑜𝑔D@ +𝑐D +𝑢D@
where 𝑖 is for each individual and 𝑡 for time period. The parameter
𝜃@ denotes a time-varying intercept, and 𝑧D@ is a set of observable characteristics that affect wage and may also be correlated with program participation. Say at 𝑡 = 1 no one participated in the
program yet, so 𝑝𝑟𝑜𝑔D@ = 0 for all 𝑖, then at 𝑡 = 2 a subgroup
participates and subsequent wages are observed for the control and
the treatment groups for 𝑡 = 2. What is the reason for including 𝑐D? 12/2/20 Lecture 22 – GR5411 by Seyhan Erden 13

Examples:
ØProgram Evaluation (cont’)
What is the reason for including 𝑐D?
Answer: Individual Effects (ability, more motivated workers will
sign up for training) Self-selection problem.
Other issue: strict exogeneity assumption: we can assume 𝑢D@
is uncorrelated with 𝑝𝑟𝑜𝑔D@, but what about correlation between 𝑢D@
and 𝑝𝑟𝑜𝑔D,@m5? Future program participation may depend on 𝑢D@ 12/2/20 Lecture 22 – GR5411 by Seyhan Erden 14

Examples:
ØDistributed Lag Model: Consider a distributed lag model to study the relationship between patents awarded to a firm and current and past levels of R&D spending
𝑝𝑎𝑡𝑒𝑛𝑡𝑠D@ = 𝜃@ + 𝑧D@𝛾 + 𝛿”𝑅𝐷D@ + 𝛿5𝑅𝐷D,@45 + ⋯ + 𝛿q𝑅𝐷D,@4q + 𝑐D + 𝑢D@ 𝑐D is firm specific variables (firm heterogeneity term) that may influence 𝑝𝑎𝑡𝑒𝑛𝑡𝑠D@ and that may be correlated with current, past and future R&D expenditures.
ØLagged Dependent Variable: is another case where strict exogeneity assumption may fail.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 15

Heterogeneity, Mean independence:
A convenient assumption is mean independence:
𝐸𝑐D|𝑥D5,𝑥D9,… =𝛼
If the unobserved variables, like “ability” are uncorrelated with the included variables then they may be included in the disturbance term, random effects model uses this assumption. This is a strong assumption.
The alternative assumption is
𝐸 𝑐D|𝑥D5,𝑥D9,… = h 𝑥D5,𝑥D9,… = h 𝑋D
For some unspecified but non-constant function of 𝑋D.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 16

Model Structures: 1. Pooled Regression
2. Fixed Effects
3. Random Effects
4. Random Parameters
1. Pooled Regression: If 𝑧D contains only a constant term (i.e. there are no unobserved entity specific variables) then OLS provides consistent and efficient estimates the common 𝛼 and the slope vector.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 17

Model Structures:
2. Fixed Effects: If 𝑧D is unobserved and correlated with 𝑥D@ then OLS estimator will be biased and inconsistent (OVB).
The model
𝑦D@ =𝑥2 𝛽+𝑧2𝛼+𝜀D@ D@ D
= 𝑥2 𝛽 + 𝛼D + 𝜀D@ 2 D@
where 𝛼D = 𝑧D 𝛼. This is fixed effects approach and it takes to be a group-specific constant term in the regression
model.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 18

Model Structures:
3. Random Effects: if the unobserved entity heterogeneity is
uncorrelated with 𝑥D@, then the model may be formulated 𝑦D@ =𝑥2 𝛽+𝐸 𝑧2𝛼 + 𝑧2𝛼−𝐸 𝑧2𝛼 +𝜀D@
D@ D D D
= 𝑥2 𝛽 + 𝛼 + 𝑢D + 𝜀D@ D@
The difference between fixed and random effects has to do with whether unobserved variables are correlated with regressors in the model. RE model handles the constant of
each group (entity) as random parameter, that is 𝛼 + 𝑢D 12/2/20 Lecture 22 – GR5411 by Seyhan Erden 19

Model Structures:
4. Random Parameters: the random effects model is a regression model with a random constant term, we can extend this to a model in which the other coefficients vary randomly across entities as well, such as
𝑦D@ =𝒙2 𝜷+𝒖D + 𝛼+𝑢D +𝜀D@ D@
where 𝒖D is the random vector that induces variation of parameters across entities.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 20

Pooled Regression Model:
𝑦D@ =𝛼+𝑥2 𝛽+𝜀D@ D@
𝐸 𝜀D@|𝑥D5, 𝑥D9 … , 𝑥Dwx = 0 𝐸𝜀D@𝜀yz|𝑥D5,𝑥D9…,𝑥Dwx =𝜎|9
if 𝑖 = 𝑗 and 𝑡 = 𝑠
𝐸 𝜀D@𝜀yz|𝑥D5, 𝑥D9 … , 𝑥Dwx = 0
if 𝑖 ≠ 𝑗 or 𝑡 ≠ 𝑠
and remaining assumptions of the classical model are met (zero conditional
mean of 𝜀D@, homoskedasticity, no correlation across observations, 𝑖 and strict
exogeneity of 𝑥D@.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 21

LS Estimation of the Pooled Model:
The simplest model in panel data regressions is the pooled regression
𝑦 =𝑥2𝛽+𝜀 D@ D@ D@
𝐸𝑥D@𝜀D@ =0
where 𝛽 is a 𝑘×1 coefficient vector and 𝜀D@ is 𝑘×1 error vector.
At the entity level, the model can be written as
𝑦D =𝑋D𝛽+𝜀D where 𝜀D is 𝑇D×1 error vector.
The equation for the full sample is
𝑦 = 𝑋𝛽 + 𝜀
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 22

LS Estimation of the Pooled Model:
In this case the pooled regression estimator is
Hw 45Hw
𝛽^ =ÇÇ𝑥𝑥2 /ÄÄÅ D@ D@
DG5 @G5
The vector of residuals for the 𝑖@A entity (individual, state, country, etc.)
is
𝜀 ̂ = 𝑦 − 𝑋 𝛽^
D D D /ÄÄÅ
ÇÇ𝑥𝑦 =𝑋2𝑋45𝑋2𝑦 D@ D@
DG5 @G5
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 23

The Fixed Effects Model:
𝑦D@ =𝑥2 𝛽+𝑐D +𝜀D@, 𝑖=1,…,𝑛, 𝑡=1,…,𝑇D D@
Strict exogeneity is an important assumption in this model:
𝐸 𝜀D@|𝑥D5, 𝑥D9, … , 𝑥Dwx or we can write 𝐸 𝑥Dz𝜀D@
Also,
𝐸 𝜀D@𝜀yz|𝑥D5,𝑥D9,…,𝑥Dwx
= 0 if 𝑖 ≠ 𝑗 and 𝑡 ≠ 𝑠
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 24
= 0
= 0 for all 𝑠 = 1,…,𝑇
= 𝜎|9 if 𝑖 = 𝑗 and 𝑡 = 𝑠
𝐸 𝜀D@𝜀yz|𝑥D5,𝑥D9,…,𝑥Dwx

The Fixed Effects Model:
Let 𝑖 be a 𝑇𝑥1 column of ones,
𝑦D = 𝒊 𝛼D + 𝑋D 𝛽 + 𝜀D
where 𝒊 = 𝑖 ⊗ 𝐼 Note that
𝑖⋯0 𝛼5 ⋮⋱⋮ 𝛼⋮
12/2/20
Lecture 22 – GR5411 by Seyhan Erden 25
𝒊𝛼D =
0⋯𝑖Hw×H HH×5

The Fixed Effects Model:
Let 𝑛𝑇𝑥𝑛 matrix, 𝐷 = 𝑑5 𝑑9 …𝑑H . Then we can write the above regression as
or
𝑦 = 𝑑 5 𝑑 9 … 𝑑 H 𝑋 𝛼𝛽 + 𝜀 𝑦 = 𝐷𝛼 + 𝑋𝛽 + 𝜀
This is the reason that the model is also refered to as least
squares dummy variable (LSDV) model. This will give us
the same estimator as the fixed effects model.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 26

The Fixed Effects Model:
Thus, we can write the least squares estimator of 𝛽 as 𝛽^Lâäã = 𝑋′𝑀ä𝑋 45 𝑋′𝑀ä𝑦 = 𝛽^åD@ADH
where the symmetric and idempotent matrix
𝑀ä = 𝐼Hw − 𝐷 𝐷2𝐷 45𝐷′
Hence 𝛽^Lâãä can also be written as
𝛽^Lâäã = 𝑋′𝑀ä 𝑀ä𝑋 45 𝑋′𝑀ä 𝑀ä𝑦
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 27

The Fixed Effects Model:
This amounts to LS regression with transformed data, such
that,
D’s columns are conveniently orthogonal
𝑀” ⋯ 0 ⋮ ⋱ ⋮”
0⋯𝑀
𝑀ä =
𝑋̈ = 𝑀ä𝑋 𝑦̈ = 𝑀ä𝑦
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 28

𝑀” ⋯ 0 ⋮ ⋱ ⋮”
𝑀ä =
0⋯𝑀
Each matrix on the diagonal is 1 𝑀” =𝐼w −𝑖 𝑖2𝑖 45𝑖2 =𝐼w −𝑇𝑖𝑖′
Pre-multiplying any 𝑇𝑥1 vector 𝑦D by 𝑀” creates 𝑀 ” 𝑦 D @ = 𝑦 D @ − 𝑦é D 𝑖
where
1w
𝑦é D = 𝑇 Ç 𝑦 D @
DG5
12/2/20
Lecture 22 – GR5411 by Seyhan Erden 29

The Fixed Effects Model:
Therefore a LS regression of 𝑦̈ on 𝑋̈ is equivalent to a regression of 𝑦̈D@ = 𝑦D@ − 𝑦éD on 𝑥̈D@ = 𝑥D@ − 𝑥̅D
In terms of within transformed data
𝛽^ L â ä ã = 𝛽^ ê ë = 𝑋 ̈ ′ 𝑋 ̈ 4 5 𝑋 ̈ 𝑦 ̈ = 𝑋 2 𝑀 ä 𝑋 4 5 𝑋 2 𝑀 ä 𝑦
The above transformation is also known as within transformation. We also refer to 𝑦̈ and 𝑋̈ as demeaned
values or deviations from entity means. Also, 𝛽^êë is
known as within estimator.
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 30

Testing the significance of group effects
To test the differences across groups, we can test the hypothesis that the constant terms are all equal with an 𝐹 test. Under the null hypothesis, the efficient estimator is pooled least squares. The 𝐹 ratio is
𝑅9 − 𝑅9 /(𝑛 − 1) 𝐹= Lâäã ìÄÄÅîï
1 − 𝑅9 /(𝑛𝑇 − 𝑛 − 𝑘 − 1) Lâäã
~𝐹
H45 ,(Hw4H4ñ45)
12/2/20
Lecture 22 – GR5411 by Seyhan Erden
31

The Fixed Effects Model:
𝛽^êë = 𝑋2𝑀ä𝑋 45 𝑋2𝑀ä𝑦
= 𝑋2𝑀ä𝑋 45 𝑋2𝑀ä 𝑋𝛽+𝐷𝛼+𝜀
=𝛽+ 𝑋2𝑀ä𝑋45 𝑋2𝑀ä𝜀
since 𝑀ä𝐷 = 0. 𝛽^êë is free potential bias from any
entity – specific, time – invariant variables.
Fixed effects estimator is invariant to the actual values of fixed effects (entity – fixed effects). Thus statistical properties do not rely on assumptions about 𝑢D (𝑐D or
𝛼D, i.e. any entity – fixed effects)
12/2/20 Lecture 22 – GR5411 by Seyhan Erden 32