3. Model specification & parameter estimation

This section deals with the specification of a model to analyse imaging data, and subsequent parameter estimation. Statistical inference is performed using the Results option (see 4). SPM distinguishes three classes of models:

3.1 PET/SPECT models (spm_spm_ui.m)

SPM offers a number of PET/SPECT prototype models, which limits the number of necessary specifications for easy use.

N.B.

Example 1: single-subject: conditions & covariates

Select:

Specify a vector whose length equals the number of scans, e.g. 1 2 1 2 1 2 1 2 1 2 1 2:

Specify:

If a covariate is modelled, specify a vector whose length also equals the number of scans:

Specify (e.g., time):

Specify:

'none' will model the covariate (=time) as one parameter (time x session) or column in the design matrix (see below); 'with condition' as two (time x cond1 and time x cond2).

Specify:

Centring a covariate ensures that main effects of the interacting factor are not affected by the covariate, therefore SPM suggests centring on the overall mean. If 'interaction by condition' had been specified, the default becomes 'centring around condition means'.

Specify:

(=0 in this example; otherwise, specification of nuisance variables is similar to covariates).

Specify:

Scan to scan differences in global flow can be:

AnCova is advised for multi-subject studies unless differences in global flow are large (e.g., due to variability in injected tracer dose). Because AnCova also uses one degree of freedom for each subject/group, proportional scaling may be preferable for single-subject studies.

If proportional scaling is selected, specify:

the default of which scales the global flow to a physiologically realistic value of 50 ml/dl/min.

Specify:

to ensure that only grey-matter voxels are included in the analysis, by masking out from all scans voxels that fail to reach the specified threshold.

If 'proportional' is selected, specify:

the default being 80% of the mean global value. If thresholding is to be omitted, specify '-Inf'.

Specify:

The default is a two-step process in which first the overall mean is computed, after which voxels which do not reach a threshold of overall mean/8 (i.e., those which are extra-cranial) get masked out, followed by a second computation of the mean of the remaining voxels.

Output from PET/SPECT models (spm_spm_ui) for example 1:

Display: SPM displays a design matrix having columns for each parameter (in this example, two conditions, one covariate, and one constant (block)) and a row for each scan. The grey-and-white bar below the design matrix signals that the matrix is rank deficient (columns 1,2 and 4 are linearly dependent) which limits selection of meaningful contrasts (parameter weights) for condition effects to those which sum up to zero (see 4).

File: the design matrix will be saved as SPMcfg.mat in the working directory.

Specify:

to begin parameter estimation now or at a later stage. If 'later', select 'Estimate' (middle panel) and select the appropriate SPMcfg.mat file.

Example 2: Multi-subject, cond x subj interaction & covariates.

Consider a study in which five subjects perform an attention task with two stimulus types alternated with rest (ABRABRABRABR, suitably randomised across subjects) where individual differences in arousal (measured as skin conductance (GSR)) may interact with performance.

Specify (5):

Select:

Specify (for each subject) a vector whose length equals the number of scans, e.g. A B R R A B B R A A R B:

Specify (1):

Specify a vector whose length equals the total number of scans:

Specify (GSR):

Specify (with subject):

'none' will model the covariate (=GSR) as one parameter (GSR x session) or column in the design matrix (see below); 'with condition' as three (GSR x cond1-3) and 'with subject ' as five (GSR x subj1-5).

Specify:

Centring a covariate ensures that main effects of the interacting factor are not affected by the covariate, therefore SPM here suggests centring on subject means.

Specify (0):

Select:

Scan to scan differences in global flow can be:

AnCova is advised for multi-subject studies unless differences in global flow are large (e.g., due to variability in injected tracer dose). Because AnCova also uses one degree of freedom for each subject/group, proportional scaling may be preferable for single-subject studies.

If AnCova is selected, specify:

the default corrects for subject to subject differences in mean global flow (within-subject differences were modelled during the previous step).

Specify (50):

the default of which scales the global flow to a physiologically realistic value of 50 ml/dl/min.

