-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Firth Sent: Tuesday, March 16, 2004 1:12 PM To: Paul Johnson Cc: [EMAIL PROTECTED] Subject: Re: [R] glm questions
Dear Paul
Here are some attempts at your questions. I hope it's of some help.
On Tuesday, Mar 16, 2004, at 06:00 Europe/London, Paul Johnson wrote:
Greetings, everybody. Can I ask some glm questions?(plus offset
1. How do you find out -2*lnL(saturated model)?
In the output from glm, I find:
Null deviance: which I think is -2[lnL(null) - lnL(saturated)] Residual deviance: -2[lnL(fitted) - lnL(saturated)]
The Null model is the one that includes the constant onlyif specified). Right?"usual model
I can use the Null and Residual deviance to calculate theChi-squared" statistic -2[lnL(null) - lnL(fitted)].
But, just for curiosity's sake, what't the saturated model's -2lnL ?
It's important to remember that lnL is defined only up to an additive constant. For example a Poisson model has lnL contributions -mu + y*log(mu) + constant, and the constant is arbitrary. The differencing in the deviance calculation eliminates it. What constant would you like to use??
I have always been und the impression that the constant chosen by glm is
that which makes the deviance of the saturated model 0, the saturated
model being the one with one parameter per observation in the dataset.
...
But a look at the deviance formula above ---
-2[lnL(fitted) - lnL(saturated)]
--- shows us that *any* constant can be added to lnL, and the deviance for the saturated model will still be zero.
David
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
