rotenone <- data.frame(dose=factor(c("high", "medium", "low")),
affected=c(44, 24, 0),
total=c(50, 46, 49))
print(rotenone)
rotenone_logit_mod <- glm(affected ~ 1 + dose, data = rotenone, family = binomial(link = "logit"))
summary(rotenone_logit_mod)
above is my code for comparing the proportion of affected insects in the three groups by fitting a logistic regression model.
but the error is:
"Error in eval(family$initialize) : y values must be 0 <= y <= 1"
can someone please help me fix the problem?
thank you