3dMVM one group two within subj variables

Dear experts,

I’m trying to set up a model to examine whether Age might affect the BOLD signal (8 tent functions) over time and space (i.e., when and where is the BOLD signal associated with Age). This is within one group (N=30) currently and kind of following Gang’s Example 3 at https://afni.nimh.nih.gov/sscc/gangc/BF.html. However, I can’t get it to work.

Here are two of my attempts:
3dMVM -prefix $output_dir/mvm_time_age
-mask $output_dir/some_mask+tlrc
-bsVars 1
-wsVars ‘TimeAge’
-qVars ‘Age’
-num_glt 8
-gltLabel 1 t0_Age -gltCode 1 'Time : 1
t0 Age : 1* Age’
-gltLabel 2 t1_Age -gltCode 2 ‘Time : 1t1 Age : 1 Age’
-gltLabel 3 t2_Age -gltCode 3 ‘Time : 1t2 Age : 1 Age’
-gltLabel 4 t3_Age -gltCode 4 ‘Time : 1t3 Age : 1 Age’
-gltLabel 5 t4_Age -gltCode 5 ‘Time : 1t4 Age : 1 Age’
-gltLabel 6 t5_Age -gltCode 6 ‘Time : 1t5 Age : 1 Age’
-gltLabel 7 t6_Age -gltCode 7 ‘Time : 1t6 Age : 1 Age’
-gltLabel 8 t7_Age -gltCode 8 ‘Time : 1t7 Age : 1 Age’
-dataTable
Subj Time Group Age Gender InputFile
01 t0 control 67 M $input_dir/01.results/stats.01_REML+tlrc’[bh#0_Coef]’
01 t1 control 67 M $input_dir/01.results/stats.01_REML+tlrc’[bh#1_Coef]’
01 t2 control 67 M $input_dir/01.results/stats.01_REML+tlrc’[bh#2_Coef]’

02 t0 control 70 M $input_dir/02.results/stats.02_REML+tlrc’[bh#0_Coef]’
02 t1 control 70 M $input_dir/02.results/stats.02_REML+tlrc’[bh#1_Coef]’
02 t2 control 70 M $input_dir/02.results/stats.02_REML+tlrc’[bh#2_Coef]’

Error message:

Error:
Quitting due to model test failure…
There were 50 or more warnings (use warnings() to see the first 50)

3dMVM -prefix $output_dir/mvm_time_age
-mask $output_dir/some_mask+tlrc
-bsVars 1
-wsVars ‘TimeAge’
-num_glt 8
-gltLabel 1 t0_Age -gltCode 1 'Time : 1
t0 Age : 1* Age’
-gltLabel 2 t1_Age -gltCode 2 ‘Time : 1t1 Age : 1 Age’
-gltLabel 3 t2_Age -gltCode 3 ‘Time : 1t2 Age : 1 Age’
-gltLabel 4 t3_Age -gltCode 4 ‘Time : 1t3 Age : 1 Age’
-gltLabel 5 t4_Age -gltCode 5 ‘Time : 1t4 Age : 1 Age’
-gltLabel 6 t5_Age -gltCode 6 ‘Time : 1t5 Age : 1 Age’
-gltLabel 7 t6_Age -gltCode 7 ‘Time : 1t6 Age : 1 Age’
-gltLabel 8 t7_Age -gltCode 8 ‘Time : 1t7 Age : 1 Age’
-dataTable
Subj Time Group Age Gender InputFile
01 t0 control 67 M $input_dir/01.results/stats.01_REML+tlrc’[bh#0_Coef]’
01 t1 control 67 M $input_dir/01.results/stats.01_REML+tlrc’[bh#1_Coef]’
01 t2 control 67 M $input_dir/01.results/stats.01_REML+tlrc’[bh#2_Coef]’

02 t0 control 70 M $input_dir/02.results/stats.02_REML+tlrc’[bh#0_Coef]’
02 t1 control 70 M $input_dir/02.results/stats.02_REML+tlrc’[bh#1_Coef]’
02 t2 control 70 M $input_dir/02.results/stats.02_REML+tlrc’[bh#2_Coef]’

Error message:

Inappropriate coding in test No.1!

I’d be very grateful about pointers where I may have gone wrong.

Thanks a lot in advance!

Nic

Nic,

I assume that the variable “Age” does not change across those time points for each subject, so it should be considered as a between- (not within-) subject variable. In addition, you need to declare that “Age” is a quantitative variable:

-bsVars ‘Age’
-wsVars ‘Time’
-qVars ‘Age’ \

Hi Gang,

Thank you for your quick answer! I was under the wrong impression that -bsVars is only to be used if I have two groups or more.

I followed your suggestion but got the following error:

** Error:
Failed at GLT No. 1! Make sure that the model or GLT specification syntax is correct.

This was the cmd:

3dMVM -prefix $output_dir/mvm_time_age
-mask $output_dir/some_mask_intersection_dia1+tlrc
-bsVars ‘Age’
-wsVars ‘Time’
-qVars ‘Age’
-num_glt 8
-gltLabel 1 t0_Age -gltCode 1 ‘Time : 1t0 Age : 1Age’
-gltLabel 2 t1_Age -gltCode 2 ‘Time : 1t1 Age : 1Age’
-gltLabel 3 t2_Age -gltCode 3 ‘Time : 1t2 Age : 1Age’
-gltLabel 4 t3_Age -gltCode 4 ‘Time : 1t3 Age : 1Age’
-gltLabel 5 t4_Age -gltCode 5 ‘Time : 1t4 Age : 1Age’
-gltLabel 6 t5_Age -gltCode 6 ‘Time : 1t5 Age : 1Age’
-gltLabel 7 t6_Age -gltCode 7 ‘Time : 1t6 Age : 1Age’
-gltLabel 8 t7_Age -gltCode 8 ‘Time : 1t7 Age : 1Age’
-dataTable
Subj Time Gender Group Age InputFile
01 t0 Male Control 67 $input_dir/01.results/stats.01_REML+tlrc’[bh#0_Coef]’

This is another warning message I got - does it have to do with the glts?


Warning messages:
1: NAs introduced by coercion
2: NAs introduced by coercion
3: NAs introduced by coercion
4: NAs introduced by coercion
5: NAs introduced by coercion
6: NAs introduced by coercion
7: NAs introduced by coercion
8: NAs introduced by coercion
Loading required package: lme4
Loading required package: Matrix
Loading required package: reshape2
Loading required package: lsmeans
Loading required package: estimability


Welcome to afex. Important changes in the current version:

  • Functions for ANOVAs have been renamed to: aov_car(), aov_ez(), and aov_4().
  • ANOVA functions return an object of class ‘afex_aov’ as default, see: ?aov_car
  • ‘afex_aov’ objects can be passed to lsmeans for contrasts and follow-up tests.
  • Reset previous (faster) behavior via: afex_options(return_aov=‘nice’)
  • Many more arguments can now be set globally via options, see: afex_options()

Warning message:
package ‘lsmeans’ was built under R version 3.2.3
Loading required package: car
Warning message:
package ‘car’ was built under R version 3.2.3

++++++++++++++++++++++++++++++++++++++++++++++++++++
***** Summary information of data structure *****

Thank you so much for your help!

Nic

Nic, the specifications for those 8 post hoc tests don’t make sense to me. What exactly are you looking for: the age effect at each time point? If so, it should be something like:

-gltLabel 1 t0_Age -gltCode 1 ‘Time : 1*t0 Age :’ \

If you just want the effect at each time point with Time being controlled at the average, do this:

-gltLabel 1 t0_Age -gltCode 1 ‘Time : 1*t0’ \