3dMVM -qVars

Hi! I have some questions regarding 3dMVM and if it’s set up correctly…

We have data from patients who get treatment (REAL vs SHAM) and they watch stimuli (pictures of ALOHOL vs Non-ALCOHOL). In previous analysis I have used 3dMVM since the groups are uneven. Typically like this:


3dMVM -prefix no_covariates -dataTable @table.txt -jobs 10 \
-mask mask+tlrc \
-bsVars Treatment \
-wsVars Stim \
-num_glt 3 \
-gltLabel 1 Treatment \
-gltCode 1 'Treatment: 1*real -1*sham' \
-gltLabel 2 Stim \
-gltCode 2 'Stim: 1*alc -1*non_alc' \
-gltLabel 3 TreatmentXStim \
-gltCode 3 'Treatment: 1*real -1*sham Stim: 1*alc -1*non_alc'

With the table:


Subj Treatment  Stim  InputFile 
S01    real    alc  stats.subject_01_REML+tlrc.BRIK'[alc#0_Coef]' 
S01    real    non_alc     stats.subject_01_REML+tlrc.BRIK'[non_alc#0_Coef]'
S02    sham    alc   stats.subject_02_REML+tlrc.BRIK'[alc#0_Coef]' 
S02    sham    non_alc    stats.subject_02_REML+tlrc.BRIK'[non_alc#0_Coef]'

Now we also want to add some covariates (of interest), e.g. some scores they give after treatment with relate to the success of the treatment. These are just numbers. So I added -qVars. Would this be between subject variable? Or within?

New mvm script:


3dMVM -prefix covariates -dataTable @table_plus_covariates.txt -jobs 10 \
-mask mask+tlrc \
-bsVars "Treatment+[b]AUQ1[/b]" \
-qVars "[b]AUQ1[/b]" \
-wsVars Stim \
-num_glt 3 \
-gltLabel 1 Treatment \
-gltCode 1 'Treatment: 1*real -1*sham' \
-gltLabel 2 Stim \
-gltCode 2 'Stim: 1*alc -1*non_alc' \
-gltLabel 3 TreatmentXStim \
-gltCode 3 'Treatment: 1*real -1*sham Stim: 1*alc -1*non_alc'

New table:


Subj Treatment  Stim AUQ1  InputFile 
S01    real    alc   10.3 stats.subject_01_REML+tlrc.BRIK'[alc#0_Coef]' 
S01    real    non_alc 10.3    stats.subject_01_REML+tlrc.BRIK'[non_alc#0_Coef]'
S02    sham    alc   11.1 stats.subject_02_REML+tlrc.BRIK'[alc#0_Coef]' 
S02    sham    non_alc  11.1 stats.subject_02_REML+tlrc.BRIK'[non_alc#0_Coef]'

As output, regarding the qvar, I only get the F-score for AUQ1 (related to variance explained by AUQ1 when accounting for all the other variables as well?) and the interaction between AUQ1 and Stim (AUQ1:Stim F). Why don’t I also get the interaction between AUQ1 and treatment?

To summarize:
Is the script + table correct for this experiment?
Is the qvar in this case within of between subject variable?
Meaning of AUQ1 F?
Why don’t I get AUQ1:Treatment, but only get AUQ1:Stim?

Thanks so much in advance!

Is the script + table correct for this experiment?

The following 3 lines

-gltCode 1 ‘Treatment: 1real -1sham’
-gltCode 2 ‘Stim: 1alc -1non_alc’
-gltCode 3 ‘Treatment: 1real -1sham Stim: 1alc -1non_alc’ \

should be changed to (add a space before each colon)

-gltCode 1 ‘Treatment : 1real -1sham’
-gltCode 2 ‘Stim : 1alc -1non_alc’
-gltCode 3 ‘Treatment : 1real -1sham Stim : 1alc -1non_alc’ \

Is the qvar in this case within of between subject variable?

Does AUQ1 vary within subject? If not, it’s a between-subjects variable; otherwise, it’s within subject.

Meaning of AUQ1 F?

It’s the main effect of AUQ1, which is the t-statistic value squared.

Why don’t I get AUQ1:Treatment, but only get AUQ1:Stim?

Because you didn’t ask for it. To get the interaction, try

-bsVars “Treatment*AUQ1” \

Thank you Gang!

This is from an old script that have worked without any errors or warnings. I have got the t-scores from the 3 -gltCodes. Would those results be faulty without the extra space before the colon?

So the variance of the other factors are not taken into account? It’s just the AUQ on its own?

Thanks!

My script above:


3dMVM -prefix covariates -dataTable @table_plus_covariates.txt -jobs 10 \
-mask mask+tlrc \
-bsVars "Treatment+AUQ1" \
-qVars "AUQ1" \
-wsVars Stim \
.... + glt

Gave me the interaction with “stim” without me explicitly telling it to? I just put in “Treatment+AUQ1” and defined my qVar as “AUQ1”. Also is it * or +? What is the difference? Should I change the + to a * or add another line?

