My model has 3 predictors:
- Group (A vs. B)
- Condition (baseline vs. treatment)
- Memory (a continuous variable)
The model gives an interaction between Condition and Group.
I then tested the simple effect of Condition within each level of Group, by subsetting the data by Group and build models on the subset data. The model for Group A shows an interaction between Condition and Memory.
My question is how I should interpret the interaction between Condition and Memory, given that in the full model there is no effect involving Memory, and simple effect doesn't aim to test Memory?
Here is the data data.
Here is the code:
> # read in data
> df <- read.csv(file = "data/df.csv")
>
> # orthogonal contrasts
> contrasts(df$Group) <- c(-1/2, 1/2)
> contrasts(df$Condition) <- c(-1/2, 1/2)
>
> # build model
> mod <- lmer(score ~ Condition * Group * Memory + (1|SubjID), data = df)
> Anova(mod, type = "III")
Analysis of Deviance Table (Type III Wald chisquare tests)
Response: score
Chisq Df Pr(>Chisq)
(Intercept) 30.5590 1 3.239e-08 ***
Condition 6.1629 1 0.01305 *
Group 20.5651 1 5.764e-06 ***
Memory 1.2731 1 0.25918
Condition:Group 25.0994 1 5.445e-07 ***
Condition:Memory 1.9954 1 0.15777
Group:Memory 3.0044 1 0.08304 .
Condition:Group:Memory 2.8056 1 0.09393 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> # simple effect: subsetting Group A
> df <- df %>% filter(Group == "A") %>% droplevels()
> # orthogonal contrasts
> contrasts(df$Condition) <- c(-1/2, 1/2)
> # model
> mod <- lmer(score ~ Condition * Memory + (1|SubjID), data = df)
> Anova(mod, type = "III")
Analysis of Deviance Table (Type III Wald chisquare tests)
Response: score
Chisq Df Pr(>Chisq)
(Intercept) 59.4346 1 1.264e-14 ***
Condition 25.5871 1 4.229e-07 ***
Memory 4.6007 1 0.03196 *
Condition:Memory 4.1592 1 0.04141 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1