# R: LMM with covariate

I know there have been a number of posts on lmer, but I am struggling to find my answer through research and am hoping to get your help.

I am analyzing data from a study with the following data:

1) Score = the DV, a participants score on a given test.

2) Test = IV, within-subjects variable. Tests were taken at 4 different time points--1 pre intervention and 3 post intervention tests. Not all participants completed all 4 tests.

3) Group = between-subjects variable, subjects were assigned to either an intervention or control group.

4) Resistance = a covariate that may explain why intervention was more/less effective in a given participant.

I want to know whether Score varies as a function of Group across tests. I'd also like to know whether Resistance modifies the change in test scores moreso for the intervention group than the control (so, a three way interaction, I think?).

In lme4 syntax you could write the model as
lmer(Score ~ Test + Group * Resistance + (Test | Subject))
For more info on lme4 syntax see Table 2 here, or this well-done blog post.