I have made a binomial glm which describes how a complexity score (integer value 0-5) and an experimental treatment (factors A,B,C) affect a ratio of successes to failures (x, y) (both x and y are whole numbers).
Ratio as a function of complexity and treatment. Treatment is indicated by each color
Treatment is indicated by each color.
I want to know whether the complexity (continuous), the treatment (categorical), and importantly the interaction between these two factors influence the ratio of successes. As I take measures multiple times across individuals (one for each complexity score), they are included as a random intercept. I made my model using the glmmTMB function:
glmmTMB(cbind(x,y)~Complexity*Treatment+(1|Individual),
data=data,
family=binomial())
I already know that this model outperforms a model with no interaction effect, and also one which is completely null (determined by AIC). Therefore, there is an interaction effect present, and all estimates fitted by my model are significant.
Conditional model:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.057263 0.007497 -7.64 2.20e-14 ***
Complexity -0.049219 0.004052 -12.15 < 2e-16 ***
TreatmentB -0.046695 0.010673 -4.38 1.21e-05 ***
TreatmentC -0.404695 0.011272 -35.90 < 2e-16 ***
Complexity:TreatmentB -0.012258 0.005793 -2.12 0.0343 *
Complexity:TreatmentC -0.033857 0.006187 -5.47 4.44e-08 ***
What I now want to know is the direction of this interaction effect for each combination of treatment and complexity. I was advised to do a TukeyHSD, but I’m not sure how to do this in R for a binomial GLMM?
Any examples of how to do this in R? Please explain as if I was a child.
Elliot Howard-Spink is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.