2-group comparison using AFNI

Hi,

I have data from two studies that used different types of stimuli (sentence vs. word movies), but both types of stimuli have five different modalities (e.g., noisy vs. clear movie, etc.). The participants are different and with uneven numbers (20 vs. 15) in the two studies.

I would like to compare these two groups, so basically I have 3 factors:
Factor A: stimuli type has 2 levels:
1) sentence; 2) word
Factor B: stimuli modality has 5 levels:
Factor C: SUBJECTS (random effect, but I have uneven numbers here, 20 subjects for study1 and 15 for study2)

I am mostly interested in the interaction between Factor A * Factor B
Which AFNI function should I use for testing?

Thank you so much for helping!

Yue Zhang

Yue, use 3dMVM.

Thank you, Gang.

Here is the script I tried:
3dMVM -prefix SentenceWordVol -jobs 4
-bsVars ‘group’
-wsVars ‘conditionnoisy’
-num_glt 9
-gltLabel 1 A_btngrp -gltCode 1 'group : 1
sentence -1word condition : 1A’
-gltLabel 2 AV_btngrp -gltCode 2 ‘group : 1sentence -1word condition : 1AV’
-gltLabel 3 V_btngrp -gltCode 3 'group : 1
sentence -1word condition : 1V’
-gltLabel 4 An_btngrp -gltCode 4 ‘group : 1sentence -1word condition : 1A noisy : 1yes’
-gltLabel 5 Ac_btngrp -gltCode 5 ‘group : 1sentence -1word condition : 1A noisy : 1no’
-gltLabel 6 AnV_btngrp -gltCode 6 ‘group : 1sentence -1word condition : 1AV noisy : 1yes’
-gltLabel 7 AcV_btngrp -gltCode 7 ‘group : 1sentence -1word condition : 1AV noisy : 1no’
-gltLabel 8 A_AV_by_group -gltCode 8 ‘group : 1sentence -1word condition : 1A -1AV’
-gltLabel 9 diff_of_diff -gltCode 9 ‘group : 1sentence -1word condition : 1A -1AV noisy : 1yes -1no’
-dataTable @table.txt

Here is the error I got in the terminal:
Error in seq.default(wd + ii, len, wd) : wrong sign in ‘by’ argument
Calls: process.MVM.opts → data.frame → cbind → seq → seq.default
Execution halted

Did I not set my contrasts correct?

thank you so much for helping!

Yue

Yue,

One possibility is that something is not structured properly in the file table.txt. See if you could use the 3dMVM validator to sort it out:

https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/tutorials/3dMVM_validator/main_toc.html

Thank you for the fast reply, Gang.

I was able to start this script:

3dMVM -prefix SentenceWordVol -jobs 4
-bsVars ‘group’
-wsVars ‘conditionnoisy’
-num_glt 9
-SC
-gltLabel 1 A_btngrp -gltCode 1 'group : 1
sentence -1word condition : 1A’
-gltLabel 2 AV_btngrp -gltCode 2 ‘group : 1sentence -1word condition : 1AV’
-gltLabel 3 V_btngrp -gltCode 3 'group : 1
sentence -1word condition : 1V’
-gltLabel 4 An_btngrp -gltCode 4 ‘group : 1sentence -1word condition : 1A noisy : 1yes’
-gltLabel 5 Ac_btngrp -gltCode 5 ‘group : 1sentence -1word condition : 1A noisy : 1no’
-gltLabel 6 AnV_btngrp -gltCode 6 ‘group : 1sentence -1word condition : 1AV noisy : 1yes’
-gltLabel 7 AcV_btngrp -gltCode 7 ‘group : 1sentence -1word condition : 1AV noisy : 1no’
-gltLabel 8 A_AV_by_group -gltCode 8 ‘group : 1sentence -1word condition : 1A -1AV’
-gltLabel 9 diff_of_diff -gltCode 9 ‘group : 1sentence -1word condition : 1A -1AV noisy : 1yes -1no’
-dataTable @table.txt

After ~10min, I got an error:

Possible reasons:

0) Make sure that R packages afex and phia have been installed. See the 3dMVM
help documentation for more details.
....
....
** Error: 
   Quitting due to model test failure...

I was trying to run: @3dMVM_validator -dataTable ~/table.csv
OR
@3dMVM_validator -dataTable ~/table.txt
Got the error: @3dMVM_validator: Command not found.

I definitely have the R packages installed.
And my table.txt looks like this:

