Presentation is loading. Please wait.

Presentation is loading. Please wait.

SPM short course – Oct. 2009 Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France.

Similar presentations


Presentation on theme: "SPM short course – Oct. 2009 Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France."— Presentation transcript:

1 SPM short course – Oct. 2009 Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France

2 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

3 w Make sure we understand the testing procedures : t- and F-tests Plan w Examples – almost real w REPEAT: model and fitting the data with a Linear Model w But what do we test exactly ?

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

5 Regression example… = ++ voxel time series 90 100 110       box-car reference function -10 0 10   90 100 110 Mean value Fit the GLM -2 0 2

6 Regression example… = ++ voxel time series 90 100 110       box-car reference function -2 0 2   0 1 2 Mean value Fit the GLM -2 0 2

7 …revisited : matrix form =  + +  =++ Y   11 22  f(t)

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

9 Q: When do I care ? A: ONLY when comparing manually entered regressors (say you would like to compare two scores) What if two conditions A and B are not of the same duration before convolution HRF? Fact: model parameters depend on regressors scaling

10 What if we believe that there are drifts?

11 Add more reference functions / covariates... Discrete cosine transform basis functions

12 …design matrix =  =  + YX error vector      … + data vector

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

14 Fitting the model = finding some estimate of the betas raw fMRI time series adjusted for low Hz effects residuals fitted low frequencies fitted signal fitted drift Raw data How do we find the betas estimates? By minimizing the residual variance

15 Fitting the model = finding some estimate of the betas =            + Y = X  ∥ Y−X ∥ 2 = Σ i [ y i − X i ] 2 finding the betas = minimising the sum of square of the residuals finding the betas = minimising the sum of square of the residuals when are estimated: let’s call them b when  are estimated: let’s call them b when is estimated : let’s call it e when  is estimated : let’s call it e estimated SD of : let’s call it s estimated SD of  : let’s call it s

16 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) w WHICH ONE TO INCLUDE ? w What if we have too many? Take home... w Coefficients (= parameters) are estimated by minimizing the fluctuations, - variability – variance – of estimated noise – the residuals. w Because the parameters depend on the scaling of the regressors included in the model, one should be careful in comparing manually entered regressors, or conditions of different durations

17 w Make sure we understand t and F tests Plan w Make sure we all know about the estimation (fitting) part.... w But what do we test exactly ? w An example – almost real

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

19 From one time series to an image Y: data + = voxels scans E B X * c’ = 1 0 0 0 0 0 0 0 Var(E) = s 2 T = s 2 c’(X’X) - c c’b = spm_con??? images beta??? images spm_t??? images spm_ResMS

20 F-test : a reduced model H 0 :  1 = 0 X1X1 X0X0 H 0 : True model is X 0 X0X0 c’ = 1 0 0 0 0 0 0 0 T values become F values. F = T 2 Both “activation” and “deactivations” are tested. Voxel wise p-values are halved. This (full) model ? Or this one? S2S2 S02S02 F ~ ( S 0 2 - S 2 ) / S 2

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

22 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 c’ = tests multiple linear hypotheses. Ex : does drift functions model anything? F-test : a reduced model or... multi-dimensional contrasts ? H 0 :  3-9 = (0 0 0 0...) X1X1 X0X0 H 0 : True model is X 0 X0X0 Or this one? This (full) model ?

23 Convolution model Design and contrast SPM(t) or SPM(F) Fitted and adjusted data

24 w T tests are simple combinations of the betas; they are either positive or negative (b1 – b2 is different from b2 – b1) T and F test: take home... w F tests can be viewed as testing for the additional variance explained by a larger model wrt a simpler model, or w F tests the sum of the squares of one or several combinations of the betas w in testing “single contrast” with an F test, for ex. 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.

25 w Make sure we understand t and F tests Plan w Make sure we all know about the estimation (fitting) part.... w But what do we test exactly ? Correlation between regressors w An example – almost real

26 « Additional variance » : Again No correlation between green red and yellow

27 correlated regressors, for example green: subject age yellow: subject score Testing for the green

28 correlated contrasts Testing for the red

29 Very correlated regressors ? Dangerous ! Testing for the green

30 If significant ? Could be G or Y ! Testing for the green and yellow

31 Completely correlated regressors ? Impossible to test ! (not estimable) Testing for the green

32 An example: real Testing for first regressor: T max = 9.8

33 Including the movement parameters in the model Testing for first regressor: activation is gone !

34 Implicit or explicit (decorrelation (or orthogonalisation) Implicit or explicit (   decorrelation (or orthogonalisation) 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  cf Andrade et al., NeuroImage, 1999 This generalises when testing several regressors (F tests)

35 Correlation between regressors: take home... w Do we care about correlation in the design ? Yes, always w Start with the experimental design : conditions should be as uncorrelated as possible w use F tests to test for the overall variance explained by several (correlated) regressors

36 w Make sure we understand t and F tests Plan w Make sure we all know about the estimation (fitting) part.... w But what do we test exactly ? Correlation between regressors w An example – almost real

37 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

38 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 = [ 0 0 1 -1 0 0 ] Test V > A : c = [ 1 -1 0 0 0 0 ] [ 0 0 1 0 0 0 ] Test C1,C2,C3 ? (F) c = [ 0 0 0 1 0 0 ] [ 0 0 0 0 1 0 ] Test the interaction MxC ?

39 Modelling the interactions

40 V A V A V A Test C1 > C2 : c = [ 1 1 -1 -1 0 0 0] Test the interaction MxC : [ 1 -1 -1 1 0 0 0] c =[ 0 0 1 -1 -1 1 0] [ 1 -1 0 0 -1 1 0] Design Matrix orthogonal All contrasts are estimable Interactions MxC modelled If no interaction... ? Model is too “big” ! C 1 C 1 C 2 C 2 C 3 C 3 Test V > A : c = [ 1 -1 1 -1 1 -1 0] Test the category effect : [ 1 1 -1 -1 0 0 0] c =[ 0 0 1 1 -1 -1 0] [ 1 1 0 0 -1 -1 0]

41 With a more flexible model V A V A V A Test C1 > C2 ? Test C1 different from C2 ? from c = [ 1 1 -1 -1 0 0 0] to c = [ 1 0 1 0 -1 0 -1 0 0 0 0 0 0] [ 0 1 0 1 0 -1 0 -1 0 0 0 0 0] becomes an F test! C 1 C 1 C 2 C 2 C 3 C 3 What if we use only: c = [ 1 0 1 0 -1 0 -1 0 0 0 0 0 0] OK only if the regressors coding for the delay are all equal

42 w use F tests when - Test for >0 and 0 and <0 effects - Test for more than 2 levels in factorial designs - Conditions are modelled with more than one regressor Toy example: take home... w Check post hoc

43 Thank you for your attention! jbpoline@cea.fr

44

45 How is this computed ? (t-test) 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, proportional to s 2 ) 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

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


Download ppt "SPM short course – Oct. 2009 Linear Models and Contrasts Jean-Baptiste Poline Neurospin, I2BM, CEA Saclay, France."

Similar presentations


Ads by Google