First, I'm really sorry if this is a duplicate, I just couldn't find a definite answer.
I'm not used to analyzing categorical variables so I'm having trouble with something that is probably very basic. So, I'm running a glmer model with a binary outcome and 2 categorical predictors, one with 2 levels (pub) and one with 4 levels (tcat):
model<-glmer(outcome ~ (1|loc)+pub*tcat, data=data1, family="binomial") summary(model) <snip> Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -0.8210 0.5142 -1.597 0.1103 pub -1.1550 0.4707 -2.454 0.0141 * tcat2 -0.2438 0.5195 -0.469 0.6389 tcat3 0.2555 0.5319 0.480 0.6309 tcat4 0.2347 0.6147 0.382 0.7026 pub:tcat2 0.7972 0.4856 1.642 0.1007 pub:tcat3 0.6310 0.4917 1.283 0.1994 pub:tcat4 0.8240 0.5478 1.504 0.1325
So, none of the interactions are significant here. However, when I look at the contrasts:
em1<-emmeans(model, pairwise ~ pub|tcat) em1$contrasts $contrasts tcat = 1: contrast estimate SE df z.ratio p.value 1 - 2 1.155 0.471 Inf 2.454 0.0141 tcat = 2: contrast estimate SE df z.ratio p.value 1 - 2 0.358 0.127 Inf 2.827 0.0047 tcat = 3: contrast estimate SE df z.ratio p.value 1 - 2 0.524 0.145 Inf 3.619 0.0003 tcat = 4: contrast estimate SE df z.ratio p.value 1 - 2 0.331 0.281 Inf 1.178 0.2389
The contrasts suggest that "pub" levels 1 and 2 differ within tcats 1,2, and 3, but not within tcat=4. Right? However, should I even look at the contrasts when the interaction in the fixed effects part is not significant? I got the impression from some helpful answers I found that the information provided by the contrasts kind of "overrides" the information provided the fixed effects estimates but I couldn't confirm that. Working with continuous variables I learned (perhaps incorrectly?) that if a cont x cont or a cat x cont interaction is not significant, you don't go testing the simple slopes, you accept it and move on but I'm confused now because I have gotten the impression it doesn't work this way with factorial predictors.
I also ran a model comparison ANOVA between the above model and one without the interaction, and it was non-significant (Chisq. = 3.6, p = .308).
Any insight would be appreciated!