As in example 1, specify:

to ensure that only grey-matter voxels are included in the analysis, by masking out voxels which fail to reach the specified threshold.

If 'proportional' is selected, specify:

the default being 80% of the mean global value. If thresholding is to be omitted, specify '-Inf'.

Specify:

the default is a two-step process in which first the overall mean is computed, after which voxels which do not reach a threshold of overall mean/8 (i.e. extracranial voxels) get masked out, followed by a second computation of the mean of the remaining voxels.

Output from PET/SPECT models (spm_spm_ui) for example 2:

Display: SPM displays a design matrix having columns for each parameter (in this example, fifteen conditions (three conditions, modelled separately for each subject), one covariate (GSR for each subject), five constants (block) and five nuisance variables (GBF)), and a row for each scan. The grey-and-white bar below the design matrix signals that the matrix is rank deficient (columns 1-15 and 21-25 are linearly dependent) which limits selection of meaningful contrasts (parameter weights) for condition effects to those which sum up to zero (see 4).

File: the design matrix will be saved as SPMcfg.mat in the working directory.

As in example 1, specify:

to begin parameter estimation now or at a later stage. If 'later', select 'Estimate' (middle panel) and select the appropriate SPMcfg.mat file.

N.B.

Output from PET/SPECT parameter estimation (spm_spm.m):

3.2 fMRI models (spm_fmri_spm_ui.m)

3.2.1 Specification of a model - first step:

Select 'specify a model':

As with PET/SPECT, SPM'99 allows separate model specification & inspection, and parameter estimation, for fMRI designs. However, fMRI model building is more flexible, the main distinction being between epoch- and event-related designs.

N.B.

  1. specification of conditions, timings, user-specified covariates, and regressor types (e.g. boxcar),

  2. selecting scans, modelling nuisance variables and other confounds, i.e. low-frequency drifts and temporal autocorrelation,

  3. parameter estimation. This permits the use of a single design matrix (i.e., the first step) for different data sets (sessions/subjects) acquired with the same paradigm, and also for designing an experiment (stochastic designs, see below). In SPM, the first step is termed 'specify a model', the second and third 'estimate a specified model'.

Specify:

N.B.

Specify:

Here SPM does not distinguish between sessions and subjects: e.g., for a design with 4 subjects each having two sessions of 96 scans, enter 96 96 96 96 96 96 96 96.

When more than one session is entered, specify:

If 'no', SPM will prompt for the number (and names) of conditions / trials for each session. If 'yes', specify:

If 'no' (as will be usually the case, i.e. when replications are randomised across sessions), SPM will prompt for onset times/trial lengths for each session.

Specify:

for all sessions combined when conditions are replicated, or otherwise for each session separately.

Specify:

for each condition.

Specify:

This option allows building an (event-related) experiment rather than analysing one. If 'yes', SPM will prompt to specify:

  1. Whether to include a null event,

  2. Whether there is a fixed time delay between consecutive events of the same type (SOA, see below),

  3. The relative frequency of event types (e.g., 1/1),

  4. Whether this frequency should be stationary or modulated across the experiment.

The resulting design matrix can be used for both conducting and analysing an experiment. Otherwise, select 'no'.

Specify:

if 'fixed', specify:

SOA = stimulus onset asynchrony = time (in scans) between the onset of two consecutive appearances of the same condition/trial type. This must be entered for each trial/condition.

Specify:

for each trial/condition. For example, if the1st trial occurs at the beginning of the first scan, enter 0, if it occurs halfway through the 3rd scan, enter 2.5.

If SOA = 'variable', specify:

again for each trial/condition. Enter the onset in scans for each occurrence of the trial. The length of this vector should equal the number of times the trial occurs (replications).

Next, specify:

and if yes, specify trial durations for each replication:

Again, the length of this vector should equal the number of trials (4 in this example).

N.B.

Specify:

This option allows modelling changes over replications of conditions/trials across session.

If 'time' or 'other', select:

