Nagelkerke R2 with different packages gives different values
Let try different packages to estimate Nagelkerke (1991) R^2.
Nagelkerke NJD (1991) A note on a general definition of the coefficient of determination. Biometrika 78:691-192
nagelkerke() function from package companion truncates the significance digits at 6.
NagelkerkeR2() from package fmsb reports a different value as compare to other functions in the first example. I don't know why. I have contacted the author of the package and he does not know also.
library(rcompanion)
library(fmsb)
res <- glm(cbind(ncases,ncontrols) ~ agegp+alcgp+tobgp, data=esoph, family=binomial())
# [1] 0.9759681
# [1] 0.965045
Let do another example; no problem with this one:
model = glm(Result ~ County + Sex + County:Sex,
weight = Count,
data = AndersonBias,
family = binomial(link="logit"))
size = AndersonBias$Count, prediction = model$fitted.values)
Commentaires
Enregistrer un commentaire