According to the documentation you get interactions between the factors listed in -bsVars and -wsVars. That explains why I got the the interaction between AUQ1 and Stim. But to get the interaction between the two -bsVars" Treatment and AUQ1" the documentation sais that i should use colon : and not asterisk *. Asterisk meant A+B+A:B. So should it be:


1).   (original version)
3dMVM -prefix covariates -dataTable @table_plus_covariates.txt -jobs 10 \
-mask mask+tlrc \
-bsVars "Treatment+AUQ1" \
-qVars "AUQ1" \
-wsVars Stim \
.... + glt


2).   (using colon)
3dMVM -prefix covariates -dataTable @table_plus_covariates.txt -jobs 10 \
-mask mask+tlrc \
-bsVars "Treatment:AUQ1" \
-qVars "AUQ1" \
-wsVars Stim \
.... + glt


3).   (using *)
3dMVM -prefix covariates -dataTable @table_plus_covariates.txt -jobs 10 \
-mask mask+tlrc \
-bsVars "Treatment*AUQ1" \
-qVars "AUQ1" \
-wsVars Stim \
.... + glt

If I add more covariates (and the end goal is their main effects and their interactions with Treatment and Stim, how is that done?

Like this?


3).   (using *)
3dMVM -prefix covariates -dataTable @table_plus_covariates.txt -jobs 10 \
-mask mask+tlrc \
-bsVars "Treatment*AUQ1*AUQ2*AUQ3" \
-qVars "AUQ1" \
-wsVars Stim \
.... + glt

or


3).   (using *)
3dMVM -prefix covariates -dataTable @table_plus_covariates.txt -jobs 10 \
-mask mask+tlrc \
-bsVars "Treatment:AUQ1:AUQ2:AUQ3" \
-qVars "AUQ1" \
-wsVars Stim \
.... + glt

Sorry for these questions but I’m having some trouble understanding the documentation.

You only have one quantitative variable AUQ1, right? If so, what are AUQ2 and AUQ3?

There are two possible model specifications in your case:

  1. -bsVars “Treatment+AUQ1” \
  2. -bsVars “Treatment*AUQ1” \

With the 1) case, you assume no interaction between Treatment and AUQ1 while in 2) the interaction is considered. I would simply go with 2), and let the model detects the effects.

Thanks!

That solves the syntax. What would Treatment:ACQ1 mean then?

I started with only one quantitative covariate to get the script right. We also have a couple of more quantitative covariates that we would like to investigate. I call them ACQ2, ACQ3 etc (their real names differ). Would I just add them with:

“TreatmentACQ1ACQ2*ACQ3etc”?

Also, Would the main effect F-score of e.g Stim (or treatment) be affected by adding more covariates )since they perhaps explain some variance?

If that is the case should we beware of coloniarty between the quantitive covariates? They measure similar clinical outcomes (but slightly differently).

What would Treatment:ACQ1 mean then?

It means that you just want the interaction between Treatment and ACQ1 without modeling their respective main effects, which does not make sense and would not work.

Would I just add them with: “TreatmentACQ1ACQ2*ACQ3etc”?

Try

“TreatmentACQ1+TreatmentACQ2+Treatment*ACQ3”

Would the main effect F-score of e.g Stim (or treatment) be affected by adding more covariates )since they perhaps explain some variance?

It would.

If that is the case should we beware of coloniarty between the quantitive covariates? They measure similar clinical outcomes (but slightly differently).

You mean collinearity? Unless those variables are highly collinear, you should be fine.

Thanks, thanks and thanks! :slight_smile:

Much appreciated Gang!

And yes, that was a typo!

Hi Gang,

I ran into a follow up question to this thread. It’s the same data set.

We want to look at how treatment (Real or Sham) affects how the subjects react when looking at two different stimuli. I.e. the interaction Between the factors Treatment (levels: real and sham) and Stim (levels: stim1 and stim2 where stim2 is expected to be neutral).

We also want to correct for (covary out) the effects from the severity of the subjects medical condition (addiction) before the treatment since that may affect if one of the randomized group was more addicted than the other. So we want to introduce the qVar ADS.

How do I “simply” add that as a covariate so that the interaction I see between Treament*Stim takes the ADS into consideration?

I tried this:


3dMVM -prefix maching_pictures -dataTable @table.txt -jobs 10 \
-mask mask+tlrc \
-bsVars Treatment \
-wsVars "Stim" \
-qVars "ADS"

From our previous discussion I don’t get the interaction between any factor and the qVar since I don’t specify that but will the resulting F-scores take the ADS variance into account? When comparing with and without adding the qVar I think the results look identical…

So I also tried this:


3dMVM -prefix maching_anaticor -dataTable @table.txt -jobs 10 \
-mask mask+tlrc \
-bsVars "Treatment*ADS" \
-wsVars "Stim" \
-qVars "ADS"

Now the interaction TreatmentStim looks a bit different from the case of not including the qVar at all. Is that the case? Do you have to use TreatmentADS for it to take the qVar in account?