Subj	group	condition	noisy	InputFile	\
QO	sentence	A	no	stats.QO+tlrc[1]	\
QO	sentence	V	no	stats.QO+tlrc[4]	\
QO	sentence	AV	no	stats.QO+tlrc[7]	\
QO	sentence	A	yes	stats.QO+tlrc[10]	\
QO	sentence	AV	yes	stats.QO+tlrc[13]	\
QP	sentence	A	no	stats.QP+tlrc[1]	\
QP	sentence	V	no	stats.QP+tlrc[4]	\
QP	sentence	AV	no	stats.QP+tlrc[7]	\
QP	sentence	A	yes	stats.QP+tlrc[10]	\
QP	sentence	AV	yes	stats.QP+tlrc[13]	\
QQ	sentence	A	no	stats.QQ+tlrc[1]	\
QQ	sentence	V	no	stats.QQ+tlrc[4]	\
QQ	sentence	AV	no	stats.QQ+tlrc[7]	\
QQ	sentence	A	yes	stats.QQ+tlrc[10]	\
QQ	sentence	AV	yes	stats.QQ+tlrc[13]	\
QR	sentence	A	no	stats.QR+tlrc[1]	\
QR	sentence	V	no	stats.QR+tlrc[4]	\
QR	sentence	AV	no	stats.QR+tlrc[7]	\
QR	sentence	A	yes	stats.QR+tlrc[10]	\
QR	sentence	AV	yes	stats.QR+tlrc[13]	\
QS	sentence	A	no	stats.QS+tlrc[1]	\
QS	sentence	V	no	stats.QS+tlrc[4]	\
QS	sentence	AV	no	stats.QS+tlrc[7]	\
QS	sentence	A	yes	stats.QS+tlrc[10]	\
QS	sentence	AV	yes	stats.QS+tlrc[13]	\
QT	sentence	A	no	stats.QT+tlrc[1]	\
QT	sentence	V	no	stats.QT+tlrc[4]	\
QT	sentence	AV	no	stats.QT+tlrc[7]	\
QT	sentence	A	yes	stats.QT+tlrc[10]	\
QT	sentence	AV	yes	stats.QT+tlrc[13]	\
QU	sentence	A	no	stats.QU+tlrc[1]	\
QU	sentence	V	no	stats.QU+tlrc[4]	\
QU	sentence	AV	no	stats.QU+tlrc[7]	\
QU	sentence	A	yes	stats.QU+tlrc[10]	\
QU	sentence	AV	yes	stats.QU+tlrc[13]	\
QV	sentence	A	no	stats.QV+tlrc[1]	\
QV	sentence	V	no	stats.QV+tlrc[4]	\
QV	sentence	AV	no	stats.QV+tlrc[7]	\
QV	sentence	A	yes	stats.QV+tlrc[10]	\
QV	sentence	AV	yes	stats.QV+tlrc[13]	\
QW	sentence	A	no	stats.QW+tlrc[1]	\
QW	sentence	V	no	stats.QW+tlrc[4]	\
QW	sentence	AV	no	stats.QW+tlrc[7]	\
QW	sentence	A	yes	stats.QW+tlrc[10]	\
QW	sentence	AV	yes	stats.QW+tlrc[13]	\
QX	sentence	A	no	stats.QX+tlrc[1]	\
QX	sentence	V	no	stats.QX+tlrc[4]	\
QX	sentence	AV	no	stats.QX+tlrc[7]	\
QX	sentence	A	yes	stats.QX+tlrc[10]	\
QX	sentence	AV	yes	stats.QX+tlrc[13]	\
QY	sentence	A	no	stats.QY+tlrc[1]	\
QY	sentence	V	no	stats.QY+tlrc[4]	\
QY	sentence	AV	no	stats.QY+tlrc[7]	\
QY	sentence	A	yes	stats.QY+tlrc[10]	\
QY	sentence	AV	yes	stats.QY+tlrc[13]	\
QZ	sentence	A	no	stats.QZ+tlrc[1]	\
QZ	sentence	V	no	stats.QZ+tlrc[4]	\
QZ	sentence	AV	no	stats.QZ+tlrc[7]	\
QZ	sentence	A	yes	stats.QZ+tlrc[10]	\
QZ	sentence	AV	yes	stats.QZ+tlrc[13]	\
RA	sentence	A	no	stats.RA+tlrc[1]	\
RA	sentence	V	no	stats.RA+tlrc[4]	\
RA	sentence	AV	no	stats.RA+tlrc[7]	\
RA	sentence	A	yes	stats.RA+tlrc[10]	\
RA	sentence	AV	yes	stats.RA+tlrc[13]	\
RB	sentence	A	no	stats.RB+tlrc[1]	\
RB	sentence	V	no	stats.RB+tlrc[4]	\
RB	sentence	AV	no	stats.RB+tlrc[7]	\
RB	sentence	A	yes	stats.RB+tlrc[10]	\
RB	sentence	AV	yes	stats.RB+tlrc[13]	\
RC	sentence	A	no	stats.RC+tlrc[1]	\
RC	sentence	V	no	stats.RC+tlrc[4]	\
RC	sentence	AV	no	stats.RC+tlrc[7]	\
RC	sentence	A	yes	stats.RC+tlrc[10]	\
RC	sentence	AV	yes	stats.RC+tlrc[13]	\
RD	sentence	A	no	stats.RD+tlrc[1]	\
RD	sentence	V	no	stats.RD+tlrc[4]	\
RD	sentence	AV	no	stats.RD+tlrc[7]	\
RD	sentence	A	yes	stats.RD+tlrc[10]	\
RD	sentence	AV	yes	stats.RD+tlrc[13]	\
RE	sentence	A	no	stats.RE+tlrc[1]	\
RE	sentence	V	no	stats.RE+tlrc[4]	\
RE	sentence	AV	no	stats.RE+tlrc[7]	\
RE	sentence	A	yes	stats.RE+tlrc[10]	\
RE	sentence	AV	yes	stats.RE+tlrc[13]	\
RF	sentence	A	no	stats.RF+tlrc[1]	\
RF	sentence	V	no	stats.RF+tlrc[4]	\
RF	sentence	AV	no	stats.RF+tlrc[7]	\
RF	sentence	A	yes	stats.RF+tlrc[10]	\
RF	sentence	AV	yes	stats.RF+tlrc[13]	\
RG	sentence	A	no	stats.RG+tlrc[1]	\
RG	sentence	V	no	stats.RG+tlrc[4]	\
RG	sentence	AV	no	stats.RG+tlrc[7]	\
RG	sentence	A	yes	stats.RG+tlrc[10]	\
RG	sentence	AV	yes	stats.RG+tlrc[13]	\
RH	sentence	A	no	stats.RH+tlrc[1]	\
RH	sentence	V	no	stats.RH+tlrc[4]	\
RH	sentence	AV	no	stats.RH+tlrc[7]	\
RH	sentence	A	yes	stats.RH+tlrc[10]	\
RH	sentence	AV	yes	stats.RH+tlrc[13]	\
RI	sentence	A	no	stats.RI+tlrc[1]	\
RI	sentence	V	no	stats.RI+tlrc[4]	\
RI	sentence	AV	no	stats.RI+tlrc[7]	\
RI	sentence	A	yes	stats.RI+tlrc[10]	\
RI	sentence	AV	yes	stats.RI+tlrc[13]	\
RJ	sentence	A	no	stats.RJ+tlrc[1]	\
RJ	sentence	V	no	stats.RJ+tlrc[4]	\
RJ	sentence	AV	no	stats.RJ+tlrc[7]	\
RJ	sentence	A	yes	stats.RJ+tlrc[10]	\
RJ	sentence	AV	yes	stats.RJ+tlrc[13]	\
RX	    word	A	yes	stats.RX+tlrc[1]	\
RX	    word	A	no	stats.RX+tlrc[4]	\
RX	    word	V	no	stats.RX+tlrc[7]	\
RX	    word	AV	yes	stats.RX+tlrc[10]	\
RX	    word	AV	no	stats.RX+tlrc[13]	\
RY	    word	A	yes	stats.RY+tlrc[1]	\
RY	    word	A	no	stats.RY+tlrc[4]	\
RY	    word	V	no	stats.RY+tlrc[7]	\
RY	    word	AV	yes	stats.RY+tlrc[10]	\
RY	    word	AV	no	stats.RY+tlrc[13]	\
RZ	    word	A	yes	stats.RZ+tlrc[1]	\
RZ	    word	A	no	stats.RZ+tlrc[4]	\
RZ	    word	V	no	stats.RZ+tlrc[7]	\
RZ	    word	AV	yes	stats.RZ+tlrc[10]	\
RZ	    word	AV	no	stats.RZ+tlrc[13]	\
SA	    word	A	yes	stats.SA+tlrc[1]	\
SA	    word	A	no	stats.SA+tlrc[4]	\
SA	    word	V	no	stats.SA+tlrc[7]	\
SA	    word	AV	yes	stats.SA+tlrc[10]	\
SA	    word	AV	no	stats.SA+tlrc[13]	\
SB	    word	A	yes	stats.SB+tlrc[1]	\
SB	    word	A	no	stats.SB+tlrc[4]	\
SB	    word	V	no	stats.SB+tlrc[7]	\
SB	    word	AV	yes	stats.SB+tlrc[10]	\
SB	    word	AV	no	stats.SB+tlrc[13]	\
SC	    word	A	yes	stats.SC+tlrc[1]	\
SC	    word	A	no	stats.SC+tlrc[4]	\
SC	    word	V	no	stats.SC+tlrc[7]	\
SC	    word	AV	yes	stats.SC+tlrc[10]	\
SC	    word	AV	no	stats.SC+tlrc[13]	\
SD	    word	A	yes	stats.SD+tlrc[1]	\
SD	    word	A	no	stats.SD+tlrc[4]	\
SD	    word	V	no	stats.SD+tlrc[7]	\
SD	    word	AV	yes	stats.SD+tlrc[10]	\
SD	    word	AV	no	stats.SD+tlrc[13]	\
SE	    word	A	yes	stats.SE+tlrc[1]	\
SE	    word	A	no	stats.SE+tlrc[4]	\
SE	    word	V	no	stats.SE+tlrc[7]	\
SE	    word	AV	yes	stats.SE+tlrc[10]	\
SE	    word	AV	no	stats.SE+tlrc[13]	\
SF	    word	A	yes	stats.SF+tlrc[1]	\
SF	    word	A	no	stats.SF+tlrc[4]	\
SF	    word	V	no	stats.SF+tlrc[7]	\
SF	    word	AV	yes	stats.SF+tlrc[10]	\
SF	    word	AV	no	stats.SF+tlrc[13]	\
SG	    word	A	yes	stats.SG+tlrc[1]	\
SG	    word	A	no	stats.SG+tlrc[4]	\
SG	    word	V	no	stats.SG+tlrc[7]	\
SG	    word	AV	yes	stats.SG+tlrc[10]	\
SG	    word	AV	no	stats.SG+tlrc[13]	\
SH	    word	A	yes	stats.SH+tlrc[1]	\
SH	    word	A	no	stats.SH+tlrc[4]	\
SH	    word	V	no	stats.SH+tlrc[7]	\
SH	    word	AV	yes	stats.SH+tlrc[10]	\
SH	    word	AV	no	stats.SH+tlrc[13]	\
SI	    word	A	yes	stats.SI+tlrc[1]	\
SI	    word	A	no	stats.SI+tlrc[4]	\
SI	    word	V	no	stats.SI+tlrc[7]	\
SI	    word	AV	yes	stats.SI+tlrc[10]	\
SI	    word	AV	no	stats.SI+tlrc[13]	\
SJ	    word	A	yes	stats.SJ+tlrc[1]	\
SJ	    word	A	no	stats.SJ+tlrc[4]	\
SJ	    word	V	no	stats.SJ+tlrc[7]	\
SJ	    word	AV	yes	stats.SJ+tlrc[10]	\
SJ	    word	AV	no	stats.SJ+tlrc[13]	\
SK	    word	A	yes	stats.SK+tlrc[1]	\
SK	    word	A	no	stats.SK+tlrc[4]	\
SK	    word	V	no	stats.SK+tlrc[7]	\
SK	    word	AV	yes	stats.SK+tlrc[10]	\
SK	    word	AV	no	stats.SK+tlrc[13]	\
SL	    word	A	yes	stats.SL+tlrc[1]	\
SL	    word	A	no	stats.SL+tlrc[4]	\
SL	    word	V	no	stats.SL+tlrc[7]	\
SL	    word	AV	yes	stats.SL+tlrc[10]	\
SL	    word	AV	no	stats.SL+tlrc[13]	


Sorry for this long message, but I was not able to spot any mistake in my script or table, could you please help?

Thank you so much!


Yue

The problem is the following:

  no yes

A 37 37
AV 37 37
V 37 0

You don’t have any data for the combination of “V” and “yes”.

Thank you, Gang.
But we didn’t present V* yes-noisy trials, so there are no sub-briks for that.

However, I didn’t set up V*yes-noisy contrasts in the glt, why would the 3dMVM won’t let it through?

If so, do I have to delete all the V trials since there are only Vno-noisy, but no Vyes-noisy trials?

thanks,

Yue

do I have to delete all the V trials since there are only Vno-noisy, but no Vyes-noisy trials?

Yes, that’s the way to go. If you want to make any inferences regarding the V trials, set up a separate analysis.

Got you, thank you, Gang.

Yue