There was a typo in my email. See comment below.
On Thu, Oct 18, 2012 at 3:40 PM, Kwaku Akrofi <[log in to unmask]> wrote:
> Hello Donald,
>
> I just looked at some of your older examples about contrasts. I saw this
> one, and I have a (basic) question it:
>
> __________________________________________________________________________
>
> Here is an example of how to construct any contrast:
> This is for a design with 18 subjects in group 1, 9 subjects in group
> 2, 2 group terms and 2 conditions: Start with the simpliest element,
*** CORRECTION: 7 conditions, not 2.
> single subject in a single condition, build its contrast, repeat for
> all subjects and conditions, and then combine the ones you want.
>
> S1G1C1=[1 zeros(1,26) 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0]
> S1G1C2=[1 zeros(1,26) 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0]
> ________________________________________________________________________
>
> In each of the vectors above, there are 27 elements for subjects, 2 for
> group, 2 for conditions, and 19 for (I reckon) interactions. I would have
> expected 4 elements for interactions, because a 2-by-2 system will have
> G1C1, G1C2, G2C1, and G2C2. Could you please let me know what the extra 15
> elements are for?
*** CORRECTION: There are 7 conditions. Thus its a 2x7 design.
Now you will have 27 subject columns, 2 group columns, 7 for
conditions, and 14 for the interaction.
Sorry for the confusion.
>
> Thanks,
> KWaku.
>
>
>
> From: "MCLAREN, Donald" <[log in to unmask]>
> To: Kwaku Akrofi <[log in to unmask]>
> Cc: [log in to unmask]
> Sent: Wednesday, 10 October 2012, 17:06
> Subject: Re: [SPM] One- and Two-Sample t-Tests with Flexible Factorial in
> SPM8
>
> See inline responses below.
>
> On Wed, Oct 10, 2012 at 1:46 PM, Kwaku Akrofi <[log in to unmask]> wrote:
>> Hello SPMers,
>>
>> How do I compute the contrasts to implement a 1-sample and a 2-sample test
>> in SPM?
>
> There is no such thing as a 1-sample and 2-sample test in an ANOVA. A
> 1-sample t-test only has one column in its design matrix, plus
> covariates. The 2-sample t-test has two columns, plus covariates.
> Neither of them deal with repeated measures. For either of these
> tests, use the one- or two-sample t-test option from the GUI when
> building your design.
>
>>
>> I have set up a 3-by-2 Flexible Factorial ANOVA in SPM8. For each subject,
>> I have 2 contrast images, one for each condition, for the ANOVA. I used the
>> paper by Glascher and Gitelman
>> (http://www.sbirc.ed.ac.uk/cyril/downloads/Contrast_Weighting_Glascher_Gitelman_2008.pdf)
>> as a guide to set up the ANOVA.
>>
>> Factors were set up as follows:
>> Factor 1: subject independence – yes, variance – equal
>> Factor 2: group independence – yes, variance – unequal
>> Factor 3: condition independence – no, variance – equal
>
> You should also specify that the model includes Subject as well.
>
>>
>> F-Contrasts were set up as follows:
>>
>> n1 = 12; (number of subjects in group 1)
>> n2 = 10; (number of subjects in group 2)
>> n3 = 7; (number of subjects in group 3)
>> nc = 2; (number of levels in condition factor)
>> ng = 3; (number of groups)
>> MEg = [1:nc]-mean(1:nc); (main effect of group, here: [-1 0 1])
>> MEc = [1 -1]; (main effect of group: Condition 1 > Condition 2)
>> Main effect of Group:
>> MEg zeros(1,nc) -ones(1,nc)/nc zeros(1,nc) ones(1,nc)/nc
>> -ones(1,n1)/n1 zeros(1,n2) -ones(1,n3)/n3
>> Main effect of Condition:
>> zeros(1,ng) MEc MEc*[n1/(n1+n2+n3)] MEc*[n2/(n1+n2+n3)]
>> MEc*[n3/(n1+n2+n3)] zeros(1,n1+n2+n3)
>> Group-condition interaction;
>> zeros(1,ng) zeros(1,nc) -MEc zeros(1,nc) MEc zeros(1,n1+n2+n3)
>>
>> Note that unlike in SPM5, the design matrix SPM8 positions the subject
>> factor after the group factor, condition factor, and interactions.
>>
>> Using the above setup, I have results for the main effects and
>> interactions of my study, and am satisfied with the results.
>
> The main effect of group, along with any comparisons of group are NOT
> valid. The interaction terms are valid though.
>
>>
>> But I would like to use 1- and 2-sample t-tests post hoc to further
>> examine the relationships between groups and conditions. I have used the
>> built-in options in SPM8 for these t-tests, but I have been informed that
>> t-test within the Flexible Factorial framework lead to better results
>> because variances are pooled from all groups in the study. I tried a
>> 1-sample t-test the following way- to test for Condition 1 > Condition 2 in
>> Group 1 - and got an error:
>> 1 0 0 MEc*[1/nc] MEc*[1/nc] zeros(1,nc) zeros(1,nc) ones(1,n1)
>> zeros (1,n1) zeros(1,n1). What would be the correct contrast for such a
>> 1-sample t-test?
>
> I wouldn't call these 1- and 2-sample t-tests as they are not. I would
> simple call them post-hoc contrasts.
> To compare the two groups for condition1>condition2
> 0 0 0 1 -1 1 -1 0 0 0 0 zeros(1,n1+n2+n3)
>
> I would take a look at my previous posts for how to construct any contrast.
>
>
>
>>
>> Any help is greatly appreciated. Thank you very much in advance!
>>
>> Kwaku Akrofi, PhD
>> Postdoctoral Fellow
>> Department of Speech and Hearing Science
>> University of Illinois at Urbana-Champaign
>> [log in to unmask]
>
>
|