Merk op dat we a.d.h.v. de binomiale analyse hetzelfde resultaat bekomen als met de analyse op basis van binaire data voor elk subject in de studie.
Merk op
salk_binary <- data.frame(polio_status = c(rep(1,57), rep(0,200688),
rep(1,142), rep(0,201087),
rep(1,157), rep(0,338621)),
treatment = factor(c(rep("vaccine", 57+200688),
rep("placebo", 142+201087),
rep("none",157+338621)),levels = c("placebo","none","vaccine")))
dim(salk_binary)
glm_salk_bernoulli <- glm(data = salk_binary, polio_status~treatment, family = binomial)
summary(glm_salk_bernoulli)