contrast map - gltsym vs. 3dcalc

Hello,
I want to have a map of a contrast between two conditions at the single-subject level. I tried two ways to do that, which resulted in exactly the same thing, which perhaps is good news but this confuses me. I did expect different results.

Option 1: gltsym in 3ddeconvolve


-gltsym 'SYM: +C1 -C2' -glt_label 1 'Contrast_map1' \

Option 2: 3dcalc
(Assuming for the example C1 is sub-brick 2 and C2 is sub-brick 4).


3dcalc 'func+orig[2]' -b 'func+orig[4]' -expr 'a - b' -prefix Contrast_map2

Option 2 is a difference between t-statistics, while Option 1 a t-statistic of a difference.

  1. Are they expected to have different outputs? If so - in what way? And what should I use?
  2. Does it make sense that the contrast map I get is the same no matter what option I use?

Hi Galit,

I expect that you are not looking at the difference of the t-stats, but the difference of the weights (betas). The C1 - C2 contrast of betas via -gltsym should be identical to that computed via 3dcalc.

What is the output of:

3dinfo -label func+orig’[2,4]’

  • rick

Hi Rick,

I actually simplified the names of my datasets. Anyway, when I write down the 3dinfo command on the actual name of the file, I get this:


q_pos#0_Tstat|q_neg#0_Tstat

Which is indeed what I had in mind.
I also requested with 3dcalc both differences, between coefficients and between t-stats, and I can see in the AFNI GUI eactly at which contrast I am looking at.

However, after thinking about it for some time, it might make sense that I get the same map, because I have a balanced factorial design. Hence, the difference between t-stats should equal the t-stat of a difference between coefficients. Let me know what you think about the following explanation:
A t-statistic is the coefficient divided by its standard error. The variance of the coefficient is given by the variance of the data divided by the sum of squares along the x-axis, multiplied by the variance inflation factor (VIF). All these components are the same between regressors in a balanced factorial design:

  • Variance the data - the same between regressors
  • Sum of squares along the x-axis - also the same, only in a balanced factorial design. This is because for each regressor, the x’s are (for example) 1 and 0, and those 1’s and 0’s are equal in number. So the variability along the x-axis is the same.
  • VIF - in a balanced factorial design, the VIF is 1.

This means that the variance of all coefficients is the same, and therefore the pooled variance for their subtraction is also the same (does it make sense that the variance of the difference is the pooled variance and not sum of variances? Or might the numerator and denominator be multiplied by the same factor, so we get the same variance?). Anyway, if really the standard error is the same, then first subtracting and then dividing would yield the same result as first dividing and then subtracting.
Does this make sense?

You can actually verify whether the standard error for the two effect estimates is the same by checking

3dcalc ‘func+orig[1]’ -b ‘func+orig[2]’ -expr ‘a/b’ -prefix SE1
3dcalc ‘func+orig[3]’ -b ‘func+orig[4]’ -expr ‘a/b’ -prefix SE2

Interesting. I checked, and all standard deviations are very similar but not identical. I checked it for two regressors, and for their difference (taken from gltsym). I don’t understand mathematically why the standard deviations of the coefficients should be different, according to my previous explanation I would expect them to be exactly the same…

For the maps, I double checked, and I found that although impressionistically the two maps look identical, the actual number are not equal, but very very similar (e.g. t=2.019 in one voxel for the t-difference map, compared to t=2.036 in the difference-t map).

So assuming they are really different, then what would be the right t-map to take if I want a contrast at the single-subject level? A t-stat of the difference between two coefficients (from gltsym), or a difference betwen two t-stats (using 3dcalc)?

I don’t understand mathematically why the standard deviations of the coefficients should be different

In general they should be different unless under some special circumstances. See the exact formula on page 12 of the 3dDeconvolve manual (or any textbook about regression): https://afni.nimh.nih.gov/afni/doc/manual/3dDeconvolve.pdf

So assuming they are really different, then what would be the right t-map to take if I want a contrast at the single-subject level?

You should put your trust on 3dDeconvolve (with option -gltsym) in this case.