[R] glm binomial with no successes

juli pausas pausas at gmail.com
Wed Feb 27 10:49:03 CET 2008


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.
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



More information about the R-help mailing list