i am looking for a test similar to a 2-way ANOVA that would work on a binary response variable. My response variable is presence/absence of plant species. My explanatory variables are Treatment (3 treatment groups) and habitat types(2 sites). First, I would like to know whether Treatment, Site and their interaction have a significant effect on P/A. Second, if either Treatment or Site is significant, I would like to test all pairs of treatment groups or sites to know which pairs of levels are significantly different, as I would normally do with an ANOVA.
- Can I use the logistic regression to construct a model and then the anova function to extract p-values as mentioned by KTwildginger (Test for effects of two categorical variables on a binary response variable?)?
mymodel <- glm(Survival ~ Treatment*Site, data=survivaldata, family="binomial") anova(mymodel, test="Chisq")
- Can I use lsmeans to compute the pairwise comparisons from the contrasts?