General Linear Model & Classical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM M/EEGCourse London, May 2013 = Preprocessings + General Linear Model = −1 Random Contrast c Field Theory Statistical Inference 2 = () {, } time frequency mm 1D time time mm Statistical Parametric Maps mm mm time 2D+t scalp-time 2D time-frequency mm 3D M/EEG source reconstruction, fMRI, VBM ERP example Random presentation of ‘faces’ and ‘scrambled faces’ 70 trials of each type 128 EEG channels Question: is there a difference between the ERP of ‘faces’ and ‘scrambled faces’? ERP example: channel B9 Focus on N170 t f s 2 1 nf 1 n s compares size of effect to its error standard deviation Data modelling Data Faces = b1 Y = b1 • X1 Scrambled + b2 + b2 + • X2 + Design matrix b1 = Y = b2 X • b + + General Linear Model p 1 1 1 b p y N = N X y Xb e e ~ N ( 0, I ) 2 + N e Model is specified by 1. Design matrix X 2. Assumptions about e N: number of scans p: number of regressors The design matrix embodies all available knowledge about experimentally controlled factors and potential confounds. GLM: a flexible framework for parametric analyses • • • • • • • • one sample t-test two sample t-test paired t-test Analysis of Variance (ANOVA) Analysis of Covariance (ANCoVA) correlation linear regression multiple regression Parameter estimation b1 = Y b2 X y Xb e Objective: estimate parameters to minimize N e t 1 + eˆ Ordinary least squares estimation (OLS) (assuming i.i.d. error): bˆ ( X T X )1 X T y 2 t Mass-univariate analysis: voxel-wise GLM Evoked response image Time Sensor to voxel transform 1. Transform data for all subjects and conditions 2. SPM: Analyse data at each voxel Hypothesis Testing To test an hypothesis, we construct “test statistics”. Null Hypothesis H0 Typically what we want to disprove (no effect). The Alternative Hypothesis HA expresses outcome of interest. Test Statistic T The test statistic summarises evidence about H0. Typically, test statistic is small in magnitude when the hypothesis H0 is true and large when false. We need to know the distribution of T under the null hypothesis. Null Distribution of T Hypothesis Testing u Significance level α: Acceptable false positive rate α. threshold uα Threshold uα controls the false positive rate p (T u | H 0 ) Null Distribution of T Conclusion about the hypothesis: We reject the null hypothesis in favour of the alternative hypothesis if t > uα p-value: A p-value summarises evidence against H0. This is the chance of observing value more extreme than t under the null hypothesis. > |0 t p-value Null Distribution of T Contrast & t-test Contrast : specifies linear combination of parameter vector: c T b SPM-t over time & space cT = -1 +1 ERP: faces < scrambled ? = bˆ1 bˆ2? 1bˆ1 1bˆ2 0? T Test H0: c bˆ 0? contrast of estimated parameters t= variance estimate T c bˆ T ˆ c 2 T X T X 1 ~ tN p c T-test: summary T-test is a signal-to-noise measure (ratio of estimate to standard deviation of estimate). Alternative hypothesis: H0: c T b 0 vs HA: c T b 0 T-contrasts are simple combinations of the betas; the Tstatistic does not depend on the scaling of the regressors or the scaling of the contrast. Extra-sum-of-squares & F-test Model comparison: Full vs. Reduced model? Null Hypothesis H0: True model is X0 (reduced model) X0 X1 X0 Test statistic: ratio of explained and unexplained variability (error) F RSS ˆ full 2 RSS ˆ reduced 2 F ESS RSS Full model ? Or reduced model? RSS RSS RSS0 0 ~ F 1 , 2 1 = rank(X) – rank(X0) 2 = N – rank(X) F-test & multidimensional contrasts Tests multiple linear hypotheses: H0: True model is X0 X0 X1 (b3-4) X0 Full or reduced model? H 0 : b3 = b4 = 0 cT = 0 0 1 0 0001 test H0 : cTb = 0 ? F-test: summary F-tests can be viewed as testing for the additional variance explained by a larger model wrt a simpler (nested) model model comparison. F tests a weighted sum of squares of one or several combinations of the regression coefficients b. In practice, we don’t have to explicitly separate X into [X1X2] thanks to multidimensional contrasts. Hypotheses: 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 Null Hypothesis Alternativ H 0 : b1 b 2 b 3 0 e Hypothesis H A : at least one b k 0 In testing uni-dimensional contrast with an F-test, for example b1 – b2, the result will be the same as testing b2 – b1. It will be exactly the square of the t-test, testing for both positive and negative effects. Orthogonal regressors Variability described by 1 Testing for 1 Variability described by 2 Testing for 2 Variability in Y Correlated regressors Variability described by Variability described by Shared variance Variability in Y Correlated regressors Variability described by Variability described by Testing for 1 Variability in Y Correlated regressors Variability described by Variability described by Testing for 2 Variability in Y Variability described by Variability described by Correlated regressors Variability in Y Correlated regressors Variability described by Variability described by Testing for 1 Variability in Y Correlated regressors Variability described by Variability described by Testing for 2 Variability in Y Correlated regressors Variability described by Variability described by Testing for 1 and/or 2 Variability in Y Summary Mass-univariate GLM: – Fit GLMs with design matrix, X, to data at different points in space to estimate local effect sizes, b – GLM is a very general approach (one-sample, two-sample, paired t-tests, ANCOVAs, …) Hypothesis testing framework – Contrasts – t-tests – F-tests Multiple covariance components Ci V 2 i enhanced noise model at voxel i ei ~ N ( 0 , C i ) V j Qj error covariance components Q and hyperparameters V = 1 Q1 + 2 Q2 Estimation of hyperparameters with ReML (Restricted Maximum Likelihood). Weighted Least Squares (WLS) T ˆ b (X V W W V T Let 1 1 T X) X V 1 y 1 Then T T 1 T T ˆ b (X W WX ) X W Wy T 1 T ˆ b ( X s X s ) X s ys where X s W X , ys W y WLS equivalent to OLS on whitened data and design Modelling the measured data Why? How? Make inferences about effects of interest 1. Decompose data into effects and error 2. Form statistic using estimates of effects and error stimulus function data linear model effects estimate error estimate statistic

1/--pages