似然比检验(LR)、Wald检验、拉格朗日检验(LM)都基于最大似然估计(MLE),本文以logit模型为例讨论三类检验的Stata实现。不当之处,请各位指正。
1、似然比检验
use http://www.ats.ucla.edu/stat/stata/faq/nested_tests, clear
*Likelihood-ratio test
logit hiwrite
estimates store m1
logit hiwrite female read math science
estimates store m2
lrtest m1 m2
当然我们可以使用另外一种方法来实现上述同样的结果:
*another method to compute LR test
logit hiwrite female read math science
scalar c=2*(e(ll)-e(ll_0))
scalar p_c = chi2tail(1,c)
di as txt 'chi2(4) = ' as result %9.2g `=c'
di as txt 'Prob > chi2 = ' asresult %9.4g `=p_c'
两者的结果是一样的: