3dttest++ -covariates problem

Dear Afni Gurus,
I need your help.

I am working on a sample of 139 subjects (32 schizophrenic patients and 107 healthy controls), for each of which it is avaiable a task run and a rest run.

I used a 3dttest++ script for each group using the -paired option (task-rest) and -covariates option (task reaction time (RT) as covariate).

ATTEMPT1: I created a unique covar file (CFILE_ALL), which included all 139 subjects and their RT (a file of 2 columns and 140 rows), because I thought that subjects not included in the 3dttest++ script would have been ignored.

ATTEMPT 2:To check this, I run again the same script for SCH subjects, but now using a covar file with only SCH sub (CFILE_SCH).

I found different results if I used CFILE_ALL or CFILE_SCH.

Is it normal or is it a bug?

ATTEMPT 1 and 2 shared the same script except the covar file. CFILE_SCH was obtained directly from CFILE_ALL, simply by deleting HC subjects.

Thank you in advance for your help.

3dttest++
-setA SCH_reho_ss
50007 50007_stopsignal_reho.blurafter.gsr.masked+tlrc
50010 50010_stopsignal_reho.blurafter.gsr.masked+tlrc
50013 50013_stopsignal_reho.blurafter.gsr.masked+tlrc
50014 50014_stopsignal_reho.blurafter.gsr.masked+tlrc
50015 50015_stopsignal_reho.blurafter.gsr.masked+tlrc
50021 50021_stopsignal_reho.blurafter.gsr.masked+tlrc
50023 50023_stopsignal_reho.blurafter.gsr.masked+tlrc
50025 50025_stopsignal_reho.blurafter.gsr.masked+tlrc
50027 50027_stopsignal_reho.blurafter.gsr.masked+tlrc
50033 50033_stopsignal_reho.blurafter.gsr.masked+tlrc
50034 50034_stopsignal_reho.blurafter.gsr.masked+tlrc
50035 50035_stopsignal_reho.blurafter.gsr.masked+tlrc
50036 50036_stopsignal_reho.blurafter.gsr.masked+tlrc
50038 50038_stopsignal_reho.blurafter.gsr.masked+tlrc
50043 50043_stopsignal_reho.blurafter.gsr.masked+tlrc
50047 50047_stopsignal_reho.blurafter.gsr.masked+tlrc
50048 50048_stopsignal_reho.blurafter.gsr.masked+tlrc
50050 50050_stopsignal_reho.blurafter.gsr.masked+tlrc
50051 50051_stopsignal_reho.blurafter.gsr.masked+tlrc
50053 50053_stopsignal_reho.blurafter.gsr.masked+tlrc
50054 50054_stopsignal_reho.blurafter.gsr.masked+tlrc
50055 50055_stopsignal_reho.blurafter.gsr.masked+tlrc
50056 50056_stopsignal_reho.blurafter.gsr.masked+tlrc
50058 50058_stopsignal_reho.blurafter.gsr.masked+tlrc
50066 50066_stopsignal_reho.blurafter.gsr.masked+tlrc
50069 50069_stopsignal_reho.blurafter.gsr.masked+tlrc
50073 50073_stopsignal_reho.blurafter.gsr.masked+tlrc
50075 50075_stopsignal_reho.blurafter.gsr.masked+tlrc
50077 50077_stopsignal_reho.blurafter.gsr.masked+tlrc
50080 50080_stopsignal_reho.blurafter.gsr.masked+tlrc
50081 50081_stopsignal_reho.blurafter.gsr.masked+tlrc
50085 50085_stopsignal_reho.blurafter.gsr.masked+tlrc
-setB SCH_reho_rest
50007 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50007_rest_reho.blurafter.gsr.masked+tlrc
50010 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50010_rest_reho.blurafter.gsr.masked+tlrc
50013 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50013_rest_reho.blurafter.gsr.masked+tlrc
50014 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50014_rest_reho.blurafter.gsr.masked+tlrc
50015 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50015_rest_reho.blurafter.gsr.masked+tlrc
50021 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50021_rest_reho.blurafter.gsr.masked+tlrc
50023 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50023_rest_reho.blurafter.gsr.masked+tlrc
50025 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50025_rest_reho.blurafter.gsr.masked+tlrc
50027 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50027_rest_reho.blurafter.gsr.masked+tlrc
50033 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50033_rest_reho.blurafter.gsr.masked+tlrc
50034 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50034_rest_reho.blurafter.gsr.masked+tlrc
50035 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50035_rest_reho.blurafter.gsr.masked+tlrc
50036 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50036_rest_reho.blurafter.gsr.masked+tlrc
50038 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50038_rest_reho.blurafter.gsr.masked+tlrc
50043 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50043_rest_reho.blurafter.gsr.masked+tlrc
50047 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50047_rest_reho.blurafter.gsr.masked+tlrc
50048 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50048_rest_reho.blurafter.gsr.masked+tlrc
50050 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50050_rest_reho.blurafter.gsr.masked+tlrc
50051 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50051_rest_reho.blurafter.gsr.masked+tlrc
50053 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50053_rest_reho.blurafter.gsr.masked+tlrc
50054 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50054_rest_reho.blurafter.gsr.masked+tlrc
50055 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50055_rest_reho.blurafter.gsr.masked+tlrc
50056 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50056_rest_reho.blurafter.gsr.masked+tlrc
50058 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50058_rest_reho.blurafter.gsr.masked+tlrc
50066 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50066_rest_reho.blurafter.gsr.masked+tlrc
50069 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50069_rest_reho.blurafter.gsr.masked+tlrc
50073 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50073_rest_reho.blurafter.gsr.masked+tlrc
50075 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50075_rest_reho.blurafter.gsr.masked+tlrc
50077 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50077_rest_reho.blurafter.gsr.masked+tlrc
50080 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50080_rest_reho.blurafter.gsr.masked+tlrc
50081 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50081_rest_reho.blurafter.gsr.masked+tlrc
50085 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50085_rest_reho.blurafter.gsr.masked+tlrc
-prefix cov_GMmask_reho_blurafter_SCH_stopsignal-rest.gsr
-toz -paired -mask /mnt/d/ucla/masks/maskGM_resampled_stopsignal+tlrc -DAFNI_DEBUG_TABLE=YES -covariates /mnt/d/ucla/covar/reho/SS/CFILE_ALL (or CFILE_SCH)

