SPM short course – May 2003 Linear Models and Contrasts The random field theory Hammering a Linear Model Use for Normalisation T and F tests : (orthogonal.

Slides:



Advertisements
Similar presentations
SPM short course – Mai 2007 Linear Models and Contrasts
Advertisements

Statistical Inference
Basis Functions. What’s a basis ? Can be used to describe any point in space. e.g. the common Euclidian basis (x, y, z) forms a basis according to which.
SPM 2002 C1C2C3 X =  C1 C2 Xb L C1 L C2  C1 C2 Xb L C1  L C2 Y Xb e Space of X C1 C2 Xb Space X C1 C2 C1  C3 P C1C2  Xb Xb Space of X C1 C2 C1 
Outline What is ‘1st level analysis’? The Design matrix
The General Linear Model Or, What the Hell’s Going on During Estimation?
Classical inference and design efficiency Zurich SPM Course 2014
Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course Zurich, February 2009.
Classical (frequentist) inference Methods & models for fMRI data analysis in neuroeconomics April 2010 Klaas Enno Stephan Laboratory for Social and Neural.
The General Linear Model (GLM)
Statistical Inference
Classical (frequentist) inference Methods & models for fMRI data analysis in neuroeconomics 14 October 2009 Klaas Enno Stephan Laboratory for Social and.
Classical (frequentist) inference Methods & models for fMRI data analysis 11 March 2009 Klaas Enno Stephan Laboratory for Social and Neural System Research.
Classical (frequentist) inference Methods & models for fMRI data analysis 22 October 2008 Klaas Enno Stephan Branco Weiss Laboratory (BWL) Institute for.
1st level analysis: basis functions and correlated regressors
1st Level Analysis Design Matrix, Contrasts & Inference
General Linear Model & Classical Inference
The General Linear Model and Statistical Parametric Mapping Stefan Kiebel Andrew Holmes SPM short course, May 2002 Stefan Kiebel Andrew Holmes SPM short.
General Linear Model & Classical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM M/EEGCourse London, May.
Contrasts and Basis Functions Hugo Spiers Adam Liston.
With many thanks for slides & images to: FIL Methods group, Virginia Flanagin and Klaas Enno Stephan Dr. Frederike Petzschner Translational Neuromodeling.
Contrasts (a revision of t and F contrasts by a very dummyish Martha) & Basis Functions (by a much less dummyish Iroise!)
General Linear Model & Classical Inference London, SPM-M/EEG course May 2014 C. Phillips, Cyclotron Research Centre, ULg, Belgium
Classical (frequentist) inference Methods & models for fMRI data analysis November 2012 With many thanks for slides & images to: FIL Methods group Klaas.
SPM short course – Oct Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France.
FMRI GLM Analysis 7/15/2014Tuesday Yingying Wang
Contrasts & Statistical Inference
Statistical Inference Christophe Phillips SPM Course London, May 2012.
FMRI Modelling & Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course Chicago, Oct.
Idiot's guide to... General Linear Model & fMRI Elliot Freeman, ICN. fMRI model, Linear Time Series, Design Matrices, Parameter estimation,
The General Linear Model
The General Linear Model Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM fMRI Course London, May 2012.
SPM short – Mai 2008 Linear Models and Contrasts Stefan Kiebel Wellcome Trust Centre for Neuroimaging.
The general linear model and Statistical Parametric Mapping I: Introduction to the GLM Alexa Morcom and Stefan Kiebel, Rik Henson, Andrew Holmes & J-B.
Contrasts & Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, October 2008.
SPM and (e)fMRI Christopher Benjamin. SPM Today: basics from eFMRI perspective. 1.Pre-processing 2.Modeling: Specification & general linear model 3.Inference:
The general linear model and Statistical Parametric Mapping II: GLM for fMRI Alexa Morcom and Stefan Kiebel, Rik Henson, Andrew Holmes & J-B Poline.
The General Linear Model Christophe Phillips SPM Short Course London, May 2013.
The General Linear Model Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM fMRI Course London, October 2012.
SPM short course – Mai 2008 Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France.
General Linear Model & Classical Inference London, SPM-M/EEG course May 2016 Sven Bestmann, Sobell Department, Institute of Neurology, UCL
General Linear Model & Classical Inference Short course on SPM for MEG/EEG Wellcome Trust Centre for Neuroimaging University College London May 2010 C.
The General Linear Model (GLM)
Group Analyses Guillaume Flandin SPM Course London, October 2016
The General Linear Model (GLM)
General Linear Model & Classical Inference
The general linear model and Statistical Parametric Mapping
The General Linear Model
Statistical Inference
Design Matrix, General Linear Modelling, Contrasts and Inference
Statistical Inference
SPM short course at Yale – April 2005 Linear Models and Contrasts
and Stefan Kiebel, Rik Henson, Andrew Holmes & J-B Poline
Statistical Inference
The General Linear Model (GLM)
SPM course The Multivariate ToolBox (F. Kherif, JBP et al.)
Contrasts & Statistical Inference
The General Linear Model
The general linear model and Statistical Parametric Mapping
The General Linear Model
The General Linear Model (GLM)
Statistical Inference
SPM short course – May 2009 Linear Models and Contrasts
Contrasts & Statistical Inference
The General Linear Model
The General Linear Model (GLM)
Statistical Inference
The General Linear Model
The General Linear Model
Contrasts & Statistical Inference
Presentation transcript:

SPM short course – May 2003 Linear Models and Contrasts The random field theory Hammering a Linear Model Use for Normalisation T and F tests : (orthogonal projections) Jean-Baptiste Poline Orsay SHFJ-CEA

realignment & coregistration smoothing normalisation Corrected p-values images Adjusted data Design matrix Anatomical Reference Spatial filter Random Field Theory Your question: a contrast Statistical Map Uncorrected p-values General Linear Model Linear fit Ü statistical image

w Make sure we understand the testing procedures : t- and F-tests w Correlation in our model : do we mind ? Plan w A bad model... And a better one w Make sure we know all about the estimation (fitting) part.... w A (nearly) real example

Temporal series fMRI Statistical image (SPM) voxel time course One voxel = One test (t, F,...) amplitude time General Linear Model Üfitting Üstatistical image

Regression example… = ++ voxel time series   box-car reference function   Mean value Fit the GLM

Regression example… = ++ voxel time series  Mean value   box-car reference function  error

…revisited : matrix form =  + + ss =  ++ f(t s )1YsYs error 

Box car regression: design matrix…   =+  =  +YX data vector (voxel time series) design matrix parameters error vector  

Add more reference functions... Discrete cosine transform basis functions

…design matrix =  +  =  + YX data vector design matrix parameters error vector  = the betas (here : 1 to 9)

Fitting the model = finding some estimate of the betas = minimising the sum of square of the residuals S 2 raw fMRI time series adjusted for low Hz effects residuals fitted “high-pass filter” fitted box-car the squared values of the residuals   s 2 number of time points minus the number of estimated betas

w We put in our model regressors (or covariates) that represent how we think the signal is varying (of interest and of no interest alike) Summary... w Coefficients (= parameters) are estimated using the Ordinary Least Squares (OLS) or Maximum Likelihood (ML) estimator. w These estimated parameters (the “betas”) depend on the scaling of the regressors. w The residuals, their sum of squares and the resulting tests (t,F), do not depend on the scaling of the regressors.

w Make sure we understand t and F tests w Correlation in our model : do we mind ? Plan w A bad model... And a better one w Make sure we all know about the estimation (fitting) part.... w A (nearly) real example

SPM{t} A contrast = a linear combination of parameters: c´   c’ = divide by estimated standard deviation T test - one dimensional contrasts - SPM{t} T = contrast of estimated parameters variance estimate T = s 2 c’(X’X) + c c’b box-car amplitude > 0 ? =   > 0 ? => Compute 1 x b  + 0 x b  + 0 x b  + 0 x b  + 0 x b  +... and b  b  b  b  b ....

How is this computed ? (t-test) ^^  contrast of estimated parameters variance estimate Y = X  +   ~   N(0,I)  (Y : at one position) b = (X’X) + X’Y (b: estimate of  ) -> beta??? images e = Y - Xb (e: estimate of  ) s 2 = (e’e/(n - p)) (s: estimate of  n: time points, p: parameters) -> 1 image ResMS -> 1 image ResMS Estimation [Y, X] [b, s] Test [b, s 2, c] [c’b, t] Var(c’b) = s 2 c’(X’X) + c (compute for each contrast c) t = c’b / sqrt(s 2 c’(X’X) + c) (c’b -> images spm_con??? compute the t images -> images spm_t??? ) compute the t images -> images spm_t??? ) under the null hypothesis H 0 : t ~ Student-t( df ) df = n-p

