3dLME Setup

Hi Gang,

I have a few questions about setting up 3dLME. I have two within-subjects variables (Condition: Standard vs. Reward; and Emotion: Happy vs. Neutral) and one continuous covariate of interest (anxiety severity). I also want to control for four covariates of non-interest: age, race (non-white vs. white), IQ and gender.

Here are my questions:

  1. As I understand LMEs, I need to include random slopes for the two sources of non-independence, namely the two within-subjects variables (Condition and Emotion). However, previous discussions on the message board seem to suggest that I should only model the random intercept, and that I would only include a random slope if the within-subjects variable changed for each subject in each condition (e.g., reaction times). First, should I only estimate a random intercept? And if so, how does the model account for the non-independence caused by the repeated measures of Condition and Emotion?
  2. I’m mainly interested in the interactions involving anxiety (Cond:Anx, Emo:Anx, and Cond:Emo:Anx). These are automatically generated by the model. However, I’m also interested in the effect of anxiety at each of the within-subject levels. To model these effects, I ran the four GLTs below. Is that what I’m modeling? Or am I modeling, for example, the effect of the standard condition at the average anxiety score?

Here’s my current script:


3dLME \
-prefix LME.nii \
-jobs 4 \
-mask mask.group_anat.nii \
-model "Cond*Emo*Anx+age+race+IQ+gen" \
-qVars 'Anx,age,race,IQ,gen' \
-qVarCenters '23.3,32.94,0,97.65,0' \
-ranEff '~1' \
-SS_type 3 \
-num_glt 4 \
-gltLabel 1 'Standard_Anx' -gltCode 1 'Cond : 1*Standard Anx : ' \
-gltLabel 2 'Reward_Anx' -gltCode 2 'Cond : 1*Reward Anx : ' \
-gltLabel 3 'Happy_Anx' -gltCode 3 'Emo : 1*Happy Anx : ' \
-gltLabel 4 'Neutral_Anx' -gltCode 4 'Emo : 1*Neutral Anx : '  \
-dataTable \
Subj   Cond       Emo     Anx     age   race   IQ     gen    InputFile \
s1     Standard   Happy   13      45    -0.5   109   -0.5    stats.s1.nii'[Standard_Happy_GLT#0_Coef]' \
s2     Standard   Happy   22      35    -0.5   117   -0.5    stats.s2.nii'[Standard_Happy_GLT#0_Coef]' \
...
s1     Standard   Neutral 13      45    -0.5   109   -0.5    stats.s1.nii'[Standard_Neutral_GLT#0_Coef]' \
s2     Standard   Neutral 22      35    -0.5   117   -0.5    stats.s2.nii'[Standard_Neutral_GLT#0_Coef]' \
...
s1     Reward     Happy   13      45    -0.5   109   -0.5    stats.s1.nii'[Reward_Happy_GLT#0_Coef]' \
s2     Reward     Happy   22      35    -0.5   117   -0.5    stats.s2.nii'[Reward_Happy_GLT#0_Coef]' \
...
s1     Reward     Neutral 13      45    -0.5   109   -0.5    stats.s1.nii'[Reward_Neutral_GLT#0_Coef]' \
s2     Reward     Neutral 22      35    -0.5   117   -0.5    stats.s2.nii'[Reward_Neutral_GLT#0_Coef]' \
... 

The crucial question is: Is Anxiety a constant for each subject, or does it vary within each subject?

If Anxiety is a constant for each subject, there is no random slope to model; and you could just use 3dMVM in that situation.

I’m also interested in the effect of anxiety at each of the within-subject levels. To model these effects,
I ran the four GLTs below. Is that what I’m modeling?

Yes, those GLTs are indeed what you’re looking for.

Anxiety is a constant for each subject (between-subjects variable), so it sounds like I should go with 3dMVM.

Just to test my knowledge, am I right that the GLT below would be an even more specific test of the effect of Anxiety on Happy trials in the Standard condition?


-gltLabel 5 'Standard_Happy_Anx' -gltCode 5 'Cond : 1*Standard Emo : 1*Happy Anx : ' \

Thanks for the guidance!

Hi Gang,

I switched over to 3dMVM, like you suggested. Now I’m getting an error I can’t seem to solve. I’ve seen this elsewhere on the message board, but the solutions don’t seem to apply.

Again, I have two within-subjects variables of interest, one continuous between-subjects variable of interest (Anx), and four covariates of non-interest (two of which are continuous). I’d like to model the three-way interaction between the two within-subjects variables and Anx.

When I run the code below, I get this error: Incorrect level coding in variable Anx : :

Any recommendations for fixes? Should I instead list “Anx” as a qVar, then model the interactions of interest in glts?


3dMVM \
-prefix MVM.nii \
-jobs 4 \
-mask mask.group_anat.nii \
-bsVars 'Anx' \
-wsVars 'Cond*Emo' \
-qVars 'age,IQ' \
-qVarCenters '32.94,97.65' \
-SS_type 3 \
-GES \
-num_glt 4 \
-gltLabel 1 'Standard_Anx' -gltCode 1 'Cond : 1*Standard Anx :' \
-gltLabel 2 'Reward_Anx' -gltCode 2 'Cond : 1*Reward Anx :' \
...
-dataTable \
Subj   Cond       Emo     Anx     age   race   IQ     gen    InputFile \
s1     Standard   Happy   13      45    -0.5   109   -0.5    stats.s1.nii'[Standard_Happy_GLT#0_Coef]' \
...

Thanks again.

am I right that the GLT below would be an even more specific test of the effect of Anxiety on Happy
trials in the Standard condition?

-gltLabel 5 ‘Standard_Happy_Anx’ -gltCode 5 'Cond : 1Standard Emo : 1Happy Anx : ’ \

Yes, it looks good.

For your 3dMVM script, in addition to the following

-bsVars ‘Anx’ \

you need to declare that variable “Anx” is a quantitative variable:

-qVars ‘age,IQ,Anx’
-qVarCenters ‘32.94,97.65,?’ \

Great, it’s all working now. Thanks for your help, Gang!