Lecture 14 - Panel data models
Lecture 14 - Panel data models
MODELS
Nguyen Quang
[email protected]
1 - Panel data
2 - Pooled OLS estimator
3 - Fixed effects model
4 - Random effects model
5 - FE vs RE: Hausman test
6 - Between group estimator
COVERED IN
THIS LECTURE
PANEL DATA
PANEL DATA
• More observations
• More variability
• Less collinearity between regressors
PANEL • Control of individual heterogeneity
• Reduce biases
DATA
Disadvantages
𝑦!" = 𝛼 + 𝛽𝑋!" + 𝑢
• 𝑦!" is the logarithm of real GDP of
province 𝑖 in year 𝑡
• 𝑋!" includes
• Logarithm of the labor force
• Logarithm of real investment
• Provincial competitiveness index (PCI)
POOLED OLS ESTIMATOR
POOLED OLS ESTIMATOR
• Data of all groups are pooled together
• No difference between groups
• The Pooled OLS estimator (and other panel data models) assumes no
correlation between residuals of the same group (no autocorrelation)
• If we relax the assumption, then
cov 𝑢!" , 𝑢!# ≠ 0
• We then have heteroskedasticity and autocorrelation
• If this happens, the Pooled OLS estimator is still consistent, but the standard
errors are incorrect.
• In this case we may use the clustered robust standard errors.
POOLED OLS WITH
CLUSTERED STANDARD ERRORS
POOLED
OLS
USING
PACKAGE
PLM
FIXED EFFECTS MODEL
Within group estimator
THE FIXED EFFECTS MODEL
• The model
𝑦!" = 𝛼! + 𝛽𝑋!" + 𝑢!"
• The slopes are still identical for all groups.
• But each group has a different intercept.
• These intercepts are called fixed effects, which capture individual heterogeneity.
• Two estimators:
• Fixed effects estimator (within group)
• Least square dummy variable estimator (LSDV)
• Note: these are the two ways of estimating the FE model, not two different models.
WITHIN GROUP FIXED EFFECTS ESTIMATOR
• The model
𝑦!" = 𝛼! + 𝛽𝑋!" + 𝑢!" (1)
• We need to allow for the intercept to vary across groups.
• Now take the average of variables across time, note that the parameters are time-invariant
𝑦1!" = 𝛼! + 𝛽𝑋1!" + 𝑢1 !" (2)
# #
where 𝑦1!" = $ ∑$"%# 𝑦!" and 𝑋1!" = $ ∑$"%# 𝑋!"
• Then subtract (2) from (1)
𝑦!" − 𝑦1!" = 𝛼! − 𝛼! + 𝛽 𝑋!" − 𝑋1!" + 𝑢!" − 𝑢1 !"
• Which results in
𝑦4!" = 𝛽𝑋5!" + 𝑢4 !"
• With this way we can estimate 𝛽 but not the fixed effects.
WITHIN
GROUP FIXED
EFFECTS
ESTIMATOR
WITHIN GROUP FIXED EFFECTS ESTIMATOR
robust standard errors
WITHIN GROUP FIXED EFFECTS ESTIMATOR
clustered standard errors
LEAST SQUARES DUMMY VARIABLE ESTIMATOR
' )
LSDV TWO- 𝑦!" = 0 𝛼$ 𝐷$! + 0 𝛾( 𝐷(" + 𝛽𝑋!" + 𝑢!"
WAY FIXED $%& (%&
EFFECTS Where:
1 if 𝑔 = 𝑡
𝐷(" =
MODEL 0 otherwise
LSDV TWO-
WAY
FIXED
EFFECTS some factors omitted
MODEL
• The random effects model is presented by
𝑦!" = 𝛼 + 𝛽𝑋!" + 𝑢!"
• The error component now includes
𝑢!" = 𝜇! + 𝜖!"
RANDOM
• 𝜇! ~𝑁 0, 𝜎*+ the individual specific random
EFFECTS component
MODEL • 𝜖!" ~𝑁 0, 𝜎,+ the idiosyncratic disturbance
• In the random effects model, regressors can be
time-invariant.
• Estimation method: generalized least squares
RANDOM
EFFECTS
MODEL
RANDOM EFFECT MODEL
clustered standard errors
RANDOM VS.
FIXED EFFECTS
• The main difference is that the individual effects
RANDOM are assumed fixed in FE and random in RE.
• The random effects model is preferred for
VS. FIXED • The fixed effects vary over time.
• It is more efficient (higher degree of
EFFECTS freedom)
• It allows time-invariant regressors
HAUSMAN TEST