Re: [R] glm binomial with no successes

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Wed, 27 Feb 2008 11:13:12 +0000 (GMT)

On Wed, 27 Feb 2008, juli pausas wrote:

> Dear all,
> I have a question on glm, family binomial. I do not see significant
> differences between the levels of a factor (treatment) if all data for
> a level is 0; and replacing a 0 for a 1 (in fact reducing the
> difference), then I detect the significant difference that I expected.

This is because you are using the wrong test, one with negligible power. See MASS4 pp.197-8 -- you need to use the LRT, as in

> drop1(glm(sf ~ tr, family="binomial"), test="Chisq")
Single term deletions

Model:
sf ~ tr

        Df Deviance    AIC    LRT   Pr(Chi)
<none>       1.595 17.730
tr      1   24.244 38.379 22.649 1.944e-06

(and in your example you can replace 'drop1' by 'anova').

> Is there a way to overcome this problem? or this is an expected
> behaviour ? Here is an example:
>
> s <- c(2,4,4,5,0,0,0,0)
> f <- c(31,28,28,28,32,37,34,35)
> tr <- gl(2, 4)
> sf <- cbind(s,f) # numbers of successes and failures
> summary(glm(sf ~ tr, family="binomial")) # tr ns
>
> sf[8,1] <- 1
> summary(glm(sf ~ tr, family="binomial")) # tr significative **
>
> Thanks for any suggestion
>
> Juli
>
> --
> http://www.ceam.es/pausas
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 27 Feb 2008 - 11:21:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Feb 2008 - 13:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive