Dear List,
recently tried to reproduce the results of some custom model selection
function after updating R, which unfortunately failed. However, I
ultimately found the issue to be that testing with pchisq() in drop1()
seems to have changed. In the below example, earlier versions (e.g. R
2.4.1) produce a missing P-value for the variable x, while newer
versions (e.g. R 2.7.1) produce 0 (2.2e-16).

I would assume that the former is more appropriate, so I was just
curious if this is an intentional change.
Kind regards-
Lutz

y<-rbinom(100,1,0.5)
x<-rep(0,100)
m<-glm(y~x, family=binomial)
summary(m)
drop1(m, test="Chisq")
#################
R241> drop1(m, test="Chisq")
Single term deletions

Model:
y ~ x
       Df Deviance    AIC    LRT Pr(Chi)
<none>      138.59 140.59
x       0   138.59 140.59   0.00
Warning message:
NaNs produced in: pchisq(q, df, lower.tail, log.p)
##################
R271> drop1(m, test="Chisq")
Single term deletions

Model:
y ~ x
       Df Deviance    AIC    LRT   Pr(Chi)
<none>      137.99 139.99
x       0   137.99 139.99   0.00 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
###################

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to