to model linear, exponential, or polynomial changes. (When choosing 'polynomial', SPM will prompt for the order of the polynomial, the default being 2 generating a polynomial with linear + squared components).

Next, specify condition or trial numbers in which a parametric term should be included (e.g. for 2 trials, select 1, 2 or both):

If 'other', SPM will also prompt for a vector whose length is equal to the number of replications (e.g., 10):

For two or more condition/trial types, specify:

For each condition, trials should be either events or epochs. If mixed, SPM prompts to specify 'events' or 'epochs' for each condition separately. If there is only one condition, SPM will also prompt to specify 'events' or 'epochs'.

For an epoch design, select:

i.e., a function or set of functions which, convolved with the timings specified earlier, provides the most adequate modelling of the data. Basis functions are more flexible than fixed response models but their components usually cannot be interpreted in a physiologically meaningful way; therefore multivariate or F-contrasts are required for statistical inference (see 4). A discrete cosine set may be useful when a steady-state response does not occur; SPM will prompt for the number of functions (default = 2). Similarly, mean & exponential decay may be chosen when the response decreases over time within an epoch (as opposed to across replications, see above).

Next, select:

Convolving with the canonical hemodynamic response function (hrf) will add a delayed onset, early peak, and late undershoot to the model.

Select:

if yes, the partial derivative of e.g. the boxcar function with respect to time is added as an additional regressor, which will enable modelling of slight onset differences.

Finally, specify for each condition modelled as epochs:

For an event-related design, select:

N.B.

For both epoch and event-related designs, specify:

This option allows modelling (regressing out) of non-linearities due to the interaction of successive trials of the same type (for example, repetition suppression (priming)). Use also when the time between successive events is 2s or less.

Specify:

to model any other covariates (i.e., other than modulation across replications (e.g., time) or within a block (=mean and exponential decay, see above)). SPM will prompt for a vector whose length equals the number of scans (e.g., 64):


Output from fMRI model specification (spm_fmri_spm_ui.m) - first step:


Display: shown for an event-related design, 112 scans, one event type, modelled using a canonical hrf with time and dispersion derivatives. There are six panels:



N.B.

File: the output of fMRI model specification at this point is saved as SPM_fMRIDesMtx.mat in the working directory.

N.B.


3.2.2 Specification of a model - second step:

To complete specification and proceed to estimating your model, select estimate a specified model from 'fMRI models':

Select:

Select scans (for each session/subject):

Specify:

which provides the option of scaling global activity within a session (scaling across sessions/subjects occurs implicitly). This may remove e.g. scanner drifts within a session; on the other hand, large activations may be scaled down as well.


Specify:

Select specify if low-frequency confounds are to be removed.

:

The default suggested by SPM for epoch designs is two times the experimental cycle, e.g., for an ARAR?. design with A=8 scans and R=6, the default cut-off is 2(8+6)*TR. For event-related designs, the default is two times the longest interval between two appearances of the most frequently occurring event. For both epoch- and event-related designs the lower threshold is 32sec, the upper threshold is 512sec.


Specify:

If there were no correction for temporal autocorrelation in fMRI data, statistical inference would produce inflated results (the actual number of degrees of freedom is lower than the number of observations (scans)). SPM99 gives two options to deal with this problem:

  1. Replacing the unknown autocorrelations by an imposed autocorrelation structure, by smoothing the data with a temporal filter that will attenuate high frequency components, hence a 'low-pass filter'. The shape of this filter can be either Gaussian or hrf. Differences between these two are slight but hrf may provide a better sensitivity for event-related data modelled using a hrf-basis function;

  2. Attempting to regress out the unknown autocorrelations (AR(1)-model, see below).


If Gaussian, specify filter width (default = 4sec):

A large (wide) filter implies that attenuation will occur at lower frequencies (or, put differently, that high frequencies will be suppressed more) than with a small filter. The trade-off is that a large filter may remove interesting data while a small filter will not be adequate to impose a new (known) autocorrelation structure on the data.


