We have a group of 6 subjects scanned under two different conditions, A (left hand motor function) and B (right hand). Is there a significant A-B paired difference generalisable to the population from which the subjects are drawn? (Note that this is a stroke study, and hence comparing left and right motor function is particularly interesting in this case.)
We want the A-B paired mean difference within a mixed effects model, taking into account the within-subject fixed effects variances and the between-subject random effect variance. This is done as a two-level analysis:
Note that as well as the COPEs, FEAT passes the variance of these COPEs ("varcopes"), and even the uncertainty in the variance of these COPEs ("tdofs" - degrees-of-freedom), between the different levels.
The first level analyses are held in 6 different directories in
~/fsl_course_data/fmri/ptt, one for each subject. The
subject directories are ac at cm df dn eg. Within these
are the first-level FEAT directories, which have already been run for
you.
Each first-level analysis contained 5 contrasts (each related to finger tapping - i.e. "index" finger only,
"sequential" order, etc.). Thus there are 5 copes in the stats
subdirectory of each first-level .feat directory. The
higher-level analysis will be carried out independently on these
contrasts, i.e. a second-level analysis of all subjects' first-level
"index" contrasts, a separate second-level analysis of all first-level
"sequential" contrasts, etc. Each of these second-level analyses will
form a separate cope??.feat directory inside a
newly-created .gfeat directory.
cd ~/fsl_course_data/fmri/ptt
Feat &
Feat_gui & on Mac)
First-level analysis to Higher-level
analysis
Number of inputs to 12 (6
subjects * 2 conditions)
Select FEAT directories. Now, you need to fill
the first level FEAT directories in a sensible
order. You could either put them in
order: .../ac/ac_left.feat
.../ac/ac_right.feat .../at/at_left.feat
(etc.).../ac/ac_left.feat
.../at/at_left.feat .... .../ac/ac_right.feat
(etc.)We recommend the latter, because this matches the example paired t-test in the FEAT manual, and also matches the way the paired t-test is setup for you if you use the "model setup wizard" (explained below).
Note that you can often avoid having to tediously hand-select each
of these first-level FEAT directories separately, using
the Paste button. If you press this, a new free-text
window comes up, within which you can paste text (in this case the
list of first-level FEAT directories) which you can copy, e.g. from
a list in a terminal. Press Clear to clear the text
window. Then in your terminal, inside the ptt
directory, type ls -d1 `pwd`/??/??_left.feat ; ls -d1
`pwd`/??/??_right.feat
This gives you a complete listing
of the full pathnames of the FEAT directories in the right
order. (The `pwd` part tells the shell to replace
what's within the quotes with the result of running the command - in
this case, filling out the full pathname of the current
directory. The ? characters are expanded by the shell
to fit any single character, in alphabetical order, hence all the
"left" FEAT directories are listed first, and then all the "right".)
You can now highlight this list with the mouse, and paste it into
the FEAT paste window with the middle mouse button (or possibly by
clicking in the paste window and typing control-y).
Output directory to ~/fsl_course_data/fmri/ptt/ptt_ols.gfeat
Stats tab and select the Mixed
Effects: Simple OLS option. Also, make sure that the
Use automatic outlier de-weighting button is not turned
on. It is important that these two settings are chosen, otherwise the
analysis will not be quick enough to be of use to you in the time that
we have available for the practical. Normally, we recommend that
the more accurate FLAME 1 option is used in combination
with outlier de-weighting, for the reasons outlined in the
lectures. However, in the interest of speed, in this practical we
choose the faster OLS option without outlier de-weighting.
Model setup
wizard, which provides an easy way of setting up a few
simple designs. Select two groups, paired and press
Process. You will now see the design matrix that
has been created for you. To understand how this is controlled
in detail, open the Full model setup.
Note that the Inputs (1-12) must correspond to the order you
entered the first-level FEAT directories. Also note that the first
column (labelled Group) corresponds to groupings of
inputs that will share the same random effects (RE) variance in this
level of the model. Here, we let all subjects have the same RE
variance (i.e. the Group column should be left as all 1s)
There are 7 EVs:
Click on the Contrasts & F-tests tab. There are two
contrasts setup for you by the wizard. EVs 2-7 are confounds of no
interest and so do not appear in the contrasts. Hence, the contrasts
only involve EV1. Change the Titles to read:
Done.
Post-stats are fine. So you are now
ready to run the analysis. Press Go, and
wait for the results - this second-level analysis should
take about 5 minutes. The web browser that appears
monitors the overall progress.
.gfeat
directories. The top-level web report provides links to the previous
level reports, a registration summary page (have a look at this, you
may later need to reload the page if you view it before it's
completed) and to the separate higher-level reports. LOOK AT YOUR DATA
- in particular it is always important to look at the registration
summary report page very carefully, to check that all lower-level
registrations succeeded. (If any of the lower-level FEATs look like
the registration has failed badly, you need to fix this before
re-running the higher-level FEAT. The simplest way to do this is to
start the FEAT GUI, change Full analysis
to Registration only, select the first-level FEAT
directory with the problematic registration and change the
registration settings. The first thing to try is to reduce the search
to No search (assuming that the data is roughly oriented
correctly) and/or to change the DOF.)
Mixed
Effects: FLAME 1, which is nearly as accurate as full FLAME and
nearly as fast as OLS. Change the output directory name to reflect
this option. Under the Data tab, deselect all of
the lower-level copes except 2 - this tells the group
FEAT to only run the second-level analysis on the second of the
first-level contrasts, not all 5. After completion (5-10 minutes),
compare with the OLS results. The FLAME results do look
"nicer", as well as there being some new plausible activations that
were not previously found.
We want the mean group difference, within a mixed effects model, taking into account the within-subject fixed effects variances and the between-subject random effect variance. This is done in THREE levels:
Because each subject only has 3 sessions, we do not run a mixed effects second-level analysis to get an estimation of each subject's mean response. The reason for this is that we would not be able to get a good estimation of the within-subject session-to-session variance with just 3 sessions. Hence we choose to ignore the session-to-session variance by using a fixed effects analysis at this second level. See here for a more involved discussion of the choice of a fixed effects analysis.
In addition to this, the analysis cannot be combined into a single second-level analysis. This is tempting as a design matrix can easily be formed containing each subject's mean (across sessions) as a separate EV, and then contrasts can be formed to test the mean across all subjects. The problem with this model is that there are two separate sources of variability (session-to-session and subject-to-subject) but they cannot be modelled properly (with the correct weighting) in a single level.
The first-level analyses are held in the
directories ~/fsl_course_data/fmri/3lev/patients and
controls. Within these directories are a directory for
each subject, each containing the three first-level FEAT directories
which have already been run for you.
So, let's start with the level 2, within-subject analysis
cd ~/fsl_course_data/fmri/3lev
Feat &
First-level analysis to Higher-level
analysis.
Number of inputs to 30 (2 groups * 5
subjects * 3 sessions).
Select FEAT directories. Now, you need to
specify the first level FEAT directories in a sensible
order: control subject 1 sessions 1, 2, 3 then control
subject 2 sessions 1, 2, 3, etc., followed by all the
patient sessions. You can use the following command in
the terminal to create the list to paste into
the Paste window:ls -d1
`pwd`/*/*/*.feat
Output directory
to ~/fsl_course_data/fmri/3lev/lev2.gfeat
Stats tab and select the Fixed-effects option.
Full model setup. Note that the Inputs (1-30)
correspond to the order you entered the first-level FEAT
directories. As this is a FE analysis the
Group column is ignored so leave all these
entries as 1 (if we had lots of sessions and did a ME
analysis instead then we would use a unique number in
this column for each subject - within each subject we
would estimate a separate variance).
Done and ensure that the design matrix is the
same as:
Post-stats are fine (in fact the
post-stats don't affect what gets passed up to
third-level). So you are now ready to run the
second-level analysis. Press Go, wait for
the result web pages and then view
them carefully.
Feat &
First-level analysis to Higher-level
analysis
Inputs are lower-level FEAT directories to
Inputs are 3D cope images from FEAT directories (the inputs will be
the 10 cope images, one for each subject mean, from the
second-level analysis).
Number of inputs to 10 (2 groups * 5
subjects = 10 copes from level 2, each corresponding to
a subject mean)
Select cope images and enter the COPEs from
the second level in order from 1-10. This ensures that
1-5 correspond to controls and 6-10 correspond to
patients. These will be inside the cope1.feat/stats
directory which is inside the second-level .gfeat
directory that you just created.
The relevant command for pasting the list is
ls -d1 `pwd`/lev2.gfeat/cope1.feat/stats/cope?.nii.gz ; ls -d1 `pwd`/lev2.gfeat/cope1.feat/stats/cope??.nii.gz
Stats tab and, again to save
time, select the OLS option and make sure Use automatic outlier
de-weighting is turned off.
two groups,
unpaired analysis (make sure the "Number of
subjects in first group" is set appropriately). Note that
the Inputs (1-10) correspond to the order you entered the second
level COPEs. Here, the control subjects are modelled with one
RE variance and the patient subjects with a different RE
variance (i.e. Rows 1-5 of the Group column should
be 1 and Rows 6-10 should be 2). The two EVs model the different
means for the different groups.
Do you think there is anything wrong with setting the design up in this way?
Press View Design and you will see that there is
indeed a problem with setting the design up this way. We have a design
matrix that is not "separable" with respect to the variance groupings.
We are trying to set up a design with different RE variance groupings for the control subjects and patient subjects. However, within each EV, inputs from only one of the variance groups can have non-zero values. We have violated this here. If we only had one variance group instead, then these two ways of setting up the model would be equivalent.
Post-stats. Reduce the Z
threshold to 1.7 (with this artificially small
number of subjects the effect is weak!). The other defaults are
fine. So you are now ready to run the third-level analysis; press
Go.
This is the end of the Multi-level FEAT practical.