11stst Level Analysis: Level Analysis:
Design matrix, contrasts and Design matrix, contrasts and inferenceinference
Rebecca Knight and Lorelei Howard
Outline
What is first level analysis?
The General Linear Model and how this relates to the Design Matrix
Regressors within the Design Matrix
Rebecca Knight
Overview
Motioncorrection
Smoothing
kernel
Spatialnormalisation
Standardtemplate
fMRI time-seriesStatistical Parametric Map
General Linear Model
Design matrix
Parameter Estimates
Once the image has been reconstructed, realigned, spatially normalised and smoothed….
The next step is to statistically analyse the data
1st level analysis – A within subjects analysis where activation is averaged across scans for an individual subject
The Between- subject analysis is referred to as a 2nd level analysis and will be described later on in this course
Design Matrix – 2D, m = regressors, n = time. A dark-light colour map is used to show the value of each variable at specific time points
The Design Matrix forms part of the General linear model, the majority of statistics at the analysis stage use the GLM
Rebecca Knight
Key Concepts
General Linear Model
Y
Generic Model
Aim: To explain as much of the variance in Y by using X, and thus reducing E
Dependent Variable (What you are measuring)
Independent Variable (What you are manipulating)
Relative Contribution (These need to be estimated)
Error (The difference between the observed data and that which is predicted by the model)
= X x β + E
Y = X1β1 + X2β2 + ....X n βn.... + E More than 1 IV ?
GLM Continued
YMatrix of BOLD signals
(What you collect)
Design matrix
(This is what is put into SPM)
Matrix parameters
(These need to be estimated)
Error matrix
(residual error for each voxel)
= X x β + E
How does this equation translate to the 1st level analysis ?
Each letter is replaced by a set of matrices (2D representations)
Time
Voxels
Time
Regressors
Regressors
Voxels
Time
Voxels
Rebecca Knight
‘Y’ in the GLM
Y = Matrix of Bold signals
Time
(scan every 3 seconds)
fMRI brain scans Voxel time course
Amplitude/Intensity
1 voxel = ~ 3mm³
Time
‘X’ in the GLM
X = Design Matrix
Time(n)
Regressors (m)
Regressors Regressors – represent hypothesised contributors in your experiment. They are represented by columns in the design matrix (1column = 1 regressor)
Regressors of Interest or Experimental Regressors – represent those variables which you intentionally manipulated. The type of variable used affects how it will be represented in the design matrix
Regressors of no interest or nuisance regressors – represent those variables which you did not manipulate but you suspect may have an effect. By including nuisance regressors in your design matrix you decrease the amount of error.
E.g. - The 6 movement regressors (rotations x3 & translations x3 ) or physiological factors e.g. heart rate
Rebecca Knight
Regressors
Time(n)
Regressors (m)
A dark-light colour map is used to show the value of each regressor within a specific time point
Black = 0 and illustrates when the regressor is at its smallest value
White = 1 and illustrates when the regressor is at its largest value
Grey represents intermediate values
The representation of each regressor column depends upon the type of variable specified
Conditions As they indicate conditions they are referred to as indicator variables
Type of dummy code is used to identify the levels of each variable
E.g. Two levels of one variable is on/off, represented as
ON = 1
OFF = 0
When you IV is presented
When you IV is absent (implicit baseline)
Changes in the bold activation associated with the
presentation of a stimulus
Fitted Box-Car
Red box plot of [0 1] doesn’t model the rise and falls
Modelling Haemodynamics
Changes in the bold activation associated with the presentation of a stimulus
Haemodynamic response function
Peak of intensity after stimulus onset, followed by a return to baseline then an undershoot
Box-car model is combined with the HRF to create a convolved regressor which matches the rise and fall in BOLD signal (greyscale)
Even with this, not always a perfect fit so can include temporal derivatives (shift the signal slightly) or dispersion derivatives (change width of the HRF response) *more later in this course
HRF Convolved
Covariates What if you variable can’t be described using conditions?
E.g Movement regressors – not simply just one state or another
The value can take any place along the X,Y,Z continuum for both rotations and translations
Covariates – Regressors that can take any of a continuous range of values (parametric)
Thus the type of variable affects the design matrix – the type of design is also important
Designs
Block design v Event- related design
Intentionally design events of interest into blocks
Retrospectively look at when the events of interest occurred. Need to code the onset time for each regressor
Separating Regressors
The type of design and the type of variables used in your experiment will affect the construction of your design matrix
Another important consideration when designing your matrix is to make sure your regressors are separate
In other words, you should avoid correlations between regressors (collinear regressors) – because correlations in regressors means that variance explained by one regressor could be confused with another regressor
This is illustrated by an example using a 2 x 3 factorial design
Example
Motion No Motion
High Medium Low
Design
IV 1 = Movement, 2 levels (Motion and No Motion)
IV 2 = Attentional Load, 3 levels (High, Medium or Low)
High Medium Low
Example Cont.
V A C1 C2 C3
M N h m l If you made each level of the variables a regressor you could get 5 columns and this would enable you to test main effects
BUT what about interactions? How can you test differences between Mh and Nl
This design matrix is flawed – regressors are correlated and therefore a presence of overlapping variance (Grey)
M N h m l
MN h ml
Orthogonal design matrix
h m l h m l
M M M N N N
If you make each condition a regressor you create 6 columns and this would enable you to test main effects
AND it enable you to test interactions! You can test differences between Mh and Nl
This design matrix is orthogonal – regressors are NOT correlated and therefore each regressor explains separate variance
M
N
h m l
Mh
Nh
MlMm
Nm Nl
h m l h m l
M M M N N N
h m l h m l
M MM N N N
Summary
YMatrix of BOLD
signals Design matrix Matrix parameters
= X x + ETime
Voxels
Time
Regressors
Regressors
Voxels
Time
Voxels
Error matrix
β
Aim: To explain as much of the variance in Y by using X, and thus reducing E
β = relative contribution that each regressor has, the larger the β value = the greater the contribution
Next: Examine the effect of regressors
Rebecca Knight
Outline
Why do we need contrasts?
What are contrasts?
T contrasts
F contrasts
Rebecca Knight
Why use contrasts
GLM:
- Specify design matrix
- Determine β’s for each voxel for each regressor
Use contrasts to:
- Specify effects of interest
- Perform statistical evaluation of hypotheses
Contrasts used and their interpretation depends on the model specification, which in turn depends on the design of the experiment
Rebecca Knight
What is a contrast?
cT = [1 0 0 0 0 …]
Contrast vector of length p
cT β = 1xb1 + 0xb2 + 0xb3 + 0xb4 + 0xb5 + . . .
Contrast = statistical assessment of cT β
p
Rebecca Knight
Different contrasts
T contrasts
- Unidimensional (vectors)
- Directional
- Assess effect of one parameter OR compare specific
combinations of parameters
F contrasts
- Multidimensional (matrix)
- Non-directional
- Collection of T contrasts
Example
Two event-related conditions
The subjects press a button with either their left or right hand, depending on visual instruction
Left Right
Rebecca Knight
T contrasts
Left Right
cT = [1 0 0 …]
cTβ = 1xb1 + 0xb2 + 0xb3 + . . .
identifies voxels whose activation increases in response to Left button presses
Question: Which brain regions respond to Left button presses?
cT = [-1 0 0 …]
cTβ = -1xb1 + 0xb2 + 0xb3 + . . .
identifies voxels whose activation decreases in response to Left button presses
Rebecca Knight
T contrasts
H0 : cTβ = 0
Experimental Hypotheses:
- H1: cTβ > 0 ?
- H1: cTβ < 0 ?
T-test is a signal-to-noise measure
Test Statistic:
T df =
cT β
Contrast of estimated
parameters
Variance estimate
SD (cTβ) =
Rebecca Knight
T contrasts
Subtractive Logic:
“ The direct comparison of two regressors that are assumed to differ only in one property, the IV ”
Question: Which brain regions respond more to Left than to Right button presses?
Left Right
cT = [1 -1 0 …]
cTβ = 1xb1 + -1xb2 + 0xb3 + . . .
cT = [1 -1 0 …] ≠ cT= [-1 1 0 …]
must ensure sum of the weights = 0
Rebecca Knight
T contrasts
SPM-t image
Clearly see contralateral motor cortex response
The map of T-values:
spmT_*.img
The contrast itself (cTβ; ie, numerator):
con_*.img
* = number in Contrast Manager
2nd Level
Rebecca Knight
F contrasts
Left Right
cT = 1 0 0 … 0 1 0 …
Question: Which brain regions respond to Left and/or Right button presses?
Matrix of T contrasts
Non-directional
Identify voxels showing modulation in response to experimental task, ahead of more specific contrasts
Rebecca Knight
F contrasts
Rebecca Knight
F = Explained variability
Error variance estimate
Determines whether any one regressor OR combination of regressors explains a significant amount of the variance in Y
NOT which regressor the effect can be attributed to
H0 : β1 = β2 = 0
H1: at least one β ≠ 0
Test Statistic:
Rebecca Knight
F contrasts
Rebecca Knight
SPM-F image
Clearly see motor cortex response
The map of F-values:
spmF_*.img
Also outputs:
ess_*.img
* = number in Contrast Manager
Rebecca Knight
Factorial e.g.
IV 1 = Movement, 2 levels (Motion and No Motion)
IV 2 = Attentional Load, 3 levels (High, Medium or Low)
M M M N N Nh m l h m l
ME Movement
• Stack of M > N contrasts for each level of Load
• Shows voxels which are more active in M than N (regardless of attentional load)
Rebecca Knight
Factorial e.g.
IV 1 = Movement, 2 levels (Motion and No Motion)
IV 2 = Attentional Load, 3 levels (High, Medium or Low)
M M M N N Nh m l h m l
ME Attention
• First row = h > m• Second row = m > l
• Shows voxels which are more active in h than m AND/OR m than l (regardless of movement level)
Rebecca Knight
Factorial e.g.
IV 1 = Movement, 2 levels (Motion and No Motion)
IV 2 = Attentional Load, 3 levels (High, Medium or Low)
M M M N N Nh m l h m l
Interaction
• Shows voxels where the attentional load elicits a brain response that is different when there is motion, or not
Rebecca Knight
Inference
We’ve talked about 1st level so far… examining within subject
variability.
However, we can’t use a sample of one to extrapolate our findings to
the general population
2nd level analyses to look for effects at the group level… discussed
later in course
Rebecca Knight
Summary
Contrasts are statistical (t or F) tests of specific hypotheses
T contrasts:
- Compare effect of one regressor with 0
- Compare 2 or more regressors
F contrasts:
- Multidimensional contrasts
Rebecca Knight
Resources
Huettel. Functional magnetic resonance imaging (Chap 10)
MfD Slides 2007
Human Brain Function (Chap 8)
Rik Henson and Guillaume Flandin’s slides from SPM courses