如何解决打印 add1() 的进度报告
我似乎很难理解 add1()
的工作原理。首先,在 add1()
中,设置 trace = TRUE
会打印出进度报告,但我尝试执行此操作已多次失败。那么我们如何打印向模型添加项的进度报告以测试改进的拟合(或不拟合)?另外,为什么 LRT
(似然比检验)值不在输出中?示例如下:
require(graphics); require(utils)
lm1 <- lm(Fertility ~ .,data = swiss)
add1(lm1,scope = .~. + .^2,test="Chisq",trace = TRUE)
#It seems that no progress report has been printed. Also `LRT` is missing
Single term additions
Model:
Fertility ~ Agriculture + Examination + Education + Catholic +
Infant.Mortality
Df Sum of Sq RSS AIC Pr(>Chi)
<none> 2105 191
Agriculture:Examination 1 10.7 2094 192 0.6251
Agriculture:Education 1 1.8 2103 193 0.8399
Agriculture:Catholic 1 75.0 2030 191 0.1915
Agriculture:Infant.Mortality 1 4.4 2101 193 0.7528
Examination:Education 1 48.7 2056 192 0.2943
Examination:Catholic 1 40.8 2064 192 0.3378
Examination:Infant.Mortality 1 65.9 2039 191 0.2216
Education:Catholic 1 278.2 1827 186 0.0099 **
Education:Infant.Mortality 1 93.0 2012 191 0.1451
Catholic:Infant.Mortality 1 2.4 2103 193 0.8184
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。