help > RE: Paired ttest a posteriori
Nov 16, 2020  09:11 AM | fred Sampedro
RE: Paired ttest a posteriori
Originally posted by Alfonso Nieto-Castanon:
Dear Fred,

Typically you would/should have entered 2 as the number of sessions per subject (and 16 as the number of subjects), and then define those "pre" and "post" acquisitions as two separate conditions (in Setup.Conditions), where you associate the "pre" condition with Session1 and the "post" condition with Session2 data (see for example these posts for additional info https://www.nitrc.org/forum/forum.php?th... and/or https://www.nitrc.org/forum/forum.php?th...). That would have allowed you to run this paired t-tests in the second-level anaysis tab simply by selecting 'AllSubjects' (in the 'subject effects' list) and selecting both the 'pre' and 'post' conditions (in the 'conditions' list) and enter a between-conditions contrast [-1 1].

Since you have entered those two conditions as if they were different subjects (32 subjects with one single session each, instead of 16 subjects with two sessions each) you can still run those paired t-tests but they are a bit more cumbersome to define.

Step 1) You need to first create a series of second-level covariates (one for each of your 16 "real" subjects), dummy coding which are the pre- and post- scans associated with each subject. For example, if you have entered into CONN first the pre data for the 16 subjects and then the post data for the 16 same subjects, then you could define a new second level covariate (e.g. named "SubjectEffects"), and enter in the 'values' field:

  kron([1 1], eye(16))

(and then answer yes to the question regarding expanding this covariate into multiple ones). This will create 16 new covariates (named SubjectEffects01 to SubjectEffects16) each pointing to the appropriate scans for each "real" subject. Note that if, instead, you have entered into CONN first the pre and post data for the first subject, then the pre and post data for the second subject, etc., then you would enter instead in the 'values' field the following:

   kron(eye(16), [1 1])

in order to create the appropriate SubjectEffects* covariates.

Step 2) After these you would define a 'pre' second-level covariate dummy coding all of the pre scans (e.g.kron([1 0],ones(1,16)) in the first case above, or kron(ones(1,16),[1 0]) in the second case above) and another 'post' second-level covariate dummy-condign all of the post scans (e.g. kron([0 1],ones(1,16)) in the first case, or kron(ones(1,16),[0 1]) in the second case)

Step 3) Last, in the second-level analysis tab, you would select 'Pre', 'Post', and the 16 'SubjectEffects*' and enter the contrast [-1 1 zeros(1,16)] in order to perform the desired paired t-test (see for example this post for additional/related info for more complex designs https://www.nitrc.org/forum/forum.php?th...).

Hope this helps
Alfonso

EDIT: corrected a few typos in the second-level covariate definitions

Originally posted by fred Sampedro:
Dear CONN users,

I ran the whole standard CONN pipeline with a set of 32 resting state subjects. Actually, they are 16 subjects with pre and post acquisitions. I am trying to figure out how to define a paired t-test to check for differences in the Setup-Covariates section but I have not succeeded.  I've check similar threads and the documentation but I should be missing some very basic point. It would be correct to define two covariates on the first level with the pre and post masks and then on the second level include the contrasts [1 -1] and [-1 1]? Or everything should be on the second level?

Thanks a lot in advance.


Dear Alfonso,

Thanks a lot. I need again to use this trick because there were minor differences in field of view and voxel sizes between the pre- and post- rsfMRI acquisitions, and therefore I cannot consider them as two sessions in CoNN because the Realign step will fail. I will therefore run all scans as if it was a cross-sectional study and then run a paired t-test as you suggested. However I wonder how could I perform a 2x2 ANOVA in this setting, i.e. how can I find those regions were group A had larger increases/decreases in connectivity (pre vs post) with respect to group B? I guess playing with zeros and ones may do the trick but I am unable to figure it out!

Thanks a lot in advance!

Threaded View

TitleAuthorDate
fred Sampedro May 7, 2015
Alfonso Nieto-Castanon May 7, 2015
fred Sampedro Nov 16, 2020
RE: Paired ttest a posteriori
fred Sampedro Nov 16, 2020