From P.Dalgaard at biostat.ku.dk  Wed Jan  7 16:48:03 2009
From: P.Dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Wed, 07 Jan 2009 16:48:03 +0100
Subject: [Rd] Apparant bug in binomial model in GLM (PR#13434)
In-Reply-To: <20090107151218.GA17759@stat.umn.edu>
References: <mailman.25.1231326005.26300.r-devel@r-project.org>
	<20090107151218.GA17759@stat.umn.edu>
Message-ID: <4964CEB3.5070808@biostat.ku.dk>

Charles Geyer wrote:
...
> BTW the particular example given doesn't make clear WHAT question cannot
> be answered correctly.  Some questions can be without fuss, for example
> 
>> y <- c(0,0,0,0,0,1,1,1,1,1)
>> x <- seq(along = y)
>> out1 <- glm(y ~ x, family = binomial)
> Warning messages:
> 1: In glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart,  :
>   algorithm did not converge
> 2: In glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart,  :
>   fitted probabilities numerically 0 or 1 occurred
>> out0 <- glm(y ~ 1, family = binomial)
>> anova(out0, out1, test = "Chisq")
> Analysis of Deviance Table
> 
> Model 1: y ~ 1
> Model 2: y ~ x
>   Resid. Df Resid. Dev Df Deviance P(>|Chi|)
> 1         9    13.8629
> 2         8  7.865e-10  1  13.8629    0.0002
> 
> This P-value (P = 0.0002) is valid, because the MLE does exist for the null
> hypothesis.  Hence we see that we have to use the model y ~ x for which
> the MLE does not exist in the conventional sense.


It may be  valid in some senses, but I can't help notice that it is off
by a factor of at least 10, since the experiment has only 1024 outcomes,
two of which are as extreme as the one observed, and where all outcomes
are equally likely under the corresponding y~1 model.

-p


-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



[Rd] Apparant bug in binomial model in GLM (PR#13434)
Peter Dalgaard