Print

Print


See response below.

On Mon, Aug 13, 2012 at 6:26 AM, Nikola Valchev <[log in to unmask]> wrote:
> Dear SPM users,
> I'm trying to do a repeated measures ANOVA in SPM but I'm not sure if I'm making it right and how exactly to code the main effects and interactions for my model.
> I have a 2x3 design with sessions 2 (within subjects) and components 3 (between subjects; this factor can also be considered as within but as I'm comparing spatial maps of independent components, they are independent so can be treated as a between factor). I use the flexible factorial design and code 3 factors: subjects (18) and session (2) and component (3). Each cell contains 6 files and conditions are coded as:
>
> subject  session component
> 1            1               1
> 1            1               2
> 1            1               3
> 1            2               1
> 1            2               2
> 1            2               3
>
>
> until:
> subject  session component
> 18            1               1
> 18            1               2
> 18            1               3
> 18            2               1
> 18            2               2
> 18            2               3
>
>
> So far so good, my design matrix has the following columns:
> 2 (session)
> 3 (component)
> 18 (subjects)
> 6 (interactions)
>
>
> I want to calculate the contrasts for:
> 1) main effect of session
> 2) interaction session x component
> 3) planned comparison session x component 3 (I'm particularly interested in that one)


These will only be valid if: (1) you assume that component is
between-subject, which is a matter of debate since they come from the
same subject and are ordered the same way across subjects; (2) that
there are no violations of sphericity. For something to be
"independent" for the purposes of an ANOVA, the covariances need to be
0 between levels of component. Furthermore, I'm not sure if you can
say they are independent since each set of components only occurs in
one subject. Given these limitations and caveats, if you still want to
proceed, the contrasts are detailed below. If the measures are changed
to dependent, then you have to assume that SPM corrects for any
violations of sphericity. GLM Flex would be an alternative for 2
within-subject factors that uses partitioned variance for each factor.

> According to what I found they should be like this:
> 1) 1 -1 0 0 0 (comp.) zeros(1,18) (subjects) 0.5 0.5 0.5 -0.5 -0.5 -0.5 (interactions)
> but even this one is not accepted.
> What am I doing wrong and how to code contrast 2 and 3?
>

Since I don't see your design matrix, its hard to say, but I suspect
the order of columns is different from you contrast. I think that the
order is factor1, factor2, interactions, subjects. If you change the
order to the correct order, then it should work. Always check the
contrast against the design matrix to make sure you haven't created a
contrast that isn't consistent with the design matrix.

Contrast 2: 0 0 0 0 0 subjects 1 -1 0 -1 1 0;0 0 0 0 0 subjects 0 1 -1 0 -1 1

Again, I think you'll need to shift the subject columns to the end.

Contrast 3. 1 -1 0 0 0 subjects 0 0 1 0 0 -1. Again, check the order
of the columns.

Hope this helps.


>
> Thank you very much for your help
>
> Nikola