Print

Print


Start with the null hypothesis. In your case, 
Ho: T1D1-T2D1=T1D2-T2D2=T2D1-T3D1=T2D2-T3D2=T1D3-T2D3=T1D4-T2D4=T2D3-T3D3=T2D4-T3D4

From this (and statistics [N-1*K-1]=3-1*4-1=6), you will see that you need 6 rows in your contrast:
T1D1-T2D1=T1D2-T2D2
T2D1-T3D1=T2D2-T3D2
T1D2-T2D2=T1D3-T2D3
T2D2-T3D2=T2D3-T3D3
T1D3-T2D3=T1D4-T2D4
T2D3-T3D3=T2D4-T3D4

Each of these gets converted to a contrast by making them equal to 0.

Now you need to build these 6 contrasts.

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,
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]
....
Now average your G1C1 and by summing and dividing by the number of
subjects, you'd get
G1C1=[ones(1,18)/18 zeros(1,9) 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0]
and
G1C2=[ones(1,18)/18 zeros(1,9) 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0]
and
G2C1=[zeros(1,18) ones(1,9)/9 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0]
and
G2C2=[zeros(1,18) ones(1,9)/9 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0]

Now subtract G1C1-G1C2 AND G2C2-G2C1
G1C1-G1C2=[zeros(1,27) 0 0 1 -1 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0]
and
G2C1-G2C2=[zeros(1,27) 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0]

Now subtract these two:
Interaction contrast=[zeros(1,27) 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 -1
1 0 0 0 0 0]

And enter it into SPM.

** In your case, you will enter all six contrast from above into SPM as an F-test.

Best Regards, Donald McLaren
=================
D.G. McLaren, Ph.D.
Postdoctoral Research Fellow, GRECC, Bedford VA
Research Fellow, Department of Neurology, Massachusetts General Hospital and
Harvard Medical School
Website: http://www.martinos.org/~mclaren
Office: (773) 406-2464
=====================
This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED
HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is
intended only for the use of the individual or entity named above. If the
reader of the e-mail is not the intended recipient or the employee or agent
responsible for delivering it to the intended recipient, you are hereby
notified that you are in possession of confidential and privileged
information. Any unauthorized use, disclosure, copying or the taking of any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful. If you have received this e-mail
unintentionally, please immediately notify the sender via telephone at (773)
406-2464 or email.




On Fri, May 4, 2012 at 5:07 PM, Annchen Knodt <[log in to unmask]> wrote:
Hi SPMers,

We're looking to run a repeated measures ANOVA in SPM to test for interactions between our two experimental factors.  In our experiment, we have 17 subjects with 3 scans each (time factor), and each subject is assigned to 1 of 4 drug treatment groups (dose factor).  We're wanting to see if there's an interaction between time and dose.

We've started out using flexible factorial in SPM and have set up our design matrix to have 36 columns in the following order: subjects (17 columns), time (3 columns), dose (4 columns), time*dose (12 columns).  We're quite unsure about how to define the contrasts.  We've consulted the Glascher/Gitelman tutorial and other listserv posts, but we don't know how to expand what we find there to our case of 3x4.

Our first stab at it involved the following reasoning: a main effect of time modeled in those interaction terms might look something like:
M1 = zeros(3, 24) m1 m1 m1 m1
where m1 is:
1 −1/3 −1/3
-1/3 1 −1/3
-1/3 −1/3 1
 and a main effect of dose modeled similarly might look like:
M2 = zeros(3,24) m2 m2 m2
where m2 is:
1 −1/4 −1/4 −1/4
−1/4 1 −1/4 −1/4 
−1/4 −1/4 1 −1/4
−1/4 −1/4 −1/4 1
We thought of multiplying all pairs of rows of M1*M2 to give a 12x36 matrix but the contrast manager wouldn't accept it.

Our next attempt was just to use the single row: zeros(1,24) 3 0 −3 1 0 −1 −1 0 1 −3 0 3, but again we got the invalid contrast message.

Could anyone offer some advice to steer us in the right direction?

Thanks so much!!!

Annchen


~~~~~~~~~~~~
Annchen Knodt
Graduate Student
Computational Biology & Bioinformatics Program
Laboratory of Neurogenetics
Duke University