Print

Print


sorry Donal, my fault

I am not referring to single-row F-tests as you mention, but to n-rows F-tests that one can use for plotting beta across all conditions of interest in the task.

In a standard RM ANOVA that include a factor condition and a factor subject (both main effects are modeled), I use the following F: eye(ncond)-ones(ncond)/ncond
Such F isn't really informative in itself, but it is convenient for plotting beta across the whole task

When coping with more than one group, as in a flexible factorial design, then I am stuck. The following test appears invalid.
ncond=4; ngoup=2; nsubj=10;
[zeros(ncond*ngroup, ngroup+ncond) kron([1 0; 0 1],eye(ncond)-ones(ncond)/ncond) zeros(ngroup*ncond, nsubj)]

In the previous example, I am considering a design where you have :
- 2 groups and 4 experimental conditions
- use flexible factorial including 3 factors (group, condition, subject)
- model the three main effects and the group*condition interaction

Hope my question was clearer :)

Swann

2011/11/28 MCLAREN, Donald <[log in to unmask]>
An F-test can test for the effect of the overall model (really not informative), main effects, effects of individual levels of a factor, differences between factors. Thus, there isn't 1 F-test that you should run. Different F-tests will test for different things and each one needs to be run separately.

Now, you need to form the F-test. Here are a few examples
For 1 factor 3 levels: 1 -1 0; 0 1 -1
For 2 factors 2 levels interaction: 1 -1 - 1 1
For 2 factors, one with 2 levels and one with 3 levels: 1 -1 0 -1 1 0; 0 1 -1 0 -1 1

These are the weights for each level/factor. Now you need to expand these, but before you expand them, you need to know the contrast for each level. That is where my email to Roy comes in. Start simple. Form S1G1C1, then S2G1C1, and so on. Then form your G/C contrasts. You will have K*M of these.

Now, you can form the full f-contrast.
For 1 factor 3 levels:
C1-C2; C2-C3 are the two rows.
For 2 factors, 2 levels interaction: G1C1-G1C2-G2C1+G2C2
For 2 factors, one with 2 levels and one with 3 levels:
G1C1-G1C2-G2C1+G2C2; G1C2-G1C3-G2C2+G2C3  are the two rows.

Hope that was clearer.


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
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 Mon, Nov 28, 2011 at 12:21 PM, swann pichon <[log in to unmask]> wrote:
I meant how shall the between factors be weighted, knowing that of course the interest lies in the condition and/or interaction.
From your response I don't understand whether they should be exculded/set to 0 from the Ftest or averaged as in the Ttest example you snet to Toy
cheers
2011/11/28 MCLAREN, Donald <[log in to unmask]>

Swann,

I'd suggest the F-test that is of interest to you. If you want the main effect of condition/time, then setup an F-test fot that. If you want the interaction, then setup an interaction.

The number of rows that you will need for an F-test of a main effect are K-1 where K is the number of levels of the the factor. The number of rows that you will need for and F-test of an interaction is (K-1)*(M-1), where K and M are the number of levels of the two factors.

For 3 factors (subject, group, condition), only condition and condition*group statistics are valid as they are both within-subject effects and the error term for the model is the within-subject error.

As for the variance question. The assumption that is being made is that the variance within each subject is equal, which should be the case since each subject did the same experiment.

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
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 Mon, Nov 28, 2011 at 11:56 AM, swann pichon <[log in to unmask]> wrote:
Hi Donald

By the way, which F test do you suggest using for this design? shall it includes all effects (main effects and interaction) or only the group*condition interaction ? (referring to the same design as Roy's, design 3 in Jan's helpful PDF, which includes the 3 main effects and the group*condition Interaction)

Also, I am not sure to get why variance of the subject factor shouldn't be set to unequal (as for the group factor) when studying say patients vs control.

Thanks for your inputs

Swann

--
Swann Pichon, PhD
Laboratory for Behavioral Neurology and Imaging of Cognition
Department of Neuroscience, University Medical Center
1 rue Michel-Servet, 1211 GENEVA 4, Switzerland
Tel: +41 (0)22 379 5979
Fax: +41 (0)22 379 5402
Gsm: +33 (0)6 26 43 83 61
http://labnic.unige.ch/

