help
help > RE: Question reg second level results
Oct 17, 2011 07:10 PM | Alfonso Nieto-Castanon - Boston University
RE: Question reg second level results
Hello Johnson,
The way your analyses were defined this will be a 2 sample t-test. The 'simpler' way to define the experiment info would have been to define two sessions per subjects and define 'pre' and 'post' as two conditions (instead of treating the two session as new subjects and define 'pre' and 'post' as second-level covariates). In that way at the second-level analysis tab you could have simply selected the 'pre' and 'post' conditions, enter a [1,-1] between-conditions contrast, and that would have implemented the desired paired t-test.
In any way, in order to avoid having to re-define the experient info and re-run the analyses, you can still perform a paired t-test on your results. For that you only need to add the appropriate 'subject effects' as additional covariates (Henson and Penny 2005 describes how to perform these sort of anova's in more detail if you are interested). Basically you need to add another 16 second-level covariates (one for each subject) and then control for these covariates in your second-level results. Since defining this many covariates is a bit tedious to do manually you can simply run the commands below from the command line instead (edit the first two lines to indicate which ones, among your 32 'pseudo' subjects correspond to the 'pre' and which ones correspond to the 'post' condition, for the same order of 'real' subjects)
group_pre=1:16;
group_post=17:32;
clear batch;
batch.Setup.subjects.effect_names{1}='Pre';
batch.Setup.subjects.effects{1}=full(sparse(group_pre,1,1,numel(group_pre)+numel(group_post),1));
batch.Setup.subjects.effect_names{2}='Post';
batch.Setup.subjects.effects{2}=full(sparse(group_post,1,1,numel(group_pre)+numel(group_post),1));
for n1=1:numel(group_pre)
batch.Setup.subjects.effect_names{2+n1}=['Subject',num2str(n1,'%02d')];
batch.Setup.subjects.effects{2+n1}=full(sparse([group_pre(n1),group_post(n1)],1,1,numel(group_pre)+numel(group_post),1));
end
conn_batch(batch);After running this, go to the conn gui and look into the Setup->second-level covariates tab to check the new covariates (you should have there 18 covariates, one for the 'pre' sample, and for the 'post' sample, and then one for each subject). If everything looks fine, simply save the conn project to store these new definitions.To define the paired t-test now simply go to the second-level results gui, select all of the (18) effects in the 'subject effects' list, and enter [1,-1,zeros(1,16)] in the 'between-subjects contrast' field. Just to doublecheck you should see now when exploring the results that the degrees of freedom for these results are 15 (the appropriate number for a paired t-test on a sample of 16 subjects) instead of 30 (the appropriate number for a two sample t-test on two samples of 16 subjects each). Hope this helpsAlfonso
Originally posted by Johnson H:
The way your analyses were defined this will be a 2 sample t-test. The 'simpler' way to define the experiment info would have been to define two sessions per subjects and define 'pre' and 'post' as two conditions (instead of treating the two session as new subjects and define 'pre' and 'post' as second-level covariates). In that way at the second-level analysis tab you could have simply selected the 'pre' and 'post' conditions, enter a [1,-1] between-conditions contrast, and that would have implemented the desired paired t-test.
In any way, in order to avoid having to re-define the experient info and re-run the analyses, you can still perform a paired t-test on your results. For that you only need to add the appropriate 'subject effects' as additional covariates (Henson and Penny 2005 describes how to perform these sort of anova's in more detail if you are interested). Basically you need to add another 16 second-level covariates (one for each subject) and then control for these covariates in your second-level results. Since defining this many covariates is a bit tedious to do manually you can simply run the commands below from the command line instead (edit the first two lines to indicate which ones, among your 32 'pseudo' subjects correspond to the 'pre' and which ones correspond to the 'post' condition, for the same order of 'real' subjects)
group_pre=1:16;
group_post=17:32;
clear batch;
batch.Setup.subjects.effect_names{1}='Pre';
batch.Setup.subjects.effects{1}=full(sparse(group_pre,1,1,numel(group_pre)+numel(group_post),1));
batch.Setup.subjects.effect_names{2}='Post';
batch.Setup.subjects.effects{2}=full(sparse(group_post,1,1,numel(group_pre)+numel(group_post),1));
for n1=1:numel(group_pre)
batch.Setup.subjects.effect_names{2+n1}=['Subject',num2str(n1,'%02d')];
batch.Setup.subjects.effects{2+n1}=full(sparse([group_pre(n1),group_post(n1)],1,1,numel(group_pre)+numel(group_post),1));
end
conn_batch(batch);After running this, go to the conn gui and look into the Setup->second-level covariates tab to check the new covariates (you should have there 18 covariates, one for the 'pre' sample, and for the 'post' sample, and then one for each subject). If everything looks fine, simply save the conn project to store these new definitions.To define the paired t-test now simply go to the second-level results gui, select all of the (18) effects in the 'subject effects' list, and enter [1,-1,zeros(1,16)] in the 'between-subjects contrast' field. Just to doublecheck you should see now when exploring the results that the degrees of freedom for these results are 15 (the appropriate number for a paired t-test on a sample of 16 subjects) instead of 30 (the appropriate number for a two sample t-test on two samples of 16 subjects each). Hope this helpsAlfonso
Originally posted by Johnson H:
Hello Experts
I just finished my Conn toolbar second level analysis, but I am not quite sure about the whole brain results. My goal was to do a paired sample t-test analysis on 16 subjects, pre versus post drug dataset. But since I could not figure-out a way to enter data for a paired t-test analysis, I entered the pre and post drug data as different subjects (32 subjects) but separated them as covariates.
Now will my second level results be a 2 sample or paired sample? If 2 sample is there a way to do paired sample using conn toolbar? Is this acceptable?
Appreciate any help, Thanks a lot for your time.
Johnson
I just finished my Conn toolbar second level analysis, but I am not quite sure about the whole brain results. My goal was to do a paired sample t-test analysis on 16 subjects, pre versus post drug dataset. But since I could not figure-out a way to enter data for a paired t-test analysis, I entered the pre and post drug data as different subjects (32 subjects) but separated them as covariates.
Now will my second level results be a 2 sample or paired sample? If 2 sample is there a way to do paired sample using conn toolbar? Is this acceptable?
Appreciate any help, Thanks a lot for your time.
Johnson
Threaded View
| Title | Author | Date |
|---|---|---|
| Johnson H | Oct 17, 2011 | |
| Jake Flinthoff | Aug 15, 2018 | |
| Alfonso Nieto-Castanon | Oct 17, 2011 | |
| Johnson H | Oct 17, 2011 | |
| Alfonso Nieto-Castanon | Oct 17, 2011 | |
| Johnson H | Oct 17, 2011 | |
| MaciĆ Buades-Rotger | Dec 9, 2015 | |
| Alfonso Nieto-Castanon | Dec 11, 2015 | |
