title: R: loglikelihood of Saturated Model in GLM
body: <p>Let <strong>LL</strong> = <em>loglikelihood</em></p>
  
  <p><strong>Residual Deviance</strong> = 2(LL(<em>Saturated Model</em>) - LL(<em>Proposed Model)</em>) </p>
  
  <p>However, when I use <code>glm</code> function, it seems that </p>
  
  <pre><code>Residual Deviance = -2LL(Proposed Model)
  </code></pre>
  
  <p>For example,</p>
  
  <pre><code>mydata &lt;- read.csv("https://stats.idre.ucla.edu/stat/data/binary.csv")
  mydata$rank &lt;- factor(mydata$rank)
  mylogit &lt;- 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
  </code></pre>
  
  <p>Where is LL(<em>Saturated Model</em>) and how can I get it's value in R?</p>
  
  <p>Thank you.</p>