2011/11/28 MCLAREN, Donald <[log in to unmask]>

See inline responses below.

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
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 Mon, Nov 28, 2011 at 10:11 AM, Roy Cox <[log in to unmask]> wrote:
Dear all,

I'm trying to wrap my head around the way to set up F tests in SPM8. I'm using Rik Henson's 'ANOVAs and SPM' chapter, but when you're not familiar with the notation it's not very straightforward. Apologies for the hodgepodge of questions below.

I wish to perform a mixed anova: 1 between factor - 2 levels, 1 within factor - 2 levels, 30 subjects - 15 in each between-subject group. I'm interested in the main effects and the interaction.

1) From what I gather, for both main and interaction effects you set all subject factors in the contrast to zero. At least, for a two-by-two within-subject design this is the case. Is this still valid for mixed designs?

Only for within-subject designs. For mixed designs, the between-subject effects are INVALID because the wrong error term is used. However, the magnitude of the between-subject effects is correct. The between-subject effects will not have zeros above the subject term. See http://www.martinos.org/~mclaren/ftp/presentations/OHBM2011_v3.pdf for details.

As an extension, multiple within-subject factor designs are valid under the assumption that you can correct for any non-sphericity.
 

2) It is mentioned that there are equivalent ways of setting up a contrast: rotated and unrotated. But which one does SPM normally use? Or, as I suspect, does it depend on your design matrix? If so, how do you set up your design matrix to be rotated or unrotated? And what would the corresponding contrasts be?

I'll let Rik or someone else answer this one. 

3) In the 'generalisation to m-way anovas' section the Kronecker product is explained as the way to derive contrasts for any type of design. But is there a function in SPM or matlab that takes care of this, or am I to write my own code?

Here is a quick tutorial on building contrasts.
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. (NOTE: in the following subjects came first, they are now last AND then group and then condition).

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 of Group and C1/C2 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]
 

4) How to set up my design matrix? Although to my mind, I want to perform a full factorial anova, it seems I must make use of the flexible factorial model, right? I'm a bit confused by the help provided by the gui, saying you can use 'subject' and 'repl' to model subjects and replications. Would my within-subject factor count as a replication, even though the two scans are from different conditions?

Use the flexible factorial design as it lets you properly set the dependence and variance of each factor and explicitly models them. Additionally, it includes a subject term. See http://www.martinos.org/~mclaren/ftp/presentations/OHBM2011_v3.pdf for the differences.

See attached file conweights.pdf for details on setting up the flexible factorial design. Although the document describes a main effect of group, the main effect of group is invalid. If you want the effect of group or any between-subject effect than you need a different model with only one observation per subject.
 

Finally, if anyone has useful literature on this topic that is both in-depth and accessible, I'd be very grateful.

Let me know if you need more details.
 

Thank you,

Roy


--
Roy Cox, M.Sc. | Brain & Cognition Group | Department of Psychology | University of Amsterdam | Weesperplein 4 | 1018 XA Amsterdam | the Netherlands | room 3.21 | phone: +31 20 525 6847 | email: [log in to unmask]









--
Swann Pichon, PhD
Laboratory for Behavioral Neurology and Imaging of Cognition
Department of Neuroscience, University Medical Center
1 rue Michel-Servet, 1211 GENEVA 4, Switzerland
Tel: +41 (0)22 379 5979
Fax: +41 (0)22 379 5402
Gsm: +33 (0)6 26 43 83 61
http://labnic.unige.ch/




--
Swann Pichon, PhD
Laboratory for Behavioral Neurology and Imaging of Cognition
Department of Neuroscience, University Medical Center
1 rue Michel-Servet, 1211 GENEVA 4, Switzerland
Tel: +41 (0)22 379 5979
Fax: +41 (0)22 379 5402
Gsm: +33 (0)6 26 43 83 61
http://labnic.unige.ch/