Tests multiple linear hypotheses : Does X1 model anything ? F-test (SPM{F}) : a reduced model or... X1X1 X0X0 This (full) model ? H 0 : True (reduced) model is X 0 S2S2 Or this one? X0X0 S02S02 F = error variance estimate additional variance accounted for by tested effects F ~ ( S S 2 ) / S 2

H 0 :  3-9 = ( ) c’ = SPM{F} tests multiple linear hypotheses. Ex : does DCT set model anything? F-test (SPM{F}) : a reduced model or... multi-dimensional contrasts ? test H 0 : c´  b = 0 ? X 1 (  3-9 ) X0X0 This model ?Or this one ? H 0 : True model is X 0 X0X0

How is this computed ? (F-test) Error variance estimate additional variance accounted for by tested effects Test [b, s, c] [ess, F] F = (e 0 ’e 0 - e’e)/(p - p 0 ) / s 2 -> image (e 0 ’e 0 - e’e)/(p - p 0 ) : spm_ess??? -> image of F : spm_F??? -> image of F : spm_F??? under the null hypothesis : F ~ F(df1,df2) p - p 0 n-p p - p 0 n-p b 0 = (X  ’X  ) + X  ’Y e 0 = Y - X 0 b 0 (e  : estimate of   ) s 2 0 = (e 0 ’e 0 /(n - p 0 )) (s  : estimate of    n: time, p  : parameters) Estimation [Y, X 0 ] [b 0, s 0 ] Estimation [Y, X] [b, s] Y = X  +   ~ N(0,   I) Y = X     +     ~ N(0,    I) X  : X Reduced

