Tuesday, May 22, 2012

2 x 2 Repeated Measures ANOVA

Goal of this blog: Illustrate how to specify the 2nd-level fMRI model for 2x2 repeated measures ANOVA using SPM8's interface.

Design: single-group fMRI design

Two within-subjects factors: A and B
A has two levels: A1 and A2
B has two levels: B1 and B2
In this example, number of subjects: 5 (each subject has received all experimental conditions)

Research questions: What are the main effects and interaction effect of A and B?

Postprocessing Procedure:


1. For each subject individually, specify the 1st-level model in order to estimate the beta coefficients for A1B1, A1B2, A2B1, A2B2, respectively, in the form of t-contrasts against 0. The corresponding filenames are: con_0001.nii, ... con_0004.nii. For each subject, you can rename these files more intuitively as subject0001_condition0001.nii, ... subject0001_condition0004.nii, respectively.

Because we have 5 subjects, we will have totally 5 subjects x 4 conditions = 20 files


2. For the group as a whole, specify the 2nd-level model in order to estimate the beta coefficients for the two main effects and the interaction effect, while controlling for the subject effect.

You can download the module 2x2_repeated_measures.mat and modify it as needed

Some comments about this module:

a) This uses "Flexible factorial" design, because it allows flexibly specifying Subjects effect
b) Subjects factor is typically specified as Independence = Yes, Variance = Equal
b) Factors A and B are specified as Independence = No, Variance = Unequal


3. After model estimation, specify two t-tests for the main effects and one F-test for the interaction effect:

a) T-test main effect of A1 > A2: "1 -1 0 0 0 0 0 0 0 .5 .5 -.5 -.5"
= "1 -1 0 0" (A1 A2 B1 B2) + "0 0 0 0 0" (Subjects) + ".5 .5 -.5 -.5" (A1B1 A1B2 A2B1 A2B2)

b) T-test main effect of B1 > B2: "0 0 1 -1 0 0 0 0 0 -.5 .5 -.5 .5"
= "0 0 1 -1" (A1 A2 B1 B2) + "0 0 0 0 0" (Subjects) + "-.5 .5 -.5 .5" (A1B1 A1B2 A2B1 A2B2)

c) F-test interaction effect of A1B1 - A1B2 ≠ A2B1 - A2B2: "0 0 0 0 0 0 0 0 0 1 -1 -1 1"
= "0 0 0 0 " (A1 A2 B1 B2) + "0 0 0 0 0 " (Subjects) + "1 -1 -1 1" (A1B1 A1B2 A2B1 A2B2)


Acknowledgement:

Special thanks to Aaron Schultz for very helpful advices. The same results can be also obtained by running GLM_Flex with specifying I.CompOpt = 1;

2 comments:

  1. Hi Daniel!

    I downloaded the module 2x2_repeated_measures.mat and specified the con files of my design. However, the contrasts a and c gets accepted but contrast b does not get accepted for the same. I don't understand where i am making a mistake.

    ReplyDelete
  2. Hi Daniel, thanks for the very helpful post!

    Even though it was posted a long time ago, I was wondering if you still have the file 2x2_repeated_measures.mat to upload it again.

    Thanks in advance!

    ReplyDelete