I am a relatively inexperienced R user and is a newbie here. I would like to ask for your advice regarding how to plot a three-way interaction graph in R.
My mixed effects regression model looks like this:
model1 <- lmer(score ~ TaskType * Language * Time + VocabSize + (1|ID), data= vocabtestscore)
TaskType is binary (1 and 2) and refers to the type of second language word learning task the participants completed. Language is also categorical (the students' first or second language) and refers to the language used in the glosses of the target words (words they didn't know) in the task. The study has a factorial design, so there are 2*2 = 4 word learning task conditions. Each participant is in only one of the four conditions. Finally, VocabSize refers to participants' previous vocabulary size, as measured by a test. This is the only continuous predictor.
After task completion, each student completed two post-tests of their knowledge of the target words: immediate and delayed post-tests. Therefore, Time refers to the time of testing and is binary.
Based on the regression results, there is a significant three-way interaction between TaskType, Language, and Time. Therefore, I would like to plot a graph to illustrate the interaction.
I searched online and found that the code below might be the code I need:
emmip(model1 , Language ~ TaskType | Time, CIs=TRUE)
And below is the graph I obtained:
Did I plot the interaction correctly? What I am not sure is whether this interaction plot takes into account the fact that my model is a mixed effects model and the fact that VocabSize is present in the model.
I would appreciate any suggestions.