嵌套模型(Nested Models)和非嵌套模型(Non-Nested Models) 的统计检验(R语言)

在R语言中,对于嵌套(nest)模型可以使用likelihood ratio tests(似然比检验),对于非嵌套模型(Non-Nested Models) 可以使用Davidson and MacKinnon’s J-test。这两种检验在论文中经常使用如:
嵌套模型(Nested Models)和非嵌套模型(Non-Nested Models) 的统计检验(R语言)_第1张图片

如下为其代码示例:

require(lmtest)
## Fit two competing, non-nested models for aggregate 
## consumption, as in Greene (1993), Examples 7.11 and 7.12

## load data and compute lags
data(USDistLag)
usdl <- na.contiguous(cbind(USDistLag, lag(USDistLag, k = -1)))
colnames(usdl) <- c("con", "gnp", "con1", "gnp1")

## C(t) = a0 + a1*Y(t) + a2*C(t-1) + u
fm1 <- lm(con ~ gnp + con1, data = usdl)

## C(t) = b0 + b1*Y(t) + b2*Y(t-1) + v
fm2 <- lm(con ~ gnp + gnp1, data = usdl)

fm3 <- lm(con ~ gnp, data = usdl)
## Cox test in both directions:
coxtest(fm1, fm2)

## ...and do the same for jtest() and encomptest().
## Notice that in this particular case they are coincident.
jtest(fm1, fm2)
encomptest(fm1, fm2)
# likelihood ratio tests
lrtest(fm3, fm1)

检验结果如下图所示:
嵌套模型(Nested Models)和非嵌套模型(Non-Nested Models) 的统计检验(R语言)_第2张图片

嵌套模型(Nested Models)和非嵌套模型(Non-Nested Models) 的统计检验(R语言)_第3张图片
嵌套模型(Nested Models)和非嵌套模型(Non-Nested Models) 的统计检验(R语言)_第4张图片
嵌套模型(Nested Models)和非嵌套模型(Non-Nested Models) 的统计检验(R语言)_第5张图片

参考

http://math.furman.edu/~dcs/courses/math47/R/library/lmtest/html/jtest.html
https://www.bauer.uh.edu/rsusmel/phd/ec1-6.pdf
http://www.empowerstats.com/cn/manuals/RCH/html/z_lrt.pdf

你可能感兴趣的:(R语言)