Message-ID: <65CFA5BF-CDA8-4421-8930-C06425B58220@gmail.com>
Date: 2011-04-21T22:12:40Z
From: Peter Dalgaard
Subject: GLM output for deviance and loglikelihood
In-Reply-To: <9F8D2D1EDFB24A49AB951FB56B75D3BD0236E012@STJMSVR02.williamhill.co.uk>
On Apr 21, 2011, at 11:30 , Jeffrey Pollock wrote:
> So am I right in saying that Binary data isnt the only case where this is true? It would make sense to me that for a multinomial model you could have a unique factor for each data point and thus be able to create a likelihood of 1.
Yes. (I did say "pretty much"...). There are also some synthetic cases like when you enter a 2x2 table as 4 separate records:
> d <- data.frame(n=c(1,2,3,4),outcome=c(0,1,0,1),g=c(1,1,2,2))
> summary(glm(outcome~g,weights=n,binomial,data=d))
Call:
glm(formula = outcome ~ g, family = binomial, data = d, weights = n)
Deviance Residuals:
1 2 3 4
-1.482 1.274 -2.255 2.116
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.0986 2.5658 0.428 0.669
g -0.4055 1.4434 -0.281 0.779
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13.460 on 3 degrees of freedom
Residual deviance: 13.380 on 2 degrees of freedom
AIC: 17.380
Number of Fisher Scoring iterations: 3
(The results are fine as long as you don't actually use the "residual deviance" for anything!)
--
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com