第三步:进行hausman检验 hausman fe
Hausman检验量为:
H=(b-B)′[Var(b)-Var(B)]-1(b-B)~x2(k)
Hausman统计量服从自由度为k的χ2分布。当H大于一定显著水平的临界值时,我们就认为模型中存在固定效应,从而选用固定效应模型,否则选用随机效应模型
如果hausman检验值为负,说明的模型设定有问题,导致Hausman 检验的基本假设得不到满足,遗漏变量的问题,或者某些变量是非平稳等等 可以改用hausman检验的其他形式: hausman fe, sigmaless
对于固定效应模型的异方差检验和序列相关检验: Xtserial gdp invest culture sci health admin techno 异方差检验:
xtreg gdp invest culture sci health admin techno,fe
xttest3 (Modified Wald statistic for groupwise heteroskedasticity in fixed effect model) 随机效应模型的序列相关检验:
xtreg gdp invest culture sci health admin techno,re Xttest1
Xttest1用于检验随机效应(单尾和双尾) 、一阶序列相关以及两者的联合显著
检验结果表明存在随机效应和序列相关,而且对随机效应和序列相关的联合检验也非常显著 可以使用广义线性模型xtgls对异方差和序列相关进行修正:
xtgls gdp invest culture sci health admin techno, panels(hetero),修正异方差
xtgls gdp invest culture sci health admin techno, panels(correlated),修正依横截面而变化的异方差
xtgls gdp invest culture sci health admin techno, panels(hetero) corr(ar1),修正异方差和一阶序列相关ar(1)