Specify:

AR(1) = auto-regression (1) = modelling serial correlations by regressing out the variance explained by the previous observation (scan).


N.B.


Finally, specify:

i.e., default F-contrasts for each trial type will be computed.


Output from fMRI model specification (spm_fmri_spm_ui.m) - 2nd step:


Display: the design matrix shown at this point is simply the left upper panel of the previous graph, with the file names of the scans added, and with other details of the configuration listed underneath.


Output: the configuration for the design matrix is saved as SPMcgf.mat in the working directory.


N.B.


As with PET/SPECT models, SPM provides the option to begin parameter estimation now or at a later stage:

If 'later', select 'Estimate' (middle panel) and select the appropriate SPMcfg.mat file.

N.B.

Output from fMRI parameter estimation (spm_spm.m):

3.3 Customisations for PET/SPECT and fMRI statistics

Select PET or fMRI statistics from the lower panel:

Defaults for model specification and parameter estimation are few to allow maximal flexibility.

For both PET and fMRI, specify:

for the default 'effects of interest'-F-test. The default value for PET is p<0.05 uncorrected (for multiple comparisons), for fMRI p<0.001 uncorrected.

For fMRI only, specify:

SPM interpolates each TR over this number of time bins to increase temporal resolution. 16 is chosen as default because it provides a reasonable degree of temporal resolution for typical TRs of 3-4s. The number of time bins could be equal to the number of slices, but increasing this number will not gain any real sensitivity (with typical TRs, given the time constants of the HRF and temporal smoothing), and may slow down computation.

Specify:

SPM uses the sampled bin to determine the value of a covariate at each scan. This should be adjusted if slice time correction is selected (e.g. for event-related fMRI) and the middle slice in time has been chosen as a reference slice (see 2.4). In this case, if the number of bins is 16, the sampled bin should =8 (i.e. the corresponding middle time bin).

3.4 Basic models (spm.spm_ui.m)

These are basic models for simple statistics, usually at a second level to extend the sphere of inference (random effects (RFX) analysis). Because SPM considers only a single component of variance (the residual error of variance), all analyses involving repeated measures within subjects are to be considered fixed-effects analyses, so that inferences are only valid for the sample under study. To allow inferences valid for the population from which the sample was drawn, a two-stage analysis is required, to account for first or intrasubject and second or between-subject levels of variance. During the first step, scan to scan variance (intrasubject) is modelled for each subject separately, resulting in a summary measure or 'scan'. These summary scans (usually t-contrast images (con*.img), containing weighted parameter estimates; see 4) are then fed into a second, between-subjects level analysis, using the 'Basic models' option.

N.B.

Select:

N.B.

Example: AnCova (two groups, one covariate)

Specify (e.g. 2):

Select (for both groups):

Specify a vector whose length equals the total number of scans:

Specify (e.g., IQ):

Select:

- scaling of all images to overall grand mean: use only for first-level analyses.

Select (none):

Select (no):

Thresholding and implicit masking (i.e., ignoring zeros. SPM will automatically disregard zero values indicated by NaN (Not a Number)) should only be performed at the first level.

Select (no):

This option is primarily for analysing raw data; usually, images will be masked at the normalisation stage (2.4).

Select (omit):

Again, this option is for first-level analyses only.

Output from Basic models (spm_spm_ui):

Display: SPM displays a design matrix having columns for each parameter (in this example, two groups, one constant (block), and one covariate (IQ in this example), and a row for each scan (subject). Again, the grey-and-white bar below the design matrix signals that the matrix is rank deficient (columns 1-3 are linearly dependent) which limits selection of meaningful contrasts (parameter weights) for group effects to those which sum up to zero (see 4).

File: the configuration for the design matrix will be saved as SPMcfg.mat in the working directory.

Finally, specify:

to begin parameter estimation now or at a later stage. If 'later', select 'Estimate' (middle panel) and select the appropriate SPMcfg.mat file.

N.B.

Output from Basic models parameter estimation (spm_spm.m):