ATTEMPT1: I created a unique covar file (CFILE_ALL), which included all 139 subjects and their RT (a file of 2 columns and 140 rows),
because I thought that subjects not included in the 3dttest++ script would have been ignored.

There are two groups, and each subject has two conditions, right? Does each subject have two 3D input files? If so, I don’t see how 3dttest++ script could work. Consider using 3dMVM.

ATTEMPT 2:To check this, I run again the same script for SCH subjects, but now using a covar file with only SCH sub (CFILE_SCH).

In this case, you compare the two conditions for one group only. Your 3dttest++ script looks fine to me.

Dear Gang,
Thanks for your reply. I probably wasn’t clear enough.

I used only paired ttests comparing two conditions (rest and task) within the same group (SCH and HC). My question deals with -covariates option in particular.

At the beginning (Attempt 1), I created a unique covar file with all subjects (HC+SCH) and then I used this covar file for paired ttests of both SCH and HC. I created a unique covar file because it was faster than creating one covar file for HC (without SCH subjects) and one covar file for SCH (without HC subjects).I thought that, thanks to labels, HC subjects and their Reaction time (i.e. the covariate) would have been ignored in SCH paired ttest and viceversa.
To check this, I tried (in a second time) to run the SCH paired ttest script using a covar file with only SCH subjects (Attempt 2) and not the covar file with all subjects.
I found different results in Attempt 1 and 2. So, the same ttest, the same 3d inputs, but different covar files.
Is it normal? Does 3dttest++ take into account all the subjects in a covar file, even those without a 3d input file?

Thanks

Again, could you clarify your data structure: Does each subject have one or two 3D input files? Also, what are the research questions you would like to address?

139 subjects.: 32 SCH and 107 HC. Each subjects has 2 runs: one collected at rest and one during a stopsignal task. It is also avaiable a Reaction Time for each sub, as an index of task performance. We computed 2 ReHo maps for each sub (rest and task) and we wanted to study the correlation between the Reaction Time and ReHo task-ReHo rest in SCH and TYP (within-group analysis)

