3dMVM: Qvars that vary across conditions

Hey AFNI-experts,

We are using 3dMVM for factorial analysis. In the current experiment we have 2 factors: Order (P1,S1) and Event(P,S). This is an event P or S happening and the order is which one happened first. This is of course to balance the experiment, if the order matters. The table looks something like:


Subj  Order   Event                 InputFile                         \
  s1    S1         S                        s1+tlrc'[S_beta]'             \
  s1    S1          P                        s1+tlrc'[P_beta]'             \
  s2    P1          S                        s1+tlrc'[S_beta]'             \
  s2    P1          P                        s1+tlrc'[P_beta]'             \

I.e. subjects 1 got event S first and then P. Subjects 2 got event P first and then S.

Now we want to add a qualitative variable. If it was age it would be simple:


Subj  Order   Event      Age           InputFile                         \
  s1    S1          S             24           s1+tlrc'[S_beta]'             \
  s1    S1          P             24           s1+tlrc'[P_beta]'             \
  s2    P1          S             30           s1+tlrc'[S_beta]'             \
  s2    P1          P             30           s1+tlrc'[P_beta]'             \

But we now have a quantitative measure per condition. I.e. we have a rating from when the subject experiences event S and one for event P. Would I use 2 different q-vars and leave every other empty or can the q-var vary across the events?

Suggestion1:


Subj  Order   Event      Q_rating           InputFile                         \
  s1    S1          S             10                 s1_s+tlrc'[S_beta]'             \
  s1    S1          P             8                   s1_p+tlrc'[P_beta]'             \
  s2    P1          S             2                   p1_s+tlrc'[S_beta]'             \
  s2    P1          P             7                   p1_p+tlrc'[P_beta]'             \

Suggestion2:


Subj  Order   Event      Q_ratingS1   Q_ratingP1        InputFile                         \
  s1    S1          S             10                                                s1_s+tlrc'[S_beta]'             \
  s1    S1          P             8                                                   s1_p+tlrc'[P_beta]'             \
  s2    P1          S                                     2                           p1_s+tlrc'[S_beta]'             \
  s2    P1          P                                      7                          p1_p+tlrc'[P_beta]'             \

Suggestion 1 seems most reasonable but can the q-var have different values for the same subject within the same q-var? What we want to find out is if the subject rating is co-varying with the betas in some brain region taking the factors into account.

Thanks!

You have a within-subject covariate, so use 3dLME and follow Example 2 in the help (RT in that script). Be careful about the centering issue: You may have to check whether Q_rating differs on average across the levels of Order and Event.

Thanks!

Same faktors as before: Order (P1,S1) and Event(P,S), adding qvar/covariate.
P = partner
S = stranger
P1 = partner as first event
S1 = stranger as first event

Here S1 = S for subjects who got S1
Here P1 = P for subjects who got P1

By looking at one condition at a time using 3dttest with our covariates (i.e. 3dttest++ S1 with covarate VS 0 and 3dttest++ P1 with covarate VS 0) we see interesting areas for the covariate t-stat output. Now we want to compare the covariate output from [3dttest++ S1 with cov VS 0] with the results from [3dttest++ S2 with cov VS 0]. We can’t run 3dttest++ where setA is S1 and setB is P1 since we can’t create a covariate list that is the difference between the covariates since the groups don’t have the same size.

Should we:

  1. Run a 3rd 3dttest:
    a: [3dttest++ S1 +cov VS 0]
    b:[3dttest++ S2 +cov VS 0]
    c: [3dttest++ setA = coef from a -setB coef from b]
    This seems kind of fishy…

  2. Run 3dLME with all levels (Order: S1,P1, Event: S,P) and a glt option where we just use S1 and P1?
    The problem here is that 3dLME, just like 3dMVM, to my knowlage does not give a special output of the covariate effect like 3dttest++. 3dttest++, using covariates, gives the coef/t-score without the covariate and a sub-brik of the voxels where the covariate has a signficiant covarying effect. 3LME or 3dMVM with qvars just gives the effects of the factor and I would not know if the voxel is significant because of the factor or because of the qvariable.

  3. Run 3dMVM only using S1 and P1 with qvars as the covrate (to get arround unequal group sizes and since the qvar does not vary within subject we don’t have to juse 3dLME).
    Same issue as abovie: No qvars output from 3dMVM.

Thanks!

It seems to me that you can se 3dLME to achieve your goal.

3dLME, just like 3dMVM, to my knowlage does not give a special output of the covariate effect like 3dttest++

This is not true. The following line of example 2 in the 3dLME help is for checking the covariate effect:

-gltLabel 3 ‘House-AgeEff’ -gltCode 3 ‘cond : 1*House age :’

Thanks Gang!

I have never used 3dLME so I need a little help with the setup. Do you need to use glt to get the covariate effect? Should it not be enough with the F-score?

We get an error:


If the program hangs here for more than, for example, half an hour,\
kill the process because the model specification or the GLT coding\
is likely inappropriate.\
\
~~~~~~~~~~~~~~~~~~~ Model test failed  ~~~~~~~~~~~~~~~~~~~\
Possible reasons:\
\
0) Make sure that R packages nlme and phia have been installed. See the 3dLME\
help documentation for more details.\
\
1) Inappropriate model specification with options -model, or -qVars.\
\
2) In correct specifications in general linear test coding with -gltCode.\
\
3) Mistakes in data table. Check the data structure shown above, and verify\
whether there are any inconsistencies.\
\
4) Inconsistent variable names which are case sensitive. For example, factor\
named Group in model specification and then listed as group in the table hader\
would cause grief for 3dLME.\
\
** Error: \
   Quitting due to model test failure...\

This is the command:


3dLME -prefix order -jobs 30 \
-model "Toucher*Order*Oxy" \
-qVars "Oxy" \
-ranEff '-1' \
-SS_type 3 \
-dataTable @covariates_tables/table.txt

Just pasted in -SS_type and -ranEff but I don’t quite understand what they mean of if you have to specify them…

Part of the table:


Subj	Toucher	Order	Oxy	InputFile\
S02	Partner	One	1.5	/fenix/users/giono/analysis/oxy/first_level/nosite_new/sub_02/stats.02_partner_REML+tlrc[1]\
S02	Stranger	One	1.16	/fenix/users/giono/analysis/oxy/first_level/nosite_new/sub_02/stats.02_stranger_REML+tlrc[1]\
S04	Partner	Two	1.06	/fenix/users/giono/analysis/oxy/first_level/nosite_new/sub_04/stats.04_partner_REML+tlrc[1]\
S04	Stranger	Two	1.46	/fenix/users/giono/analysis/oxy/first_level/nosite_new/sub_04/stats.04_stranger_REML+tlrc[1]\
S05	Partner	One	0.69	/fenix/users/giono/analysis/oxy/first_level/nosite_new/sub_05/stats.05_partner_REML+tlrc[1]\
S05	Stranger	One	2.90	/fenix/users/giono/analysis/oxy/first_level/nosite_new/sub_05/stats.05_stranger_REML+tlrc[1]\
...

Do you need to use glt to get the covariate effect?

3dLME would provide an F-test for each variable, but you may need to use GLT to figure out the sign of the covariate effect. Follow the following GLT specification from example 2 in the 3dLME help:

-gltLabel 3 ‘House-AgeEff’ -gltCode 3 ‘cond : 1*House age :’

Change the following line your 3dLME script

-ranEff ‘-1’ \

to

-ranEff ‘~1+Oxy’ \

Thank you Gang!

I usually just use the F and explore direction via beta extraction from the cluster given by threholding the F-score. Reasonable?

Would you pleae elaborate about the mening of -ranEff ‘~1+Oxy’ ?

I’m not quite sure how to interperate that.

many thanks!

I usually just use the F and explore direction via beta extraction from the cluster given by threholding the F-score. Reasonable?

In this case if you don’t request for the GLT for the covariate, you would only get the F-stat, which doesn’t reveal the sign.

Would you pleae elaborate about the mening of -ranEff ‘~1+Oxy’ ?

With

-ranEff ‘~1’

you assume that each subject deviates from the group only in the intercept, while

‘~1+Oxy’

assumes that each subject varies in both the intercept and the slope (the effect of ‘Oxy’).

Thanks Gang!

A gltCode syntax question for 3dMVM.

We now have:
-bsVars Order \ (1 if partner first ; 2 if stranger first)
-wsVars Toucher \ (partner if partner touch the subjects arm ; stranger if stranger touch the subjects arm)

We would also like 3dMVM to compute a t-score for comparing Partner (when beeing first toucher) and Stranger (when beeing first toucher).
I.e. we want to compare two levels from different factors:

  • Order1: Partner
  • Order2: Stranger

How do we get that-score?

Our current setup:


3dMVM -prefix order2 -jobs 30 \
-mask new_mask+tlrc \
-bsVars Order \
-wsVars Toucher \
-dataTable @covariates_tables/table.txt \
-num_glt 4 \
-gltLabel 1 Toucher \
-gltCode 1 'Toucher: 1*Partner -1*Stranger' \
-gltLabel 2 Order \
-gltCode 2 'Order: 1*One -1*Two' \
-gltLabel 3 ToucherXOrder \
-gltCode 3 'Toucher: 1*Partner -1*Stranger Order: 1*One -1*Two' \
-gltLabel 4 P1_vs_S1 \
-gltCode 4 '  \

glt1: All partner vs all stranger
glt2: All first touchers vs second toucher
glt3: Interaction between Toucher and Order
glt4: ? see abouw

Robin,

We would also like 3dMVM to compute a t-score for comparing Partner (when beeing first toucher) and Stranger (when beeing first toucher).

Perform a two-sample t-test outside of 3dMVM with, for example, 3dttest++.

Thanks Gang!

But the reason for us wanting to use MVM was due to unequal sample sizes. They differ a biy which makes 3dtrest++ tricky

Robin, 3dttest++ can handle unequal sample size properly in the case of two-sample t-test. What is the tricky part?

Thanks Gang,
It was a miss-comminication with the person I’m asking for. It was an not a paired T-ttest, which ofc can be run with un-equal groups. I was under the impression that it was paired.

Thanks and I appologize!