w Make sure we understand t and F tests w Correlation in our model : do we mind ? Plan w A bad model... And a better one w Make sure we all know about the estimation (fitting) part.... w A (nearly) real example

A bad model... True signal and observed signal (---) Model (green, pic at 6sec) TRUE signal (blue, pic at 3sec) Fitting (b1 = 0.2, mean = 0.11) => Test for the green regressor not significant Residual (still contains some signal)

 =+ Y X  b 1 = 0.22 b 2 = 0.11 A bad model... Residual Variance = 0.3 P(Y|  1 = 0) => p-value = 0.1 (t-test) P(Y|  1 = 0) => p-value = 0.2 (F-test)

A « better » model... True signal + observed signal Global fit (blue) and partial fit (green & red) Adjusted and fitted signal => t-test of the green regressor significant => F-test very significant => t-test of the red regressor very significant Residual (a smaller variance) Model (green and red) and true signal (blue ---) Red regressor : temporal derivative of the green regressor

A better model...  =+ Y X  b 1 = 0.22 b 2 = 2.15 b 3 = 0.11 Residual Var = 0.2 P(Y|  1 = 0) p-value = 0.07 (t-test) P(Y|  1 = 0,  2 = 0) p-value = (F-test)

Flexible models : Fourier Transform Basis

Flexible models : Gamma Basis

w We rather test flexible models if there is little a priori information, and precise ones with a lot a priori information w The residuals should be looked at...(non random structure ?) w In general, use the F-tests to look for an overall effect, then look at the betas or the adjusted data to characterise the response shape w Interpreting the test on a single parameter (one regressor) can be difficult: cf the delay or magnitude situation Summary... (2)

w Make sure we understand t and F tests w Correlation in our model : do we mind ? Plan w A bad model... And a better one w Make sure we all know about the estimation (fitting) part.... w A (nearly) real example ?