Let’s consider this script. It is a paired t-test. In SetA there are SCH ReHo maps computed during a stopsignal task; in SetB there are SCH ReHo maps computed at rest.
Let’s analyze -covariates option. We wanted to study the correlation between the Reaction Time (our covariate, used as an index of stopsignal performance) and ReHo task-ReHo rest. I run this script twice: once using CFILE_ALL and once using CFILE_SCH as covar files.

This was the structure of CFILE_ALL (10xxx=HC; 50xxx=SCH) which included ALL subjects of our dataset.

sub RT
10001 34.1
10002 34.2
[…]
50007 34.2
50010 35.0
[…]

This was the structure of CFILE_SCH, which included only SCH sub

sub RT
50007 34.2
50010 35.0
[…]

I would expect the same results from this two scripts. I’m wrong?

3dttest++
-setA SCH_reho_ss
50007 50007_stopsignal_reho.blurafter.gsr.masked+tlrc
50010 50010_stopsignal_reho.blurafter.gsr.masked+tlrc
50013 50013_stopsignal_reho.blurafter.gsr.masked+tlrc
50014 50014_stopsignal_reho.blurafter.gsr.masked+tlrc
50015 50015_stopsignal_reho.blurafter.gsr.masked+tlrc
50021 50021_stopsignal_reho.blurafter.gsr.masked+tlrc
50023 50023_stopsignal_reho.blurafter.gsr.masked+tlrc
50025 50025_stopsignal_reho.blurafter.gsr.masked+tlrc
50027 50027_stopsignal_reho.blurafter.gsr.masked+tlrc
50033 50033_stopsignal_reho.blurafter.gsr.masked+tlrc
50034 50034_stopsignal_reho.blurafter.gsr.masked+tlrc
50035 50035_stopsignal_reho.blurafter.gsr.masked+tlrc
50036 50036_stopsignal_reho.blurafter.gsr.masked+tlrc
50038 50038_stopsignal_reho.blurafter.gsr.masked+tlrc
50043 50043_stopsignal_reho.blurafter.gsr.masked+tlrc
50047 50047_stopsignal_reho.blurafter.gsr.masked+tlrc
50048 50048_stopsignal_reho.blurafter.gsr.masked+tlrc
50050 50050_stopsignal_reho.blurafter.gsr.masked+tlrc
50051 50051_stopsignal_reho.blurafter.gsr.masked+tlrc
50053 50053_stopsignal_reho.blurafter.gsr.masked+tlrc
50054 50054_stopsignal_reho.blurafter.gsr.masked+tlrc
50055 50055_stopsignal_reho.blurafter.gsr.masked+tlrc
50056 50056_stopsignal_reho.blurafter.gsr.masked+tlrc
50058 50058_stopsignal_reho.blurafter.gsr.masked+tlrc
50066 50066_stopsignal_reho.blurafter.gsr.masked+tlrc
50069 50069_stopsignal_reho.blurafter.gsr.masked+tlrc
50073 50073_stopsignal_reho.blurafter.gsr.masked+tlrc
50075 50075_stopsignal_reho.blurafter.gsr.masked+tlrc
50077 50077_stopsignal_reho.blurafter.gsr.masked+tlrc
50080 50080_stopsignal_reho.blurafter.gsr.masked+tlrc
50081 50081_stopsignal_reho.blurafter.gsr.masked+tlrc
50085 50085_stopsignal_reho.blurafter.gsr.masked+tlrc
-setB SCH_reho_rest
50007 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50007_rest_reho.blurafter.gsr.masked+tlrc
50010 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50010_rest_reho.blurafter.gsr.masked+tlrc
50013 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50013_rest_reho.blurafter.gsr.masked+tlrc
50014 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50014_rest_reho.blurafter.gsr.masked+tlrc
50015 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50015_rest_reho.blurafter.gsr.masked+tlrc
50021 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50021_rest_reho.blurafter.gsr.masked+tlrc
50023 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50023_rest_reho.blurafter.gsr.masked+tlrc
50025 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50025_rest_reho.blurafter.gsr.masked+tlrc
50027 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50027_rest_reho.blurafter.gsr.masked+tlrc
50033 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50033_rest_reho.blurafter.gsr.masked+tlrc
50034 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50034_rest_reho.blurafter.gsr.masked+tlrc
50035 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50035_rest_reho.blurafter.gsr.masked+tlrc
50036 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50036_rest_reho.blurafter.gsr.masked+tlrc
50038 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50038_rest_reho.blurafter.gsr.masked+tlrc
50043 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50043_rest_reho.blurafter.gsr.masked+tlrc
50047 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50047_rest_reho.blurafter.gsr.masked+tlrc
50048 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50048_rest_reho.blurafter.gsr.masked+tlrc
50050 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50050_rest_reho.blurafter.gsr.masked+tlrc
50051 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50051_rest_reho.blurafter.gsr.masked+tlrc
50053 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50053_rest_reho.blurafter.gsr.masked+tlrc
50054 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50054_rest_reho.blurafter.gsr.masked+tlrc
50055 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50055_rest_reho.blurafter.gsr.masked+tlrc
50056 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50056_rest_reho.blurafter.gsr.masked+tlrc
50058 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50058_rest_reho.blurafter.gsr.masked+tlrc
50066 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50066_rest_reho.blurafter.gsr.masked+tlrc
50069 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50069_rest_reho.blurafter.gsr.masked+tlrc
50073 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50073_rest_reho.blurafter.gsr.masked+tlrc
50075 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50075_rest_reho.blurafter.gsr.masked+tlrc
50077 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50077_rest_reho.blurafter.gsr.masked+tlrc
50080 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50080_rest_reho.blurafter.gsr.masked+tlrc
50081 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50081_rest_reho.blurafter.gsr.masked+tlrc
50085 /mnt/d/ucla/reho_taskswitch+rest/reho/nocensored_gsr_REHO/sub-50085_rest_reho.blurafter.gsr.masked+tlrc
-prefix cov_GMmask_reho_blurafter_SCH_stopsignal-rest.gsr
-toz -paired -mask /mnt/d/ucla/masks/maskGM_resampled_stopsignal+tlrc -DAFNI_DEBUG_TABLE=YES -covariates /mnt/d/ucla/covar/reho/SS/CFILE_ALL (or CFILE_SCH)

