Print

Print


Dear Ping, 

Concerning the attached design matrix, this is because you have set variance to unequal, which affects the covariance structure and the design matrix. For factor "subject" variance should be set to equal (at least this is the assumption for the other repeated measurement designs in SPM, namely the "Paired t-test" and the "One-way ANOVA - within subject").

Concerning the other study/model, first of all, given the two levels for each of the factors means you could set up all the relevant contrasts on single-subject level and forward each of the con images into a separate one-sample t-tests which facilitates the issue to a large extent. This would correspond to results from an ANOVA with partitioned error terms.

Your current design matrix only includes columns for main effects and two-way interactions. If you explicitely don't want to add a term for the three-way interaction to the model this is alright, but if it's due to the limitations within the GUI then I would suggest to rely on the latest SPM12 version. Thanks to Guillaume Flandin r6470 onward allows three-way interactions (and higher). For that purpose download r6470, enable the option by altering spm_cfg_factorial_design.m in spm12\config folder, instead of fnums.num = [2 1]; (line 579) it must read fnums.num = [Inf 1]; Within the SPM GUI you can now specify three-way interactions by adding an "Interaction" defined as e.g. [1 2 3].

In general, for a model with three within-subject (and terms for two-way and three-way interactions) you would need e.g.
- one column coding a constant term
- one column coding the difference between A1 and A2
- one column coding the difference between B1 and B2
- one column coding the difference between C1 and C2
- one column coding the interaction A x B
- one column coding the interaction A x C
- one column coding the interaction B x C
- one column coding the interaction A x B x C
... thus 8 columns for the experimental factors/interactions. 

I guess this is also what the statistician had in mind who Donald talked to ("main effects should be in the model"). However, there are other ways to set up equivalent design matrices (think of effect vs. dummy coding). The options are limited within the SPM GUI though. 

With SPM's Flexible factorial (which relies on a single, pooled error term) you obtain overdetermined design matrices when including both main effects and interactions. This is because you don't get something like 
- one column coding a constant term
- one column coding the difference between A1 and A2
- one column coding the difference between B1 and B2
- one column coding the difference between C1 and C2
- one column coding the interaction A x B
- one column coding the interaction A x C
- one column coding the interaction B x C
but rather, the included interactions are implemented as a series of columns that code the different factor level combinations, e.g. for the two-way interaction A x B you get four (dummy coding) columns A1B1, A1B2, A2B1, A2B2. Based on these columns you could already test for A1-A2 or B1-B2. Thus, the terms "interaction" and "main effect" within the GUI are misleading. Adding "only" e.g. the interaction A x B does not mean your model only has the interaction term, but rather, the interaction term but also two terms for the corresponding main effects. More generally, adding the highest-order interaction will result in a series of columns (that usually correspond to the "conditions" from the single-subject models) which automatically allow to test for all lower-order interactions and main effects. In contrast, lower order interactions don't allow to test for higher order interactions.

In your current design matrix (as in attached d1) some of the columns are linear dependent. The first two columns are linear dependent anyway (could be collapsed into a single column with ones and minus ones). But e.g. the first column (coding A1) is also the sum of the columns A1B1 and A1B2, or the sum of A1C1 and A1C2. This is accounted for during model specification/estimation, thus in the plotted design matrix, "leaving x degrees of freedom from y images" corresponds to the "correct" loss of df and not the no. of (redundant) columns. The statistical solution for overdetermined models like that is explained in http://www.fil.ion.ucl.ac.uk/spm/doc/books/hbf2/pdfs/Ch7.pdf on page 6f.

In any case, and as it usually facilitates setting up the contrast vectors, you could leave out the three main effects (losing the first six columns) right from the beginning & just include the three two-way interactions. When testing for A1 vs. A2 results are identical to the model in which main effects were explicitely included via the GUI (see attached d2 and d1 for comparison). 

Now, consider the suggested model with a term for the three-way interaction (see attached batch, as stated, you'll need r6470 plus the manual adjustment). Adding the three-way interaction to the design (via e.g. [1 2 3]) plus a main effect for subjects (e.g. [4]) will result in eight columns A1B1C1 A1B1C2 A1B2C1 A1B2C2 A2B1C1 A2B1C2 A2B2C1 A2B2C2 plus those for the Subjects Sub1 Sub2 ... (as in d4). This is sufficient. Correct contrast vectors would be (please double-check yourself):
Main effect A: 1/4 1/4 1/4 1/4 -1/4 -1/4 -1/4 -1/4 ...
Main effect B: 1/4 1/4 -1/4 -1/4 1/4 1/4 -1/4 -1/4 ...
Main effect C: 1/4 -1/4 1/4 -1/4 1/4 -1/4 1/4 -1/4 ...
Interaction A x B: 1/2 1/2 -1/2 -1/2 -1/2 -1/2 1/2 1/2 ...
Interaction A x C: 1/2 -1/2 1/2 -1/2 -1/2 1/2 -1/2 1/2 ...
Interaction B x C: 1/2 -1/2 -1/2 1/2 1/2 -1/2 -1/2 1/2 ...
Three-way A x B x C: 1 -1 -1 1 -1 1 1 -1 ...
Again, results are identical to the model with three main effects (plus main effect subject), three two-way interactions, the three-way interaction (see d3 vs. d4).

Hope this helps

Helmut