What follows is a basic question concerning Binomial GLM's.
Suppose we have a set of observations where a binary response was measured in three different treatments, A, C and D -
treatment = c("A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "C", "D", "D", "D", "D", "D", "D")
response = c(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE)
dat = data.frame(treatment, response, stringsAsFactors = FALSE)
head(dat)
treatment response
1 A TRUE
2 A TRUE
3 A TRUE
4 A TRUE
5 A TRUE
6 A TRUE
Incidentally, the response was TRUE in 100% of the cases in A, 27% of the cases in C and 0% of the cases in D -
tapply(dat$response, dat$treatment, mean)
A C D
1.0000000 0.2666667 0.0000000
According to a Binomial GLM, however, the latter contrasting difference A is not significant -
fit = glm(response ~ treatment, family= "binomial", dat)
summary(fit)
Call:
glm(formula = response ~ treatment, family = "binomial", data = dat)
Deviance Residuals:
Min 1Q Median 3Q Max
-0.78760 -0.78760 0.00005 0.00005 1.62589
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 20.57 3964.63 0.005 0.996
treatmentC -21.58 3964.63 -0.005 0.996
treatmentD -41.13 8253.04 -0.005 0.996
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 55.637 on 40 degrees of freedom
Residual deviance: 17.397 on 38 degrees of freedom
AIC: 23.397
Number of Fisher Scoring iterations: 19
Does this result make sense? Is there a more appropriate test for cases when outcome of a given treatment completely fall into one or the other response type?
Will appreciate any feedback on this.