C6 - English
C6 - English
Phuong Le
H = (bFE − bRE )′ [Var (bFE ) − Var (bRE )]−1 (bFE − bRE ) ∼ χ2 (k),
where bFE is the estimate of the vector β in the (FE) model, bRE is the
estimate of the vector β in the (RE) model according to the GLS
method.
Breusch & Pagan test:
H0 : σu2 = 0 (Pooled OLS)
H1 : σu2 > 0 (RE)
Statistic:
P 2
2
nT i (T e i )
LM = P P 2 − 1 ∼ χ2 (1).
2(T − 1) i t eit
Estimating FE and RE models
Model estimation
Method 1: Use the menu: Statistics > Longitudinal/panel data >
Linear models > Linear regression (FE, RE, PA, BE).
Example
use http://www.stata-press.com/data/r18/nlswork, clear
Fixed effects model:
xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure
c.tenure#c.tenure 2.race not_smsa south, fe
If we suspect heteroskedasticity or serial correlation in the errors, we
can specify the vce(robust) or vce(hc2) option:
xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure
c.tenure#c.tenure 2.race not_smsa south, fe vce(robust)
Example
Random effects model:
xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure
c.tenure#c.tenure 2.race not_smsa south, re
Model selection
Based on the p-value (in the last line of the test result xtreg ..., fe) to
conclude (if p-value < 5% then we choose Fixed effect, otherwise we
choose Pooled OLS ).
Model selection
Example
xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure
c.tenure#c.tenure 2.race not_smsa south, fe
Because Prob > F = 0.0000, the Fixed effect model is more suitable
than Pooled OLS.
estimates store fe
xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure
c.tenure#c.tenure 2.race not_smsa south, re
estimates store re
We make a comparison between Fixed effect and Random effect
using Hausman test
hausman fe re
Because p-value < 5%, Fixed effect is more suitable than Random
effect
Conclusion: we choose the Fixed effect model.
Reference: https://www.stata.com/manuals/xtxtreg.pdf