yzhlinscau的个人博客分享 http://blog.sciencenet.cn/u/yzhlinscau

博文

AFEchidna包的简单示例7--模型比较

已有 1356 次阅读 2021-3-2 19:07 |个人分类:Echidna|系统分类:科研笔记

model.comp()用于多个模型的比较,用法如下:

model.comp(...,LRT=FALSE,boundary = TRUE)

其中,…为esR运行结果,LRT为是否进行LRT检验;


简单示例如下:

m1<-echidna(es0.file="fm.es0",
              fixed=h3~1+Rep,random=~Fam)

m2<-echidna(es0.file="fm.es0",
           fixed=h3~1+Rep,random=~Fam+Fam:Rep)
model.comp(m1,m2,LRT=TRUE)

运行结果如下:

> model.comp(m1,m2,LRT=TRUE)

Model comparison results as following:
  parNO     LogL     AIC     BIC AIC.State BIC.State
m1     2 -2346.84 4697.68 4706.31                    
m2     3 -2336.64 4679.28 4692.23    better    better

=====================================
Likelihood ratio test (LRT) results:
note:left model before "/" is full model,right is reduced.

Likelihood ratio test(s) assuming nested random models.
(See Self & Liang, 1987)

     df LR-statistic Pr(Chisq)    
m2/m1  1         20.4 3.141e-06 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

运行结果简单说明,第一部分的AIC和BIC结果显示,模型2为更优模型;第二部分的LRT检验结果表明,m2是全阶模型,m1为降阶模型,移除Fam:Rep项后,模型发生显著变化,表明Fam:Rep项是显著的,即m2是更优模型。

做模型比较时,应注意,固定效应需要是一样的。

当然,model.comp()可用于2个以上的模型比较。


E



https://blog.sciencenet.cn/blog-1114360-1274680.html

上一篇:AFEchidna包的简单示例2--单变量的批量分析
下一篇:AFEchidna示例8--分析阈性状
收藏 IP: 219.137.64.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-19 00:21

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部