2

Let LL = loglikelihood

Residual Deviance = 2(LL(Saturated Model) - LL(Proposed Model))

However, when I use glm function, it seems that

Residual Deviance = -2LL(Proposed Model)

For example,

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

Where is LL(Saturated Model) and how can I get it's value in R?

Thank you.

ming gao
  • 53
  • 8

1 Answers1

2

I have got the answer: it only happens when the log likelihood of the saturated model is 0, which for discrete models implies that the probability of the observed data under the saturated model is 1. Binary data is pretty much the only case where this is true (because individual fitted probabilities become either zero or one).H and Here for details.

ming gao
  • 53
  • 8