让 LL = loglikelihood
剩余偏差 = 2(LL(饱和模型) - LL(建议模型))
但是,当我使用glm
函数时,似乎
Residual Deviance = -2LL(Proposed Model)
例如,
mydata <- read.csv("https://stats.idre.ucla.edu/stat/data/binary.csv")
mydata$rank <- factor(mydata$rank)
mylogit <- glm(admit ~ gre + gpa + rank, data = mydata, family = "binomial")
summary(mylogit)
###
Residual deviance: 458.52 on 394 degrees of freedom
AIC: 470.52
#Residual deviance
-2*logLik(mylogit)
##'log Lik.' 458.5175 (df=6)
#AIC
-2*logLik(mylogit)+2*(5+1)
##470.5175
LL(饱和模型)在哪里?如何在R中获得它的值?
谢谢。