I also now get the interactions Treatment:ADS, Stim:ADS and Treatment:ADS:Stim.

Which one should I look at when just wanting to co-vary out the effect and what is the proper syntax?

Thanks!

Hi Robin,

-bsVars Treatment
-wsVars “Stim”
-qVars “ADS”

Since variable “ADS” is not specified under either -bsVars or -wsVars, it is not considered in the model, and that’s why you saw identical result with the script without the -qVars “ADS” part.

For the second model:

-bsVars “Treatment*ADS”
-wsVars “Stim”
-qVars “ADS”

All the possible interactions among the three variables are included in the model even though you’re only interested in the interaction of Treatment:Stim.

Now the interaction Treatment*Stim looks a bit different from the case of not including the qVar at all. Is that the case?

One question for you: do ADS differ substantially between the treatment groups? If so, you may want to center each group separately before you feed the ADS values into the script. See discussion here: https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/STATISTICS/center.html

Thanks for the fast reply!

The ADS qVAR for the two groups:

Group1(Real): N=18, AVERAGE = 20.27, SDEV = 8.66
Group2(Sham): N=21, AVERAGE=16.62, SDEV = 6.94

Would this be wise to center within group?

If centering within group is wise I would just subtract the average from each value within the groups before I feed them into the table, right?

Would this be wise to center within group?

The two groups do seem to differ substantially in terms of average age: the Sham group is at average 3.65 years older than the Real group: t-value = 4.55 with 37 degrees of freedom.

More importantly, how do you want to intercept those effects such the interaction of Treatment:Stim? At the overall average age of both groups or at each group’s own average age?

If centering within group is wise I would just subtract the average from each value within the groups before I feed them into the table, right?

Yes, that’s right.

Hi Gang.

It’s ADS, not age. I.e. an alcohol dependence score before treatment. Seems we got a bit unlucky since the randomised sham group seem to have started of more addicted than the real group. That is why I want to “control for” this ADS score. The findings we get form out fmri task post treatment could be due to differences between the groups before starting treatment (assuming treatment has no effect). The best we can do (since we don’t run the tasks pre treatment due to learning effects) is to control for addiction severity (ADS) collected before treatment.

You wrote:
More importantly, how do you want to intercept those effects such the interaction of Treatment:Stim? At the overall average age of both groups or at each group’s own average age?

Sorry, I don’t quite understand. What makes most sense for getting rid of findings between real Vs sham that originates from ADS differences?

Hi Robin,

Sorry I mistyped a word. I meant to say:

More importantly, how do you want to interpret those effects such as the interaction of Treatment:Stim? At the overall average ADS of both groups or at each group’s own average ADS?

Based on your most recent message, it sounds like you want to interpret the interaction effect of Treatment:Stim as both groups being controlled at the overall average ADS. In that case, you want to center ADS around the overall average for both groups.

The substantial difference in ADS between the two groups seems to explain what you’ve already observed as shown in a previous message of yours:

Now the interaction Treatment*Stim looks a bit different from the case of not including the qVar at all.

In your original model without ADS, the group difference and the interaction effect of TreatmentStim may partially reflect the difference of ADS. Once ADS is included in the model with centering around the overall ADS average, the group difference and the interaction effect of TreatmentStim would correspond to the situation when ADS is controlled at the overall average.

Thanks!

So I will not center them individually but use the values as are - Meaning they will be centered globally?

In a similar situation within 3dttest++: If I want to correct for something (like thse ADS data) how would i do that in 3dttest++? If I add it as a covariate I just get where the covariate has an inpact. I.e. it becomas a covariate of intetrest. Is it not possbile to add covariates of no interest in 3dttest++? Should 3dMEMA be used instead? I have never used 3dMEMA before (for the record). Just 3dttest++ and 3dMVM

Thanks!

I will not center them individually but use the values as are - Meaning they will be centered globally?

Yes. In that case, you don’t have to manually preform centering, the program (e.g., 3dMEMA, 3dttest++, 3dMVM, 3dLME) automatically centers around the overall mean.

Is it not possbile to add covariates of no interest in 3dttest++? Should 3dMEMA be used instead?

A variable of interest or no interest is simply a label for the investigator. From modeling perspective, a variable, regardless of its nature (being of interest or not), is treated the same in the model.

Thanks!

But in 3dttest++, if I add the covarates via -covaraties ADS_file.txt I get:

t-score for -SetA minus -SetB and the tscores for SetA and SetB by themselves AND all of these together with ADS. For example Real_minus_Sham_ADS.

So Real_minus_Sham would be the treatment effect while Real_minus_Sham is the treatment effect while taking ADS into account?

I would interperate that as where in the brain does ADS affect the difference between Real and Sham treatment. And you say that you could equally see it as where in the brain is there a diifference between Real and Sham “correcting” for ADS?

Real_minus_Sham would be the treatment effect while Real_minus_Sham is the treatment effect while taking ADS into account?

Real_minus_Sham is the treatment effect while ADS is controlled at the center value.