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

P Greenwood pgreenw1 at gmu.edu
Fri Oct 13 17:32:39 CEST 2017


Thank you so much.  I did apply for membership, but have not had a response.

To answer your questions:

1. I have currently an n of 26, with 12 subjects in one group, 14 in the other.  So 5 drives x 10 trials x 12  (group 1) or 14 (group 2) subjects
2. There are 2 treatments.
3.  I am pasting in the output below.
4.  I don’t currently have a main effect of Condition, p = 0.059.  If I did, would I be justified in running a separate model on each Condition? (I want to plan for future studies of this sort)

Thanks for the suggestions re: “build your own” tools.  Let me know if you have other thoughts after seeing the output.

Pam

sumModelInteraction21 <- lmer(RT ~ 1 + Condition + PzAlpha + Drive + Condition:PzAlpha + (1 | Subject) + (1 | Trial), data = INFAST_Behavioral)
> summary(sumModelInteraction21)
Linear mixed model fit by REML 
t-tests use  Satterthwaite approximations to degrees of freedom ['lmerMod']
Formula: RT ~ 1 + Condition + PzAlpha + Drive + Condition:PzAlpha + (1 |      Subject) + (1 | Trial)
   Data: INFAST_Behavioral

REML criterion at convergence: 2619.9

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.2633 -0.5041 -0.1428  0.2929  7.9158 

Random effects:
 Groups   Name        	Variance Std.Dev.
 Subject  (Intercept) 	0.572680 0.75676 
 Trial    (Intercept) 		0.004865 0.06975 
 Residual             		0.442561 0.66525 
Number of obs: 1231, groups:  Subject, 26; Trial, 10

Fixed effects:
                                   			Estimate 		Std. Error         df 			t value Pr(>|t|)  
(Intercept)                     			 -3.469e-01 	 2.249e-01  	2.600e+01  	-1.543   0.1350  
ConditionMachineLanguage          	5.214e-01  	3.002e-01  	2.390e+01   	1.737   0.0952 .
PzAlpha                          			 1.291e-02 	 2.970e-02 	 1.198e+03  	 0.435   0.6638  
Drive                            			 3.098e-02  	1.331e-02  	1.193e+03   	2.327   0.0201 *
ConditionMachineLanguage:PzAlpha -2.073e-04  4.053e-02 	 1.198e+03  	-0.005   0.9959  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) CndtML PzAlph Drive 
CndtnMchnLn -0.719                     
PzAlpha     -0.009  0.011              
Drive       -0.177  0.001 -0.034       
CndtnMcL:PA  0.007 -0.002 -0.732  0.020
> sumModelInteraction20 <- lmer(RT ~ 1 + Condition + PzAlpha + Drive + Condition*PzAlpha*PzDelta*Drive + (1 | Subject) + (1 | Trial), data = INFAST_Behavioral)
> summary(sumModelInteraction20)
Linear mixed model fit by REML 
t-tests use  Satterthwaite approximations to degrees of freedom ['lmerMod']
Formula: RT ~ 1 + Condition + PzAlpha + Drive + Condition * PzAlpha *      PzDelta * Drive + (1 | Subject) + (1 | Trial)
   Data: INFAST_Behavioral

REML criterion at convergence: 2676.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.3382 -0.4999 -0.1433  0.3075  7.8310 

Random effects:
 Groups   Name        Variance Std.Dev.
 Subject  (Intercept) 0.573459 0.75727 
 Trial    (Intercept) 0.004913 0.07009 
 Residual             0.444402 0.66664 
Number of obs: 1231, groups:  Subject, 26; Trial, 10

Fixed effects:
                                                 Estimate Std. Error         df t value Pr(>|t|)  
(Intercept)                                    -3.966e-01  2.292e-01  2.790e+01  -1.730   0.0946 .
ConditionMachineLanguage                        6.269e-01  3.111e-01  2.750e+01   2.015   0.0538 .
PzAlpha                                         4.245e-02  7.310e-02  1.188e+03   0.581   0.5616  
Drive                                           4.701e-02  1.975e-02  1.182e+03   2.381   0.0174 *
PzDelta                                         4.598e-02  6.787e-02  1.187e+03   0.677   0.4983  
ConditionMachineLanguage:PzAlpha               -3.520e-02  9.433e-02  1.188e+03  -0.373   0.7091  
ConditionMachineLanguage:PzDelta               -4.527e-02  9.377e-02  1.187e+03  -0.483   0.6294  
PzAlpha:PzDelta                                -3.334e-02  7.168e-02  1.187e+03  -0.465   0.6420  
ConditionMachineLanguage:Drive                 -3.403e-02  2.715e-02  1.183e+03  -1.253   0.2104  
PzAlpha:Drive                                  -9.227e-03  2.172e-02  1.190e+03  -0.425   0.6710  
Drive:PzDelta                                  -2.117e-02  2.103e-02  1.187e+03  -1.007   0.3143  
ConditionMachineLanguage:PzAlpha:PzDelta       -6.171e-02  9.652e-02  1.188e+03  -0.639   0.5227  
ConditionMachineLanguage:PzAlpha:Drive          1.088e-02  2.856e-02  1.189e+03   0.381   0.7032  
ConditionMachineLanguage:Drive:PzDelta          2.344e-02  2.891e-02  1.187e+03   0.811   0.4176  
PzAlpha:Drive:PzDelta                           1.553e-02  2.183e-02  1.189e+03   0.711   0.4770  
ConditionMachineLanguage:PzAlpha:Drive:PzDelta  1.753e-02  3.041e-02  1.188e+03   0.576   0.5645  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1



P.M. Greenwood, Ph.D.
Associate Professor of Psychology
Editorial Board, NeuroImage
David King Hall 2052
George Mason University
MSN 3F5, 4400 University Drive
Fairfax, VA 22030-4444

Ph: 703 993-4268
fax: 703 993-1359
email: Pgreenw1 at gmu.edu
http://psychology.gmu.edu/people/pgreenw1

> On Oct 13, 2017, at 9:43 AM, Ben Bolker <bbolker at gmail.com> wrote:
> 
> 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).
> 
>> 
>> 


	[[alternative HTML version deleted]]



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