I am trying to consider how one would actually calculate deviance of a linear model in R. I am trying to implement: $$D = -2 \times (L_p - L_s)$$
Where $L_p$ and $L_s$ are the log-likelihood of the proposed and saturated model respectively.
I have seen a few things that have confused me slightly:
- Gordon Smyth mentioned that you would never actually fit a saturated model in a comment on this question. If that's the case, how do we know $L_s$?
- Mike Love calculated deviance by comparing $-2\times L_p$ with $-2 \times$a simulated negative-binomial distribution on Biostars. I expect the answer to (1) might be in here somewhere, but I am unsure what is being calculated here.
I also understand that the deviance of the saturated model is zero in a logistic regression, so we can take $D = -2 \times L_p$ as the deviance.
How about for linear regression? How would I estimate $L_s$ without fitting a saturated model in R? I'm definitely missing some understanding here, so any reading material you can recommend to would be appreciated. Thanks.
poisson()
include a$dev.resids
component - the deviance is the sum of squares of the result of this function ... $\endgroup$