Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College...

30
Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010

Transcript of Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College...

Page 1: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Statistical InferenceGuillaume Flandin

Wellcome Trust Centre for Neuroimaging

University College London

SPM Course

London, May 2010

Page 2: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

NormalisationNormalisation

Statistical Parametric MapStatistical Parametric MapImage time-seriesImage time-series

Parameter estimatesParameter estimates

General Linear ModelGeneral Linear ModelRealignmentRealignment SmoothingSmoothing

Design matrix

AnatomicalAnatomicalreferencereference

Spatial filterSpatial filter

StatisticalStatisticalInferenceInference

RFTRFT

p <0.05p <0.05

Page 3: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Time

BOLD signal

Tim

e

single voxeltime series

single voxeltime series

Voxel-wise time series analysis

Modelspecification

Modelspecification

Parameterestimation

Parameterestimation

HypothesisHypothesis

StatisticStatistic

SPMSPM

Page 4: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Overview

Model specification and parameters estimation Hypothesis testing Contrasts

T-tests F-tests

Contrast estimability Correlation between regressors

Example(s) Design efficiency

Page 5: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Model Specification: The General Linear Model

Sphericity assumption: Independent and identically distributed (i.i.d.) error terms

N: number of scans, p: number of regressors

=

+yy X

N

1

N N

1 1p

p

Page 6: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Parameter Estimation: Ordinary Least Squares

Find that minimises TXy 2 TXy 2

