I am running a model testing the interaction of two categorical variables (AKA factors), one with two and the other with three groups. I have done many readings but couldn't find an answer regarding how to interpret the p-values I get, especially considering that what I understand does not make any sense when I look at the prediction plot.
Here is the model and the summary table:
m1 = glmmTMB(A ~ B*C + w1 + w2 + w3 + (1|individual), data = dt)
summary(m1)
Estimate Std. Error z value Pr(>|z|)
(Intercept) 242.192 8.229 29.43 < 2e-16 ***
Bb2 38.825 10.558 3.68 0.000236 ***
Cc2 62.400 13.640 4.57 4.77e-06 ***
Cc3 48.960 12.452 3.93 8.42e-05 ***
w1 87.620 2.665 32.87 < 2e-16 ***
w2 -6.441 2.666 -2.42 0.015702 *
w3 8.212 2.725 3.01 0.002582 **
Bb2:Cc2 -40.636 16.525 -2.46 0.013928 *
Bb2:Cc3 -20.067 14.963 -1.34 0.179880
And the prediction plot (with CI):
Relating to the results above, my questions are:
- What does the significance of the interaction terms mean? My intercept is b1c1, but does that mean that
Bb2:Cc2is significantly different fromBb1:Cc1, and that Bb2:Cc3 isn't significantly different fromBb1:Cc1? Looking at the prediction plot, this doesn't make any sense. - How can I get all comparisons? Specifically, how do I get the p-value for the comparison between
b1:c1andb1:c2and betweenb1:c1andb1:c3? - How do I report these results? Should I report the results for the interaction using an Anova test, and if so, which one should I use: in
R-aov, andcar::Anovawhich have two options (type II or type III) all give different results.
** In case it is important, here is the code I use to produce the prediction:
newdt = expand.grid(C = c("c1","c2","c3"),
B = c("b1", "b2"),
w1 = mean(dt$w1),
w2 = mean(dt$w2),
w3 = mean(dt$w3),
individual = 0)
pred.CapWild.MigNo.Beeline = as.data.frame(predict(m1, newdata = newdt,
re.form = NA, se.fit = T,
allow.new.levels=TRUE,
type = "response")) %>%
mutate(CI = 1.96*(se.fit), CI.u = fit+CI, CI.l = fit-CI) %>%
cbind(.,newdt)

b1c1. It'sB=b1, C=C1, w1=0, w2=0, w3=0. – dipetkov Nov 13 '22 at 13:29