Dear All,

I am using the 3dttest++ for comparing two different groups of subjects and would like to control for the effect of gender as a covariate. I referred to the help file of the 3dttest and found the following illustration on the structure of the output:


  • The output dataset is stored in float format; there is no option
    to store it in scaled short format :slight_smile:

  • For each covariate, 2 sub-bricks are produced:
    ++ The estimated slope of the beta values vs covariate
    ++ The t-statistic of this slope
    ++ If there are 2 sets of subjects, then each pair of sub-bricks is
    produced for the setA-setB, setA, and setB cases, so that you’ll
    get 6 sub-bricks per covariate (plus 6 more for the mean, which
    is treated as a special covariate whose values are all 1).
    ++ Thus the number of sub-bricks produced is 6*(m+1) for the two-sample
    case and 2*(m+1) for the one-sample case, where m=number of covariates.

  • For example, if there is one covariate ‘IQ’, and a two sample analysis
    is carried out (‘-setA’ and ‘-setB’ both used), then the output
    dataset will contain the following 12 (6*2) sub-bricks:
    #0 SetA-SetB_mean = difference of means [covariates removed]
    #1 SetA-SetB_Tstat
    #2 SetA-SetB_IQ = difference of slopes wrt covariate IQ
    #3 SetA-SetB_IQ_Tstat
    #4 SetA_mean = mean of SetA [covariates removed]
    #5 SetA_Tstat
    #6 SetA_IQ = slope of SetA wrt covariate IQ
    #7 SetA_IQ_Tstat
    #8 SetB_mean = mean of SetB [covariates removed]
    #9 SetB_Tstat
    #10 SetB_IQ = slope of SetB wrt covariate IQ
    #11 SetB_IQ_Tstat

I believe the output I would need to explore is sub brick #1, which states SetA-SetB_Tstat and demonstrates group mean differences. My understanding was that the term ‘removed’ in [covariates removed] means that the covariate is controlled for in this comparison. I would be thankful if you could please confirm.

Thank you so much.

Also, my second question was that because gender is a categorical variable, in my previous attempts with 3dMVM I used to use letters (F/M) in the covariates file. But in the 3dttest++ we are instructed to only use numeric variables as a covariate. Accordingly, I have used 1 for females and 0 for males. I was just concerned that the algorithm may treat the data differently if a categorical covariate is presented in a numeric format. Or is it just fine?

Referring to the instructions provided on the 3dttest++ help file, I think it must be fine. I would be thankful if you could please confirm. I am pasting this section of the help file at the end of this email.

Thank you so much for your time.


  • You cannot enter covariates as pure labels (e.g., ‘Male’ and ‘Female’).
    To assign such categorical covariates, you must use numeric values.
    A column in the covariates file that contains strings rather than
    numbers is assumed to be a list of dataset names, not category labels!


the term ‘removed’ in [covariates removed] means that the covariate is controlled for in this comparison.

You’re correct that the description in the 3dttest++ help can be improved.

You seem to have a 2 x 2 data structure. If you decide to use 3dttest++ instead of 3dMVM to handle the situation, there are a couple of subtleties involved. One, it sounds like you’re going to ignore the interaction effect. Two, dummy coding a categorical variable can be tricky. For example, 0/1 coding for sex could cause some unwanted side effect, If you really want to use 3dttest++,

  1. make sure the assumption of no interaction is reasonable
  2. code the two sexes with something -0.5 and 0.5 (or -1 and 1). See more details here: https://stats.idre.ucla.edu/r/library/r-library-contrast-coding-systems-for-categorical-variables/

Thank you very much, Gang!