True signal Correlation between regressors Fit (blue : global fit) Residual Model (green and red)

 =+ Y X  b 1 = 0.79 b 2 = 0.85 b3 = 0.06 Correlation between regressors Residual var. = 0.3 P(Y|  1 = 0) p-value = 0.08 (t-test) P(Y|  2 = 0) p-value = 0.07 (t-test) P(Y|  1 = 0,  2 = 0) p-value = (F-test)

true signal Correlation between regressors - 2 Residual Fit Model (green and red) red regressor has been orthogonalised with respect to the green one  remove everything that correlates with the green regressor

 =+ Y X  b 1 = 1.47 b 2 = 0.85 b3 = 0.06 Residual var. = 0.3 P(Y|  1 = 0) p-value = (t-test) P(Y|  2 = 0) p-value = 0.07 (t-test) P(Y|  1 = 0,  2 = 0) p-value = (F-test) See « explore design » Correlation between regressors

Design orthogonality : « explore design » Beware: when there are more than 2 regressors (C1,C2,C3,...), you may think that there is little correlation (light grey) between them, but C1 + C2 + C3 may be correlated with C4 + C5 Black = completely correlated White = completely orthogonal Corr(1,1)Corr(1,2)

Implicit or explicit (decorrelation (or orthogonalisation) Implicit or explicit (   decorrelation (or orthogonalisation) C1 C2 Xb Y Xb e Space of X C1 C2 L C2 : L C1  : test of C2 in the implicit  model test of C1 in the explicit  model  C1 C2 Xb L C1  L C2 C2 C2  See Andrade et al., NeuroImage, 1999 This GENERALISES when testing several regressors (F tests)

X = Mean Cond 1 Cond 2 Y = Xb + e C1 C2 Mean = C1+C2 ^^  “completely” correlated... Parameters are not unique in general ! Some contrasts have no meaning: NON ESTIMABLE Example here : c’ = [1 0 0] is not estimable ( = no specific information in the first regressor); c’ = [1 -1 0] is estimable;

w We implicitly test for an additional effect only, so we may miss the signal if there is some correlation in the model Summary... (3) w Orthogonalisation is not generally needed - parameters and test on the changed regressor don’t change w It is always simpler (if possible!) to have orthogonal regressors w In case of correlation, use F-tests to see the overall significance. There is generally no way to decide to which regressor the « common » part should be attributed to w In case of correlation and if you need to orthogonolise a part of the design matrix, there is no need to re-fit a new model: change the contrast

Plan w Make sure we understand t and F tests w Correlation in our model : do we mind ? w A bad model... And a better one w Make sure we all know about the estimation (fitting) part.... w A (nearly) real example

A real example (almost !) Factorial design with 2 factors : modality and category 2 levels for modality (eg Visual/Auditory) 3 levels for category (eg 3 categories of words) Experimental DesignDesign Matrix V A C1 C2 C3 C1 C2 C3 V A C 1 C 2 C 3

Asking ourselves some questions... V A C 1 C 2 C 3 Design Matrix not orthogonal Many contrasts are non estimable Interactions MxC are not modelled Test C1 > C2 : c = [ ] Test V > A : c = [ ] Test the modality factor : c = ? Test the category factor : c = ? Test the interaction MxC ? 2 ways : 1- write a contrast c and test c’b = 0 2- select columns of X for the model under the null hypothesis.

Modelling the interactions

Asking ourselves some questions... V A V A V A Design Matrix orthogonal All contrasts are estimable Interactions MxC modelled If no interaction... ? Model too “big” Test C1 > C2 : c = [ ] Test V > A : c = [ ] Test the differences between categories : [ ] c =[ ] C 1 C 1 C 2 C 2 C 3 C 3 Test the interaction MxC : [ ] c =[ ] [ ] Test everything in the category factor, leave out modality : [ ] c =[ ] [ ]

Asking ourselves some questions... With a more flexible model V A V A V A Test C1 > C2 ? Test C1 different from C2 ? from c = [ ] to c = [ ] [ ] becomes an F test! C 1 C 1 C 2 C 2 C 3 C 3 Test V > A ? c = [ ] is possible, but is OK only if the regressors coding for the delay are all equal

Conclusion w Check the form of the HRF : non parametric estimation others … w Check your models w Toolbox of T. Nichols w Multivariate Methods toolbox (F. Kherif, JB Poline et al)