I'm using a linear mixed effects model to analyze the reaction time of learners of English as a second language. I have two factor variables - grammaticality (grammatical v.s. ungrammatical) and Finiteness (finite v.s. nonfinite); as well as one numeric variable - the proficiency score.
I'd like to analyze how their proficiency may affect their sensitivity to grammaticality and finiteness, so I built the model like this:
fitnonnative7 <- lmer(data = nonnative,
formula = RT ~ Grammaticality * Finiteness * Proficiency + (Grammaticality|subject) + (Grammaticality|item))
I got a significant interaction in grammaticality:finiteness:proficiency; otherwise, no other main effects or interactions were found. However, what am I supposed to do next? Which functions/code may help to understand what is happening inside these three variables?
You can use the
marginaleffectspackage to estimate contrasts. (Disclaimer: I am the author.) See the contrasts vignette for a lot of details:https://vincentarelbundock.github.io/marginaleffects/articles/contrasts.html
In this example,
amandvsare binary, andwtis numeric/continuous. First, we use thecomparisons()function to see what happens to the predicted outcome whenvsorammove from 0 to 1, for different values of thewtvariable (using thefivenumfunction to set the variable at Tukey’s five numbers). Then, we plot the value of the contrasts inamandvsfor different values ofwtusing theplot_cco()function: