Adding third variable breaks MVM

I’m trying to run an MVM that has three within-subjects variables: difficulty, scent, and rating. Whenever I run it, I keep getting a message that something is incorrect in the model. We’ve tried adjusting it several times and removing other contrasts to see where the error is coming from. I’ve been able to figure out that the problem appears to be in the rating factor. The model runs fine when I run it with just difficulty and scent, but as soon as I add rating, it breaks. I’ve tried it both as a quantitative variable and as a regular factor and neither of these work. I’ve added a sample of the script below (Less some of the data table for space). We are running the analysis on 34 subjects. Any help would be greatly appreciated.

3dMVM -prefix MVM_rating -jobs 12 -mask mni_brain_mask+tlrc
-wsVars “difficultyscentrating”
-dataTable
Subj rating scent difficulty InputFile
3 5 blend hard /Volumes/aroma/subjects/3/‘deconv1_blur8_ANTS_resampled+tlrc[1]’
3 5 blend easy /Volumes/aroma/subjects/3/‘deconv1_blur8_ANTS_resampled+tlrc[3]’
3 5 laven hard /Volumes/aroma/subjects/3/‘deconv1_blur8_ANTS_resampled+tlrc[5]’
3 5 laven easy /Volumes/aroma/subjects/3/‘deconv1_blur8_ANTS_resampled+tlrc[7]’
3 5 coco hard /Volumes/aroma/subjects/3/‘deconv1_blur8_ANTS_resampled+tlrc[9]’
3 5 coco easy /Volumes/aroma/subjects/3/‘deconv1_blur8_ANTS_resampled+tlrc[11]’
4 7 blend hard /Volumes/aroma/subjects/4/‘deconv1_blur8_ANTS_resampled+tlrc[1]’
4 7 blend easy /Volumes/aroma/subjects/4/‘deconv1_blur8_ANTS_resampled+tlrc[3]’
4 4 laven hard /Volumes/aroma/subjects/4/‘deconv1_blur8_ANTS_resampled+tlrc[5]’
4 4 laven easy /Volumes/aroma/subjects/4/‘deconv1_blur8_ANTS_resampled+tlrc[7]’
4 4 coco hard /Volumes/aroma/subjects/4/‘deconv1_blur8_ANTS_resampled+tlrc[9]’
4 4 coco easy /Volumes/aroma/subjects/4/‘deconv1_blur8_ANTS_resampled+tlrc[11]’
7 6 blend hard /Volumes/aroma/subjects/7/‘deconv1_blur8_ANTS_resampled+tlrc[1]’
7 6 blend easy /Volumes/aroma/subjects/7/‘deconv1_blur8_ANTS_resampled+tlrc[3]’
7 8 laven hard /Volumes/aroma/subjects/7/‘deconv1_blur8_ANTS_resampled+tlrc[5]’
7 8 laven easy /Volumes/aroma/subjects/7/‘deconv1_blur8_ANTS_resampled+tlrc[7]’
7 7 coco hard /Volumes/aroma/subjects/7/‘deconv1_blur8_ANTS_resampled+tlrc[9]’
7 7 coco easy /Volumes/aroma/subjects/7/‘deconv1_blur8_ANTS_resampled+tlrc[11]’
8 3 blend hard /Volumes/aroma/subjects/8/‘deconv1_blur8_ANTS_resampled+tlrc[1]’
8 3 blend easy /Volumes/aroma/subjects/8/‘deconv1_blur8_ANTS_resampled+tlrc[3]’
8 8 laven hard /Volumes/aroma/subjects/8/‘deconv1_blur8_ANTS_resampled+tlrc[5]’
8 8 laven easy /Volumes/aroma/subjects/8/‘deconv1_blur8_ANTS_resampled+tlrc[7]’
8 5 coco hard /Volumes/aroma/subjects/8/‘deconv1_blur8_ANTS_resampled+tlrc[9]’
8 5 coco easy /Volumes/aroma/subjects/8/‘deconv1_blur8_ANTS_resampled+tlrc[11]’
9 7 blend hard /Volumes/aroma/subjects/9/‘deconv1_blur8_ANTS_resampled+tlrc[1]’
9 7 blend easy /Volumes/aroma/subjects/9/‘deconv1_blur8_ANTS_resampled+tlrc[3]’
9 5 laven hard /Volumes/aroma/subjects/9/‘deconv1_blur8_ANTS_resampled+tlrc[5]’
9 5 laven easy /Volumes/aroma/subjects/9/‘deconv1_blur8_ANTS_resampled+tlrc[7]’
9 8 coco hard /Volumes/aroma/subjects/9/‘deconv1_blur8_ANTS_resampled+tlrc[9]’
9 8 coco easy /Volumes/aroma/subjects/9/‘deconv1_blur8_ANTS_resampled+tlrc[11]’ \

Could you provide the following?

  1. the output of the following command:

afni -ver

  1. all the content on the terminal when you run the 3dMVM script

The output of afni -ver shows:

Precompiled binary macosx_10.7_local: Mar 21 2017 (Version AFNI_17.0.16)

Here’s the full content of the terminal when I run the MVM:

Loading required package: lme4
Loading required package: Matrix
Loading required package: lsmeans
Loading required package: estimability


Welcome to afex. For support visit: http://afex.singmann.science/

  • Functions for ANOVAs: aov_car(), aov_ez(), and aov_4()
  • Methods for calculating p-values with mixed(): ‘KR’, ‘S’, ‘LRT’, and ‘PB’
  • ‘afex_aov’ and ‘mixed’ objects can be passed to lsmeans() for follow-up tests
  • Get and set global package options with: afex_options()
  • Set orthogonal sum-to-zero contrasts globally: set_sum_contrasts()
  • For example analyses see: browseVignettes(“afex”)

Attaching package: ‘afex’

The following object is masked from ‘package:lme4’:

lmer

Loading required package: car

++++++++++++++++++++++++++++++++++++++++++++++++++++
***** Summary information of data structure *****
34 subjects : 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 3 30 31 32 33 34 35 37 38 39 4 40 7 8 9
204 response values
8 levels for factor rating : 2 3 4 5 6 7 8 9
3 levels for factor scent : blend coco laven
2 levels for factor difficulty : easy hard
0 post hoc tests

Contingency tables of subject distributions among the categorical variables:

, , rating = 2

      scent

difficulty blend coco laven
easy 3 0 0
hard 3 0 0

, , rating = 3

      scent

difficulty blend coco laven
easy 3 2 1
hard 3 2 1

, , rating = 4

      scent

difficulty blend coco laven
easy 7 6 4
hard 7 6 4

, , rating = 5

      scent

difficulty blend coco laven
easy 3 16 3
hard 3 16 3

, , rating = 6

      scent

difficulty blend coco laven
easy 7 4 2
hard 7 4 2

, , rating = 7

      scent

difficulty blend coco laven
easy 9 3 12
hard 9 3 12

, , rating = 8

      scent

difficulty blend coco laven
easy 2 3 10
hard 2 3 10

, , rating = 9

      scent

difficulty blend coco laven
easy 0 0 2
hard 0 0 2

Tabulation of subjects against each of the categorical variables:

lop$nSubj vs rating:
    
     2 3 4 5 6 7 8 9
  10 0 0 0 2 0 4 0 0
  11 0 0 2 2 0 2 0 0
  12 0 0 0 4 0 2 0 0
  13 0 2 0 0 2 2 0 0
  14 0 0 0 2 2 0 2 0
  15 0 0 4 0 0 2 0 0
  16 0 2 0 0 0 0 2 2
  17 0 0 2 2 2 0 0 0
  18 0 2 0 2 0 0 2 0
  19 0 0 2 0 0 4 0 0
  20 0 0 0 0 2 4 0 0
  22 0 0 0 2 0 2 0 2
  23 0 2 0 0 0 2 2 0
  24 0 0 0 4 0 2 0 0
  25 0 0 0 2 2 0 2 0
  26 2 0 2 0 0 0 2 0
  27 0 2 2 0 0 0 2 0
  28 0 0 2 0 0 4 0 0
  29 0 0 0 4 0 2 0 0
  3  0 0 0 6 0 0 0 0
  30 0 0 0 0 2 2 2 0
  31 0 0 0 2 2 0 2 0
  32 0 0 2 0 2 2 0 0
  33 0 0 0 0 2 2 2 0
  34 0 0 2 2 2 0 0 0
  35 2 0 0 0 2 2 0 0
  37 0 0 2 2 0 0 2 0
  38 0 0 4 0 0 2 0 0
  39 2 0 2 2 0 0 0 0
  4  0 0 4 0 0 2 0 0
  40 0 0 2 0 2 0 2 0
  7  0 0 0 0 2 2 2 0
  8  0 2 0 2 0 0 2 0
  9  0 0 0 2 0 2 2 0

lop$nSubj vs scent:

 blend coco laven

10 2 2 2
11 2 2 2
12 2 2 2
13 2 2 2
14 2 2 2
15 2 2 2
16 2 2 2
17 2 2 2
18 2 2 2
19 2 2 2
20 2 2 2
22 2 2 2
23 2 2 2
24 2 2 2
25 2 2 2
26 2 2 2
27 2 2 2
28 2 2 2
29 2 2 2
3 2 2 2
30 2 2 2
31 2 2 2
32 2 2 2
33 2 2 2
34 2 2 2
35 2 2 2
37 2 2 2
38 2 2 2
39 2 2 2
4 2 2 2
40 2 2 2
7 2 2 2
8 2 2 2
9 2 2 2

lop$nSubj vs difficulty:
    
     easy hard
  10    3    3
  11    3    3
  12    3    3
  13    3    3
  14    3    3
  15    3    3
  16    3    3
  17    3    3
  18    3    3
  19    3    3
  20    3    3
  22    3    3
  23    3    3
  24    3    3
  25    3    3
  26    3    3
  27    3    3
  28    3    3
  29    3    3
  3     3    3
  30    3    3
  31    3    3
  32    3    3
  33    3    3
  34    3    3
  35    3    3
  37    3    3
  38    3    3
  39    3    3
  4     3    3
  40    3    3
  7     3    3
  8     3    3
  9     3    3

***** End of data structure information *****
++++++++++++++++++++++++++++++++++++++++++++++++++++

Reading input files now...

Reading input files: Done!

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 afex and phia have been installed. See the 3dMVM
help documentation for more details.

1) Inappropriate model specification with options -bsVars, -wsVars, or -qVars.
Note that within-subject or repeated-measures variables have to be declared
with -wsVars.

2) Incorrect 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 header
would cause grief for 3dMVM.

5) Not enough number of subjects. This may happen when there are two or more
withi-subject factors. For example, a model with two within-subject factors with
m and n levels respectively requires more than (m-1)*(n-1) subjects to be able to
model the two-way interaction with the multivariate approach.

It looks like that not all of the three factors are within-subject as you thought. More specifically “rating” is a between-subjects factor, and you may want to change your 3dMVM script from

-wsVars “difficultyscentrating” \

to

-bsVars “rating”
-wsVars “difficulty*scent” \