SPM - Standard SPM Tools
Table of Contents (this page)
SubPages
Setting up Statistical Analysis
Create folder where you want to save you analysis, get your images into common folders (perhaps one per group).
Run "Specify 2nd-level"
Choose design type - two-group comparison will use "Two-sample t-test." Choose scans, typically leave other settings under Design unchanged.
If you have a covariate, under Covariates select "new Covariate" and enter the values (in the order of the groups/scans) under Vector. Having the values in a tet file is often easier (copy and paste them). Name the covariate, and typically leave the other settings as they are.
For VBM-style analyses, typically do not use global calculation or normalisation (see SPM list for full details).
Select Directory for output (the folder you just created).
I typically save the job in the output folder as "job_design."
Run (pretty fast) - this displays a design matrix and save the model in an "SPM.mat" file in the output folder.
Estimate the model - "Estimate," select the SPM.mat you just created (5 minutes - 1 hour).
Blobology
After estimating a model, select "Results," select the SPM.mat. This brings up the Contrast Manager.
To see areas that are higher in group 1 than group 2, "Define new contrast...", select t-contrast, enter "1 -1" as the contrast weights vector (multipliers of columns); you will see a visual representation of the contrast above the design matrix. Click OK.
Select the contrast, 'Done."
typically, "No" to mask with other contrasts, title whatever you want.
Set p-value:
FWE = family-wise error control for multiple comparisons; the most conservative, close Bonferroni, hopeless for small numbers of subjects.
FDR = false-discovery rate control for multiple comparisons; more liberal than FWE, but adaptive and hard to compare between analyses.
none = set absolute threshold; often a good starting point (using the default 0.001) to get a sense of what is going on.
Choose the p-value you want.
Extent threshold is useful if you want to remove small clusters from your results, so typically we set it to 0 on our first pass.
You'll get the glass brain; to save the results, click "save" and enter a filename (e.g., "blobs.nii"); you will get a message saying where the file is saved. To overlay, select "overalys" - a single subject (Colin brain) is in spm5\canonical (as are averages of lots of subjects).
Group effects and interactions
SPM can implement any form of the general linear model so any factorial or regression design is possible. SPM has some specific ways in which group analyses, such as the two-sample t test, are implemented, but these can be complex as in the case of factorial designs. Following advice from Jeff Gornbein, we can use a regression model and introduce our won group and interaction variables, simplifying the interpretation and implementation.
Example: Effect of depression in OSA, accounting for age, disease severity and sex
We are interested in the effect of depression on the brain in patients with sleep apnea. We know there are interactions between sex and depression, sex and OSA, age and depression, and age and OSA. Furthermore, there are known interactions between age and OSA severity. It is therefore plausible and even likely that there will be interactions at the level of damage to the brain, so we want to test for these interactions.
We start by choosing categorical variables and levels, which are termed "main effects":
Depression, 2 levels (true/false)
Sex, 2 levels (male/female, with Female = False)
OSA severity, 3 levels (none, mild-moderate, severe)
For simplicity, we code k-level variables using k-1 two-level variables, so in our SPM design matrix we will have two columns for OSA severity (but these two columns still only refer to one main effect):
OSA mild-moderate, 2 levels (true/false)
OSA severe, 2 levels (true/false)
We then define the two-way interactions as all combinations of the main effects, where the combination is a multiplication:
Depression*Sex
Depression*OSA severity (this one interaction is coded as two variables: Depression*OSA mild-moderate, Depression*OSA severe)
Sex*OSA severity (coded as Sex*OSA mild-moderate, Sex*OSA severe)
For this example, we will choose age as a continuous variable, and assume no interactions. However, we will look to see whether the effect of age is better predicted by a non-linear effect, giving (for example) three "age" variables:
age
age^2 (squared)
log ( age )
We now need to check that each possible combination of categorical variables (each "cell") has at least one subject. The main effects should (obviously) meet this criterion, but the interactions may not. For example, there may be no "depressed females with severe OSA" Any interaction that does not have at least one subject for each condition cannot be included.
Note also that for an interaction, all the lower order terms must also be included. For a two-way interaction, all the main effects must be included, and for a three-way interaction, all the two-way interactions must be included.
The variables for main effects and interactions may be created in slightly different ways. First some terminology - a categorical variable may be coded as an "effect" variable, where the "false" condition is -1 and the "true" is 1, or as a "dummy" variable, where "false is coded 0 and "true" is coded 1. The difference is in interpretation of the model results, not the actual model. SPM default coding (e.g., two-sample t test) has a variation, which is using two dummy variables: 0/1 indicating "true" and 0/1 indicating "false;" in other words, a column for each group. However, the simplest coding scheme is a single variable dummy coding, so we will go with that.
Factorial Analyses, ANOVA's
Factorial or ANOVA models are usually tested for effects of interest first, and in those areas showing a significant effect further posthoc comparisons can be made.
Adjusted means
Adjusted means are used when doing a posthoc analysis of part of the model, and are useful when the groups are not matched for a continuous variable (e.g., age), and there is no interaction. Check out 13.5 in this chapter.
FIR Models
Finite Impulse Response (FIR) models model a response as a series of delta functions, i.e., a separate test is done at each time point. This is powerful, but trickier to analyze. From the SPM mail list:
I would like to compare the two conditions in each time bin...is it possible to do this at once? Which of the t- or f-test should I be using and what should I put for contrasts?
Two ways to compare A and B in your design are:
1) Use an F test, where each row of the F test compares A vs. B at one time point. For example:
[1 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0
.
.
.
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 -1]
or alternatively, use some Matlab functions:
[eye(9) 0-eye(9)]
The trick is that if you get a significant difference, you don't know which time bin caused it, or which direction the difference was in (A>B or B>A), so you would need to investigate further to find out (e.g., plotting effects for each region).
2) A simpler approach is to simply look at the total "area under the curve" for each condition in a t-test. This effectively discards the timing information:
[1 1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1]
for example would give you the sum of condition A compared to the sum of condition B (i.e., A > B). Alternatively you could write this ones(1,9) ones(1,9)*-1. Because this is a t-test it can give you information about directionality. However, you lose the temporal detail, which may be one of the reasons to choose an FIR model in the first place.
Ultimately it will depend on what you are most interested in. There is some discussion of FIR models in Chapter 30 of the SPM manual (Face Group fMRI Data), which may also be of interest.