Calculating residuals from 3dMVM

I am running a repeated measures ANOVA in 3dMVM, and I would like to used the residuals of my group level model for thresholding purposes (calculating smoothness estimates by averaging subject level spatial autocorrelation function (acf) parameters based on individual subjects’ residuals from the group level models). Is this possible?

Thank you very much,


The short answer is: Yes, it’s possible. The residuals would be in the following form: each subject would have the same number of residuals as the number of input files. However, it may take a while for me to implement it. How soon do you want the feature?

Hi Gang,
Thanks so much for your reply!

I am currently working on my dissertation analyses (set to defend this summer), so if it is possible to implement this feature in time, that would be fantastic.

I’ll try to get it done by the end of next week, if not earlier.

Wow, thank you so very much! I really appreciate it!

Hi Gang
Thank you so much for your help! I ran 3dMVM and I think the residuals modification worked well! Can I ask a few follow-up questions, just to make sure I did things correctly since I am trained in SPM?

I ran 3dMVM with the residual flag.
3dMVM -prefix SCEfull -jobs 7
-bsVars “group”
-wsVars “emotion*perspective”
-SS_type 3
-mask /Users/kathrynj/Documents/SCE/sMRI/subjects/templates/masks/sce56_gw_6mm_average_optthr_resliced.nii
-resid myResiduals+tlrc \

I ran my fx level analyses in SPM and switched over the AFNI for rx when I found out SPM could not do my 2x2x2 rmanova analyses.
The mask was made in SPM and it is an optimal threshold mask of the average of each subjects’ fx maps.

This outputted the results: SCEfull+tlrc.BRIK and SCEfull+tlrc.HEAD and the residula: myResiduals+tlrc.BRIK and myResiduals+tlrc.HEAD.

Then, to acquire the acf variables, I used this command:
3dFWHMx -acf -mask sce56_gw_6mm_average_optthr_resliced.nii -input myResiduals+tlrc -out acf_output

The mask is the same average optimal threshold mask as above. (Is this mask ok?)
The input is my residuals bucket. (Is this the correct input?)

This command resulted:
6.76642 6.70869 5.94292 6.46148
0.545901 3.50786 8.97543 9.2466

Then, I used this command:
3dClustSim -mask SCEfull+tlrc -acf 0.545901 3.50786 8.97543

Is this the correct dataset input (SCEfull+tlrc from 3dMVM)?

My output is listed below. Is k=30 for p<0.001 look correct?

CLUSTER SIZE THRESHOLD(pthr,alpha) in Voxels

-NN 3 | alpha = Prob(Cluster >= given size)

pthr | .10000 .05000 .02000 .01000

------ | ------ ------ ------ ------

0.050000 748.6 899.0 1118.0 1334.7
0.020000 227.4 275.5 348.0 418.0
0.010000 117.8 144.7 181.0 222.0
0.005000 67.5 84.2 107.4 128.5
0.002000 36.1 45.9 59.8 72.7
0.001000 23.9 30.0 38.9 48.0
0.000500 16.1 20.6 27.5 32.7
0.000200 9.7 12.6 17.0 20.9
0.000100 6.5 8.9 12.2 14.7

Thank you very much!