thanks for your patience :slight_smile:

I’ll try to summarize your data structure and see if I understand it accurately. You have

2 groups of subjects
each subject has 2 effects/conditions

we wanted to study the correlation between the Reaction Time and ReHo task-ReHo rest in SCH and TYP (within-group analysis)

Is Reaction Time associated with the task condition only or both task and rest? You have the contrast between the two conditions directly available for each subject?

I run this script twice: once using CFILE_ALL and once using CFILE_SCH as covar files.

For the analysis with the SCH group, it is not clear to me why you would provide the covariate file with subjects from both groups. I’m not so sure if 3dttest++ could properly parse the covariate file and only select the relevant subjects.

Hi Gang,

Is Reaction Time associated with the task condition only or both task and rest? You have the contrast between the two conditions directly available for each subject?

No. We wanted to study the correlation between RT and the ReHo modulation rest-task (ReHo task-ReHo rest- RT) in SCH and in HC.

For the analysis with the SCH group, it is not clear to me why you would provide the covariate file with subjects from both groups. I’m not so sure if 3dttest++ could properly parse the covariate file and only select the relevant subjects

I think this is the critical point. When, for example, subjects in a ttest are a sub-sample of a bigger database or when you want to do the same ttest in different groups (in our case, one ttest for HC and one ttest for SCH) is easier and faster to create a unique covar file rather than a different covar file for each group or a covar file made up of a sub-selection of the subjects within a certain group (in order non to select, for example, the subjects excluded by motion censoring). I believed the aim of labels system was the one to select only the relevant subjects (matching 3d input labels to covar file labels). In fact, for example, when the label of a 3d input has no match with a label in the covar file a FATAL ERROR appears, while, on the other hand, this doesn’t happen when a label in the covar file has no matching in the 3dttest script.
So I can’t understand why COVAR_ALL and COVAR_SCH scripts have different results. Is it possible that 3dttest++ takes into account all the subjects in a covar file, even those without a matching 3d input file?

Thanks
paolo

Is it possible that 3dttest++ takes into account all the subjects in a covar file, even those without a matching 3d input file?

Bob might have the specific answer about this, but your test seems to indicate that 3dttest++ cannot properly parse the covariate file when more data are included than needed.