yXXX TT 1)(ˆ yXXX TT 1)(ˆ

The Ordinary Least Estimates are:

Under i.i.d. assumptions, the Ordinary Least Squares estimates are Maximum Likelihood.

),0(~ 2IN ),(~ 2IXNY

))(,(~ˆ 12 XXN TpN

T

ˆˆ

ˆ 2

pN

T

ˆˆ

ˆ 2

Page 7: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Hypothesis Testing

The Null Hypothesis H0

Typically what we want to disprove (no effect).

The Alternative Hypothesis HA expresses outcome of interest.

To test an hypothesis, we construct “test statistics”.

The 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

Page 8: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Hypothesis Testing

P-value:

A p-value summarises evidence against H0.

This is the chance of observing value more extreme than t under the null hypothesis.

Observation of test statistic t, a realisation of T Null Distribution of T

)|( 0HtTp )|( 0HtTp

Significance level α:

Acceptable false positive rate α.

threshold uα

Threshold uα controls the false positive rate

t

P-val

Null Distribution of T

u

The conclusion about the hypothesis:

We reject the null hypothesis in favour of the alternative hypothesis if t > uα

)|( 0HuTp

Page 9: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Contrasts

A contrast selects a specific effect of interest: a contrast c is a vector of length p.

cTβ is a linear combination of regression coefficients β.

))(,(~ˆ 12 cXXccNc TTTT ))(,(~ˆ 12 cXXccNc TTTT

Under i.i.d assumptions:

We are usually not interested in the whole β vector.

cTβ = 1x1 + 0x2 + 0x3 + 0x4 + 0x5 + . . .

cT = [1 0 0 0 0 …]

cTβ = 0x1 + -1x2 + 1x3 + 0x4 + 0x5 + . . .

cT = [0 -1 1 0 0 …]

Page 10: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

cT = 1 0 0 0 0 0 0 0

T =

contrast ofestimated

parameters

varianceestimate

box-car amplitude > 0 ?=

1 = cT> 0 ?

1 2 3 4 5 ...

T-test - one dimensional contrasts – SPM{t}

Question:

Null hypothesis: H0: cT=0 H0: cT=0

Test statistic:

pNTT

T

T

T

tcXXc

c

c

cT

ˆ

)ˆvar(

ˆ

12

pNTT

T

T

T

tcXXc

c

c

cT

ˆ

)ˆvar(

ˆ

12

Page 11: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

T-contrast in SPM

ResMS image

yXXX TT 1)(ˆ

con_???? image

Tc

pN

T

ˆˆ

ˆ 2

beta_???? images

spmT_???? image

SPM{t}

For a given contrast c:

Page 12: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

T-test: a simple example

Q: activation during listening ?

Q: activation during listening ?

cT = [ 1 0 ]

Null hypothesis:Null hypothesis: 01

)ˆ(

ˆ

T

T

cStd

ct

)ˆ(

ˆ

T

T

cStd

ct

Passive word listening versus rest

SPMresults:Height threshold T = 3.2057 {p<0.001}

Statistics: p-values adjusted for search volume

set-levelc p

cluster-levelp corrected p uncorrectedk E

voxel-levelp FWE-corr p FDR-corr p uncorrectedT (Z

)

mm mm mm

0.000 10 0.000 520 0.000 0.000 0.000 13.94 Inf 0.000 -63 -27 150.000 0.000 12.04 Inf 0.000 -48 -33 120.000 0.000 11.82 Inf 0.000 -66 -21 6

0.000 426 0.000 0.000 0.000 13.72 Inf 0.000 57 -21 120.000 0.000 12.29 Inf 0.000 63 -12 -30.000 0.000 9.89 7.83 0.000 57 -39 6

0.000 35 0.000 0.000 0.000 7.39 6.36 0.000 36 -30 -150.000 9 0.000 0.000 0.000 6.84 5.99 0.000 51 0 480.002 3 0.024 0.001 0.000 6.36 5.65 0.000 -63 -54 -30.000 8 0.001 0.001 0.000 6.19 5.53 0.000 -30 -33 -180.000 9 0.000 0.003 0.000 5.96 5.36 0.000 36 -27 90.005 2 0.058 0.004 0.000 5.84 5.27 0.000 -45 42 90.015 1 0.166 0.022 0.000 5.44 4.97 0.000 48 27 240.015 1 0.166 0.036 0.000 5.32 4.87 0.000 36 -27 42

Design matrix

0.5 1 1.5 2 2.5

10

20

30

40

50

60

70

80

1

X voxel-levelp uncorrectedT ( Z) mm mm mm

13.94 Inf 0.000 -63 -27 15 12.04 Inf 0.000 -48 -33 12 11.82 Inf 0.000 -66 -21 6 13.72 Inf 0.000 57 -21 12 12.29 Inf 0.000 63 -12 -3 9.89 7.83 0.000 57 -39 6 7.39 6.36 0.000 36 -30 -15 6.84 5.99 0.000 51 0 48 6.36 5.65 0.000 -63 -54 -3 6.19 5.53 0.000 -30 -33 -18 5.96 5.36 0.000 36 -27 9 5.84 5.27 0.000 -45 42 9 5.44 4.97 0.000 48 27 24 5.32 4.87 0.000 36 -27 42

Page 13: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

T-test: a few remarks

T-test is a signal-to-noise measure (ratio of estimate to standard deviation of estimate).

T-contrasts are simple combinations of the betas; the T-statistic does not depend on the scaling of the regressors or the scaling of the contrast.

H0: 0Tc vs HA: 0Tc Unilateral test:

cXXc

c

c

cT

TT

T

T

T

12ˆ

ˆ

)ˆvar(

ˆ

Page 14: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

F-test - the extra-sum-of-squares principle Model comparison:

Null Hypothesis H0: True model is X0 (reduced model)

Full model ?

X1 X0

or Reduced model?

X0 Test statistic: ratio of explained variability and unexplained variability (error)

1 = rank(X) – rank(X0)2 = N – rank(X)

RSS

2ˆ fullRSS0

2ˆreduced

Page 15: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

F-test - multidimensional contrasts – SPM{F} Tests multiple linear hypotheses:

0 0 0 1 0 0 0 0 00 0 0 0 1 0 0 0 00 0 0 0 0 1 0 0 00 0 0 0 0 0 1 0 00 0 0 0 0 0 0 1 00 0 0 0 0 0 0 0 1

cT =

H0: 4 = 5 = = 9 = 0

X1 (4-9)X0

Full model? Reduced model?

H0: True model is X0

X0

test H0 : cT = 0 ?

SPM{F6,322}

Page 16: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

F-contrast in SPM

ResMS image

yXXX TT 1)(ˆ pN

T

ˆˆ

ˆ 2

beta_???? images

spmF_???? images

SPM{F}

ess_???? images

( RSS0 - RSS )

For a given contrast c:

Page 17: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

F-test example: movement-related effects

Page 18: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Multidimensional contrasts

Think of it as constructing 3 regressors from the 3 differences and complement this new design matrix such that data can be fitted in the same exact way (same error, same fitted data).

Page 19: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

F-test: a few remarks

F-tests can be viewed as testing for the additional variance explained by a larger model wrt a simpler (nestednested) model Model comparison.Model comparison.

0000

0100

0010

0001

In testing uni-dimensional contrast with an F-test, for example 1 – 2, the result will be the same as testing 2 – 1. It will be exactly the square of the t-test, testing for both positive and negative effects.

F tests a weighted sum of squaressum of squares of one or several combinations of the regression coefficients .

In practice, we don’t have to explicitly separate X into [X1X2] thanks to multidimensional contrastsmultidimensional contrasts.

Hypotheses:

0 : Hypothesis Null 3210 H

0 oneleast at : Hypothesis eAlternativ kAH

Page 20: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Estimability of a contrast

If X is not of full rank then we can have X1 = X2 with 1≠ 2 (different parameters).

The parameters are not therefore ‘unique’, ‘identifiable’ or ‘estimable’.

For such models, XTX is not invertible so we must resort to generalised inverses (SPM uses the pseudo-inverse).

1 0 11 0 11 0 11 0 10 1 10 1 10 1 10 1 1

One-way ANOVA(unpaired two-sample t-test)

Rank(X)=2

[1 0 0], [0 1 0], [0 0 1] are not estimable.

parameters

imag

es

Fact

or1

Fact

or2

Mea

n

parameter estimability(gray

not uniquely specified)

Page 21: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Design orthogonality

For each pair of columns of the design matrix, the orthogonality matrix depicts the magnitude of the cosine of the angle between them, with the range 0 to 1 mapped from white to black.

The cosine of the angle between two vectors a and b is obtained by:

ba

bacos

If both vectors have zero mean then the cosine of the angle between the vectors is the same as the correlation between the two variates.

Page 22: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Shared variance

Orthogonal regressors.Orthogonal regressors.

Page 23: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Shared variance

Correlated regressors, for example:green: subject ageyellow: subject score

Testing for the Testing for the greengreen::

Page 24: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Shared variance

Correlated regressors.

Testing for the Testing for the redred::

Page 25: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Shared variance

Highly correlated.Entirely correlated non estimable

Testing for the Testing for the greengreen::

Page 26: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Shared variance

If significant, can be GG and/or YY

Testing for the Testing for the greengreen and and yellowyellow

Examples

Page 27: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

A few remarks

We implicitly test for an additional effect only, be careful if there is correlation

- Orthogonalisation = decorrelation : not generally needed- Parameters and test on the non modified regressor change

It is always simpler to have orthogonal regressors and therefore designs.

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.

Original regressors may not matter: it’s the contrast you are testing which should be as decorrelated as possible from the rest of the design matrix

Page 28: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Design efficiency

1122 ))(ˆ(),,ˆ( cXXcXce TT 1122 ))(ˆ(),,ˆ( cXXcXce TT

)ˆvar(

ˆ

T

T

c

cT

)ˆvar(

ˆ

T

T

c

cT The aim is to minimize the standard error of a t-contrast

(i.e. the denominator of a t-statistic).

cXXcc TTT 12 )(ˆ)ˆvar( cXXcc TTT 12 )(ˆ)ˆvar( This is equivalent to maximizing the efficiency e:

Noise variance Design variance

If we assume that the noise variance is independent of the specific design:

11 ))((),( cXXcXce TT 11 ))((),( cXXcXce TT

This is a relative measure: all we can really say is that one design is more efficient than another (for a given contrast).

Page 29: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Design efficiency The efficiency of an estimator is a measure of how reliable it is and

depends on error variance (the variance not modeled by explanatory variables in the design matrix) and the design variance (a function of the explanatory variables and the contrast tested).

XTX represents covariance of regressors in design matrix; high covariance increases elements of (XTX)-1.

High correlation between regressors leads to low sensitivity to each regressor alone.

cXXc TT 1)( cXXc TT 1)(

19.0

9.01cT=[1 0]: 5.26

cT=[1 1]: 20

cT=[1 -1]: 1.05

Page 30: Statistical Inference Guillaume Flandin Wellcome Trust Centre for Neuroimaging University College London SPM Course London, May 2010.

Bibliography:

Statistical Parametric Mapping: The Analysis of Functional Brain Images. Elsevier, 2007.

With many thanks to J.-B. Poline, Tom Nichols, S. Kiebel, R. Henson for slides.

Plane Answers to Complex Questions: The Theory of Linear Models. R. Christensen, Springer, 1996.

Statistical parametric maps in functional imaging: a general linear approach. K.J. Friston et al, Human Brain Mapping, 1995.

Ambiguous results in functional neuroimaging data analysis due to covariate correlation. A. Andrade et al., NeuroImage, 1999.

Estimating efficiency a priori: a comparison of blocked and randomized designs. A. Mechelli et al., NeuroImage, 2003.