[R-sig-ME] subjects assigned to treatment groups, multiple repeated measures over time

Ben Bolker bbolker at gmail.com
Fri Oct 13 15:43:13 CEST 2017


On Thu, Oct 12, 2017 at 10:03 AM, P Greenwood <pgreenw1 at gmu.edu> wrote:
> Hello
>
> I am a new user of lme4 and cannot find a clear answer to how to handle subjects randomly assigned to condition (treatment)  groups. The subject to subject variability  is likely to differ between groups on my measures in a way that varies over time. Time is broken into to 5 “drives” which occur in order (drive 1 is first, drive 2 is second, etc). Each drive has 10 trials on which various measures are obtained - heart rate, alpha band power at Pz, eye gaze, etc..
>

  How much data do you have?  Is the total 5 drives x 10 trials x ??
treatments ?? subjects?  How many treatments? In principle, variation
in among-subject variance across groups over time is a sensible thing
to want to model, but it's not easy in any of the canned frameworks I
know of within R.  Varying among-subject variation can roughly done
via the example in ?dummy:

lmer(distance ~ age + (age|Subject) +
          (0+dummy(Sex, "Female")|Subject), data = Orthodont)

which effectively allows different among-subject variation for males
and females (the big caveat here is that it can only *add* variance
for the dummy group, so variance(male) must be < variance(female) for
this to work ...

  Otherwise, you will need to use one of the "build-your-own" tools
(Stan, rethinking, TMB, JAGS, ...)

> Initially, I want to predict reaction time (RT) as a function of condition, alpha band power (PzAlpha), and drive.
>
> This model runs, but I’m not sure whether I am handling subjects within group correctly.
> I plan to use Anova to compare a null model with a simpler model, once I understand how to handle subjects within groups.
>
> Here is my model and output as a screen shot. Thanks so very much...

  Screenshots get stripped from mailing list posts. Can you
cut-and-paste as text?

>
> sumModelInteraction20 <- lmer(RT ~ 1 + Condition + PzAlpha + Drive + Condition*PzAlpha*Drive +
    (1 | Subject) + (1 | Trial), data = INFAST_Behavioral)

  Crudely speaking, this should allow for among-subject variation in
the response variable (although not for random slopes
such as varying effect of pzalpha or drive among subjects).
Condition*PzAlpha*Drive includes all of the main effects as
well as all two-way interactions and the three-way interactions, so
the intercept and main effect terms in the formula are redundant (but
harmless).

>
>



More information about the R-sig-mixed-models mailing list