一种方案是使用xtoverid命令,
- webuse nlswork, clear
- xtset idcode
- glo xlist "collgrad grade union msp nev_mar age race not_smsa south year"
- xtreg ln_wage $xlist, re r
- xtoverid
- Test of overidentifying restrictions: fixed vs random effects
- Cross-section time-series model: xtreg re robust cluster(idcode)
- Sargan-Hansen statistic 168.101 Chi-sq(7) [color=#ff0000]P-value = 0.0000[/color]
- 拒绝随机效应的原假设,应采用固定效应模型。
另一种方案是采用Robust Hausman检验,命令为rhausman.
- xtreg ln_wage $xlist, fe r
- est sto myfe
- xtreg ln_wage $xlist, re r
- est sto myre
- rhausman myfe myre, reps(200) cluster
- Cluster-Robust Hausman Test
- (based on 200 bootstrap repetitions)
- b1: obtained from xtreg ln_wage collgrad grade union msp nev_mar age race not_smsa south year, fe r
- b2: obtained from xtreg ln_wage collgrad grade union msp nev_mar age race not_smsa south year, re r
- Excluded (not identified, or only identified in one model): collgrad grade race
- Test: Ho: difference in coefficients not systematic
- chi2(9) = (b1-b2)' * [V_bootstrapped(b1-b2)]^(-1) * (b1-b2)
- = 667.09
- Prob>chi2 = 0.0000
- 拒绝随机效应的原假设,应采用固定效应模型。
可以发现rhausman检验与xtoverid过度识别检验结果是一致的,均认为采用固定效应。而传统hausman检验只能在不加robust选项下使用,这可能是错误的结论,因为我们现在基本上都要加robust。
虽然我们现在基本上不用做hausman检验,直接选择固定效应模型,但如果你一定要做Hausman检验,请使用稳健Hausman检验或xtoverid。


雷达卡






京公网安备 11010802022788号







