This is in the context of a linear mixed effects model, though I'm not sure that changes things.
Imagine two dichotomous predictors: Factor A and Factor B.
The model includes the following predictors: A + B + AxB
What precisely is the interaction term testing? I had assumed it tested whether the effect of A differed based on levels of B. But someone recently suggested this might not be the case, and that a type-III ANOVA would be necessary to evaluate the significance of this interaction.
Could anyone help me understand exactly what the AxB interaction is testing, especially with regards to my earlier understanding?
Here is some R Code for the sort of model I describe, and the resulting output.
require(lme4) require(lmerTest) require(data.table) Subject <- rep(1:30, each = 12) Item <- rep(1:12, times = 30) IV1 <- rep(rep(c("A", "B"), each = 6), times = 10) IV2 <- rep(c("A", "B"),times = 180) DV <- sample(c(0,1), replace = TRUE, size = 360) data <- as.data.table(cbind(Subject, Item, IV1, IV2, DV)) data$IV1 <- as.factor(data$IV1) data$IV2 <- as.factor(data$IV2) data$DV <- as.factor(data$DV) contrasts(data$IV1) <- c(1, -1) contrasts(data$IV2) <- c(1, -1) m <- glmer(DV ~ IV1*IV2 + (1|Subject) + (1|Item), family = "binomial", data = data) summary(m)
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod'] Family: binomial ( logit ) Formula: DV ~ IV1 * IV2 + (1 | Subject) + (1 | Item) Data: data AIC BIC logLik deviance df.resid 507.5 530.8 -247.7 495.5 354 Scaled residuals: Min 1Q Median 3Q Max -1.1435 -1.0000 0.8745 0.8745 1.0690 Random effects: Groups Name Variance Std.Dev. Subject (Intercept) 1e-12 1e-06 Item (Intercept) 0e+00 0e+00 Number of obs: 360, groups: Subject, 30; Item, 12 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) 0.10075 0.10594 0.951 0.342 IV11 0.16751 0.10594 1.581 0.114 IV21 -0.03338 0.10594 -0.315 0.753 IV11:IV21 0.03338 0.10594 0.315 0.753 Correlation of Fixed Effects: (Intr) IV11 IV21 IV11 0.008 IV21 0.001 -0.001 IV11:IV21 -0.001 0.001 0.008