why n’ how (i forgot the title) donald g. mclaren, ph.d. department of neurology, mgh/hms grecc,...

114
Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital http:// www.martinos.org /~ mclaren 11/15/2012

Upload: edith-edwards

Post on 16-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Why N’ How (I forgot the title)

Donald G. McLaren, Ph.D.Department of Neurology, MGH/HMS

GRECC, ERNM Veteran’s Hospital

http://www.martinos.org/~mclaren

11/15/2012

Page 2: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 3: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 4: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 5: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 6: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 7: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 8: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 9: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Types of Data

Page 10: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Types of Data – Dependent Variable

• Task Data– Single Condition– Multiple Conditions– Multiple Predictors Per Condition

• Functional Connectivity – Correlation• Functional Connectivity -- ICA• Context-Dependent Connectivity• VBM• DTI• Other??

Page 11: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Factors, Levels, Groups, ClassesContinuous Variables/Factors: Age, IQ, Volume, Behavioral measures (emotional scale, memory ability), Images, etc.Discrete Variables/Factors: Gender, Handedness, DiagnosisLevels of Discrete : Handedness: Left and Right Gender: Male and Female Diagnosis: Normal, MCI, ADGroup or Class: Specification of All Discrete Factors:• Left-handed Male MCI• Right-handed Female Normal

Page 12: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Overview• From a line to the GLM and matrices

• Statistical Tests

• Contrasts

• Designs

• Power

• Caveats

Page 13: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

General Linear Model(GLM)

Y=aX+b

Page 14: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

GLM Theory

HRF AmplitudeIQ, Height, Weight

Independent Variable

Is Activity correlated with Age?

DependentVariable,Measurement

x1 x2

y2

y1

Subject 1

Subject 2

Activity

Age

Of course, you’d need more then twosubjects …

Page 15: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Linear ModelIntercept: b

Slope: m

Activity

Age

x1 x2

y2

y1

System of Linear Equationsy1 = 1*b + x1*my2 = 1*b + x2*m

Y = X*

y1y2

1 x11 x2

bm= *

Matrix Formulation

X = Design Matrix = Regression Coefficients = Parameter estimates = “betas” = Intercepts and Slopes

bm

Intercept = Offset

Page 16: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Hypotheses and ContrastsIs Activity correlated with Age?

Does m = 0?Null Hypothesis: H0: m=0

Intercept: b

Slope: m

Activity

Age

x1 x2

y2

y1

m= [0 1]*bm

= C*?

C=[0 1]: Contrast Matrix

bm

y1y2

1 x11 x2

bm= *

Page 17: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Hypotheses and ContrastsIs Activity different from 0?

Does b = 0?Null Hypothesis: H0: b=0

Intercept: b

Slope: m

Activity

Age

x1 x2

y2

y1

b= [1 0]* bm

= C*?

C=[1 0]: Contrast Matrix

bm

y1y2

1 x11 x2

bm= *

Page 18: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Hypotheses and ContrastsIs Activity different from 0?

Does b = 0?Null Hypothesis: H0: b=0

Intercept: b

Slope: mActivity

Age

x1 x2

y2

y1

b= [1 0]* bm

= C*?

C=[1 0]: Contrast Matrix

bm

y1y2

1 x11 x2

bm= *

Page 19: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Hypotheses and ContrastsIs Activity different from 0?

Does b = 0?Null Hypothesis: H0: b=0

Intercept: b

Activity

Age

x1 x2

y2

y1

b= [1 0]* bm

= C*?

C=[1 0]: Contrast Matrix

bm

y1y2

1 x11 x1

bm= *

Page 20: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Hypotheses and ContrastsIs Activity different from 0?

Does b = 0?Null Hypothesis: H0: b=0

Intercept: b

Activity

Age

x1 x2

y2

y1

b= [1 ]*b

= C*?

C=[1 0]: Contrast Matrix

b

y1y2

11

b= *

Page 21: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

More than Two Data Points

y1 = 1*b + x1*my2 = 1*b + x2*my3 = 1*b + x3*my4 = 1*b + x4*m

y1y2y3y4

1 x11 x21 x31 x4

bm= *

Y = X*+n

Intercept: b

Slope: m

Activity

Age

• Model Error• Noise• Uncertainty

Page 22: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

The General Linear Model

npnpnnn

pp

pp

pp

xxxY

xxxY

xxxY

xxxY

,2,21,10

3,32,321,3103

2,22,221,2102

1,12,121,1101

ppXXXY 22110

Y Y observed = predicted + random error

In Matrix Form

Page 23: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Summary of the GLM

Y = X . β + ε

Observed data:

Imaging uses a mass univariate approach – that is each voxel is treated as a separate column vector of data.Y is Dependent Brain Value at various subjects/time points at a single voxel

Design matrix:

Several components which explain the observed data, i.e. the BOLD time series for the voxelTiming info: onset vectors, Om

j, and duration vectors, Dm

j

HRF, hm, describes shape of the expected BOLD response over timeOther regressors, e.g. realignment parameters

At the group level: these are covariates or grouping columns (see later slide)

Parameters:

Define the contribution of each component of the design matrix to the value of YEstimated so as to minimise the error, ε, i.e. least sums of squares

Error:

Difference between the observed data, Y, and that predicted by the model, Xβ.Not assumed to be spherical in fMRI

Page 24: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Brain Imaging

• From the beginning (almost)….

[ 5 6 7 5 ]

Page 25: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

25

Spatial Normalization, Atlas Space

Subject 1

Subject 2

Subject 1

Subject 2

MNI305

Native Space MNI305 Space

Page 26: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

26

Group Analysis

Does not have to be all positive!

Contrast AmplitudesContrast Amplitudes Variances(Error Bars)

Page 27: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Mass Univariate Analyses

(1) Run the GLM for each voxel.(2) Compute the statistic from the GLM for

each voxel(3) Inferences

Page 28: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

28

Statistical Parametric Map (SPM)+3%

0%

-3%

Contrast AmplitudeCON, COPE, CES

Contrast AmplitudeVariance

(Error Bars)VARCOPE, CESVAR

Significance t-Map (p,z,F)(Thresholded

p<.01)sig=-log10(p)

“Massive Univariate Analysis” -- Analyze each voxel separately

Page 29: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

SPM/FSL/AFNI/CUSTOM

• It is important to recognize that all programs that utilize the GLM will produce the same result. However, if your design matrices or variance correction methods are different, then you will see differences.

• Some slides show illustrations from FSL, others show illustrations from SPM, MATLAB, or other software. These can be done in all programs.

Page 30: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 31: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Types Of Analysis

Page 32: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

32

GG

1

1

2

2

2

G

G

iG

G

NDOF

N

t

G

G

“Random Effects (RFx)” Analysis

RFx

Page 33: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

33

GG

“Random Effects (RFx)” Analysis

RFx

• Model Subjects as a Random Effect• Variance comes from a single source:

variance across subjects – Mean at the population mean– Variance of the population variance

• Does not take first-level noise into account (assumes 0)

• “Ordinary” Least Squares (OLS)• Usually less activation than individuals

Page 34: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

34

“Mixed Effects (MFx)” Analysis

MFx

RFx

• Down-weight each subject based on variance.• Weighted Least Squares vs (“Ordinary” LS)

Page 35: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

35

“Mixed Effects (MFx)” Analysis

MFx

• Down-weight each subject based on variance.• Weighted Least Squares vs (“Ordinary” LS)• Protects against unequal variances across

group or groups (“heteroskedasticity”)• May increase or decrease significance with

respect to simple Random Effects• More complicated to compute• “Pseudo-MFx” – simply weight by first-level

variance (easier to compute)

Page 36: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

36

“Fixed Effects (FFx)” Analysis

FFx

RFx

i

G

i

G

DOFDOF

N

t

G

G

2

22

2

2i

Page 37: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

37

“Fixed Effects (FFx)” Analysis

FFx

i

G

i

G

DOFDOF

N

t

G

G

2

22

2

• As if all subjects treated as a single subject (fixed effect)

• Small error bars (with respect to RFx)• Large DOF• Same mean as RFx• Huge areas of activation• Not generalizable beyond sample.

Page 38: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

38

Population vs Sample

Group Population(All members)Hundreds?Thousands?Billions?

Sample18 Subjects

• Do you want to draw inferences beyond your sample?

• Does sample represent entire population?

• Random Draw?

Page 39: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

39

fMRI Analysis Overview

Higher Level GLM

First Level GLM Analysis

First Level GLM Analysis

Subject 3

First Level GLM Analysis

Subject 4

First Level GLM Analysis

Subject 1

Subject 2

CX

CX

CX

CX

PreprocessingMC, STC, B0Smoothing

Normalization

PreprocessingMC, STC, B0Smoothing

Normalization

PreprocessingMC, STC, B0Smoothing

Normalization

PreprocessingMC, STC, B0Smoothing

Normalization

Raw Data

Raw Data

Raw Data

Raw Data

CX

Page 40: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Second-Level Modeling

• These are all random effects (because of variance corrections and using beta’s from the first level)

• Mean across subjects divided by variance across subjects.– Low subjects with very low variance between

them can lead to a significant finding, even if no subject was significant at the single subject level

– Implications for analysis (e.g. SLBT??)

Page 41: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 42: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Statistical Tests

Page 43: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Implementing the T-test

Variance EstimateSqrt(Var*cT(XTX)-1c)

c = +1 0 0 0 0 0 0 0

T =

contrast ofestimated

parameters

t-test H0: cT = 0

varianceestimate

Page 44: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Implementing the F-test

F = error

varianceestimate

additionalvariance

accounted forby effects of

interest

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

H0: cT = 0c =

Page 45: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Contrasts and the Full Model

ate)(multivariTest -F ˆˆˆF

e)(univariatTest - tˆ)(

ˆ

ˆ

ˆt

Cin Rows J

Estimate VarianceContrast ˆ)(1ˆˆ

Contrast ˆˆ

Variance Residual ˆˆ

ˆ

EstimatesParameter )(ˆ

),0(~ , ,

1JDOF,

21DOF

212

2

1

2

T

nTT

nTT

T

n

TT

n

CXXC

C

CXXCJ

C

DOF

nn

yXXX

NnnsynXy

Page 46: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

T/r/F Notes• If F is a single row contrast, then F=T^2• An F-test has no direction• In many programs, T-tests are one-tailed, thus have a

p-value half of the same F-test• There are formulas to convert between T/r and other

statistics (e.g. cohen’s d)• To avoid double-dipping, when you extract an ROI to

plot the correlation and get the correlation value, DO NOT make inferences from the plots, but from the voxel-wise analysis.

Page 47: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 48: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Contrasts

• Identify the Null Hypothesis– Ho: A=B

• Make the Null Hypothesis equal 0– Ho: A-B=0

• Identify the columns for A and B, apply their weights– Ho: 1*A+(-1)*B– Contrast [1 -1]

Page 49: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Contrasts

• What if A and B are not individual columns as in the case of A1,A2,B1,B2…– [1 1 -1 -1] would work, but will over estimate the

magnitude of the effect– A is the average A1 A2, or Ho: (A1+A2)/2=0

• [½ ½ 0 0]

– B is the average B1 B2, or Ho: (B1+B2)/2=0• [0 0 ½ ½]

– [½ ½ -½ -½]

Page 50: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 51: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

51

GG

Higher Level GLM Analysis

=

11111

G

y = X *

Data fromone voxel

Design Matrix(Regressors)

Vector ofRegressionCoefficients(“Betas”)

Obs

erva

tions

(Low

-Lev

el C

ontr

asts

)

Contrast Matrix:C = [1]Contrast = C* = G

One-Sample Group Mean (OSGM)

Page 52: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

52

Two Groups GLM Analysis

=

11100

G1

G2

y = X *

Data fromone voxel

Obs

erva

tions

(Low

-Lev

el C

ontr

asts

) 00011

Page 53: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

53

Contrasts: Two Groups GLM Analysis

1. Does Group 1 by itself differ from 0?Ho: G1=0; Contrast = C* = G1; C = [1 0]

= 11100

G1

G2

00011

2. Does Group 2 by itself differ from 0?Ho: G2=0; Contrast = C* = G2; C = [0 1]

3. Does Group 1 differ from Group 2?Ho: G1= G2; Contrast = C* = G1- G2; C = [1 -1] 4. Does either Group 1 or Group 2 differ from 0? C has two rows: F-test (vs t-test) Concatenation of contrasts #1 and #2

1 00 1

C =

Page 54: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

54

One Group, One Covariate (Age)

=

11111

G

Age

y = X *

Data fromone voxel

Obs

erva

tions

(Low

-Lev

el C

ontr

asts

) 2133641747

Intercept: G

Slope: Age

Contrast

Age

Page 55: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

55

Contrasts: One Group, One Covariate

1. Does Group offset/intercept differ from 0?

Does Group mean differ from 0 regressing out age?

Ho: G=0; Contrast = C* = G; C = [1 0], (Treat age as nuisance)

= 11111

G

Age

2133641747

2. Does Slope differ from 0?Ho: Age=0; Contrast = C* = Age; C = [0 1]

Intercept: G

Slope: Age

Contrast

Age

Page 56: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

56

Contrasts: One Group, One Mean-Centered Covariate

= 11111

G

Age

-15-328-2011

Mean: G

Slope: Age

Contrast

Age

1. Does Group offset/intercept differ from 0?

Does Group mean differ from 0 regressing out age?

Ho: G=0; Contrast = C* = G; C = [1 0], (Treat age as nuisance)

2. Does Slope differ from 0?Ho: Age=0; Contrast = C* = Age; C = [0 1], ** Same effect as non-mean centered covariate

Page 57: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Group Effects1. Does Activity vary with Disease Status?

2. Does Activity vary with Gender?

1. Is there an Interaction between DS and G?

Page 58: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

2x2 Group ANOVA

10

5

13

9

While this design matrix was generated in SPM, you could generate it in any of the MRI Analysis packagees or statistical programs.

Page 59: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Contrasts

• Does Activity vary by Disease Status?– Ho: DS-=DS+– Ho: DS- - DS+ =0– [½ ½ -½ -½]; (group difference based on subgroups) or– [10/15 5/15 -13/22 -9/22] (pure average of subjects)

• Does Activity vary by Gender?– Ho: Male=Female– Ho: Male - Female =0– [½ -½ ½ -½]; or (group difference based on subgroups) or– [10/23 -5/14 13/23 -9/14] (pure average of subjects)

Page 60: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Contrasts

• Average of Subgroups versus Average of Individuals– If you have drawn a random sample and want to talk generally about

all subjects in a group, use the contrast weighted by group size.– If you haven’t drawn a random sample or want to look at the average

effect of the group, then you want to use the contrast that is not weighted by group size.

Page 61: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Contrasts• Is there an interaction?

– Ho: DS-Females-DS-Males= DS+Females-DS+Males– Ho: (DS-Females-DS-Males) – (DS+Females-DS+Males)=0– Ho: DS-Females-DS-Males – DS+Females+DS+Males=0– [1 -1 -1 1]; or

• Are the groups different?– Ho: DS-Females=DS-Males=DS+Females=DS+Males– F-test– DS-Females=DS-Males [1 -1 0 0]– DS-Males=DS+Females [0 1 -1 0]– DS+Females=DS+Males [0 0 1 -1]– [1 -1 0 0; 0 1 -1 0; 0 0 1 -1]

Page 62: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Contrasts

• If there is an interaction, you can not interpret the effects of the individual factors (e.g. disease and gender)

Page 63: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

GLM • Important to model all known variables,

even if not experimentally interesting:– e.g. head movement,

block and subject effects – minimise residual error

variance for better stats– effects-of-interest are the

regressors you’re actually interested in

covariates

conditions:effects of interest

Page 64: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

64

Contrasts: Two Groups GLM Analysis

1. Does Group 1 by itself differ from 0?Ho: G1=0; Contrast = C* = G1; C = [1 0]

= 11100

G1

G2

00011

2. Does Group 2 by itself differ from 0?Ho: G2=0; Contrast = C* = G2; C = [0 1]

3. Does Group 1 differ from Group 2?Ho: G1= G2; Contrast = C* = G1- G2; C = [1 -1] 4. Does either Group 1 or Group 2 differ from 0? C has two rows: F-test (vs t-test) Concatenation of contrasts #1 and #2

1 00 1

C =

Page 65: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

65

One Group, One Covariate (Age)

=

11111

G

Age

y = X *

Data fromone voxel

Obs

erva

tions

(Low

-Lev

el C

ontr

asts

) 2133641747

Intercept: G

Slope: Age

Contrast

Age

Page 66: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

66

Contrasts: One Group, One Covariate

1. Does Group offset/intercept differ from 0?

Does Group mean differ from 0 regressing out age (mean-centered)?

Ho: G=0; Contrast = C* = G; C = [1 0], (Treat age as nuisance)

= 11111

G

Age

2133641747

2. Does Slope differ from 0?Ho: Age=0; Contrast = C* = Age; C = [0 1]

Intercept: G

Slope: Age

Contrast

Age

Page 67: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

One Group, One Covariate

(http://mumford.fmripower.org/mean_centering/)

Page 68: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Two Groups

Do groups differ in Intercept?Do groups differ in Slope?Is average slope different than 0?…

Intercept: b1

Slope: m1

Activity

Age

Intercept: b2

Slope: m2

Page 69: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Two GroupsIntercept: b1

Slope: m1

Activity

Age

Intercept: b2

Slope: m2

y11 = 1*b1 + 0*b2 + x11*m1 + 0*m2y12 = 1*b1 + 0*b2 + x12*m1 + 0*m2y21 = 0*b1 + 1*b2 + 0*m1 + x21*m2y22 = 0*b1 + 1*b2 + 0*m1 + x22*m2

y11y12y21y22

1 0 x11 01 0 x12 00 1 0 x210 1 0 x22

b1b2m1m2

=*

Y = X*

Page 70: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

70

Two Groups, One Covariate

• Somewhat more complicated design• Slopes may differ between the groups• What are you interested in?

• Differences between intercepts? Ie, treat covariate as a nuisance?• Differences between slopes? Ie, an interaction between group and covariate?

Page 71: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

71

Two Groups, One (Nuisance) Covariate

Is there a difference between the group means?

Synthetic Data

Page 72: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

72

Raw Data

Effect of Age Effect After Age “Regressed Out”(e.g. Age=0)

• No difference between groups• Groups are not well matched for age • No group effect after accounting for age• Age is a “nuisance” variable (but important!)• Slope with respect to Age is same across groups•If age was mean-centered, there might be a group effect!!!

•Depends on mean-centering…

Two Groups, One (Nuisance) Covariate

Page 73: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

73

=

11100

G1

G2

Age

y = X *

Data fromone voxel

Obs

erva

tions

(Low

-Lev

el C

ontr

asts

) 00011

2133641747

Two Groups, One (Nuisance) Covariate

One regressor for Age.

Different Offset Same Slope (DOSS)

Page 74: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

74

=

11100

G1

G2

Age

00011

2133641747

Two Groups, One (Nuisance) Covariate

One regressor for Age indicates that groups have same slope – makes difference between group means/intercepts independent of age.

Different Offset Same Slope (DOSS)

Page 75: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

75

Contrasts: Two Groups + Covariate

1. Does Group 1 intercept/mean differ from 0 (after regressing out effect of age)?Ho:G1=0, Contrast = C* = G1, C = [1 0 0]

2. Does Group 2 intercept/mean differ from 0(after regressing out effect of age)?Ho:G2=0, Contrast = C* = G2, C = [0 1 0]

3. Does Group 1 intercept/mean differ from Group 2 intercept/mean (after regressing out effect of age)?Ho: G1=G2, , Contrast = C* = G1- G2, C = [1 -1 0]

=

11100

G1

G2

Age

00011

2133641747

4. Does Slope differ from 0 (after regressing out the effect of group)? Does not have to be a “nuisance”!Ho: Age=0, Contrast = C* = Age, C = [0 0 1]

Page 76: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Two-Groups, One Covariate, Same Slope

1,2

4

3

Model from previous slide

(http://mumford.fmripower.org/mean_centering/)

Page 77: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

77

• Slope with respect to Age differs between groups• Interaction between Group and Age• Intercept different as well

Group/Covariate InteractionTwo Groups, One Covariate, Different Slopes

Page 78: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

78

=

11100

G1

G2

Age1

Age2

y = X *

Data fromone voxel

Obs

erva

tions

(Low

-Lev

el C

ontr

asts

) 00011

213364 0 0

0 0 01747

Group-by-Age Interaction

Different Offset Different Slope (DODS)

Group/Covariate Interaction

Page 79: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

79

1. Does Slope differ between groups?Is there an interaction between group and

age? Ho: Age1=Age2, Contrast = C* = Age1-

Age2, C = [0 0 1 -1],

Group/Covariate Interaction

=

11100

G1

G2

Age1

Age2

00011

213364 0 0

0 0 01747

Page 80: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

80

Group/Covariate Interaction

=

11100

G1

G2

Age1

Age2

00011

213364 0 0

0 0 01747

Does this contrast make sense?

2. Does Group 1 intercept/mean differ from Group 2 mean (after regressing out effect of age)?Ho: G1- G2, Contrast = C* = G1- G2, C = [1 -1 0 0] Very tricky!This tests for difference at Age=0What about Age = 12?What about Age = 20?

Page 81: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

81

Group/Covariate InteractionIf you are interested in the difference between

the means but you are concerned there could be a difference (interaction) in the slopes:

1. Analyze with interaction model (DODS*)2. Test for a difference in slopes3. If there is no difference, re-analyze with

single regressor model (DOSS*)4. If there is a difference, proceed with

caution

* Freesurfer terms

Page 82: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Group/Covariate Interaction

(http://mumford.fmripower.org/mean_centering/)

Model from previous slide

1

2

Page 83: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Mean Centering• Across ALL subjects

– Covariate-adjusted group means

• Within each group– Each group would have the same mean as a one-sample t-

test

• Why does it matter?– The interpretation changes– Correlation between group and covariate (e.g. MMSE and

Alzheimer’s diagnosis)

Page 84: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Covariates

• If you have a single group:– Demeaning covariate will not change the slope– Demeaning makes the group term the mean of

the group; whereas not demeaning makes the group term the intercept.

Page 85: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Covariates

• If you have a multiple groups:– Demeaning covariate will not change the slope, no

matter how you demean it– Demeaning within each group controlling for

the covariate, but group means are uneffected– Demeaning across everyone controlling for the

covariate, but group means are effected. If you do this, you should refer to group tests as a comparison of covariate-adjusted means

Page 86: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 87: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

87

Longitudinal/Repeated-Measures

Did something change between visits?• Drug or Behavioral Intervention?• Training?• Disease Progression?• Aging?• Injury?• Scanner Upgrade?• Multiple tasks in the same session?

Page 88: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

88

Longitudinal

Paired DifferencesBetween Subjects

Subject 1, Visit 1

Subject 1, Visit 2

Page 89: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

89

Longitudinal Paired Analysis

=

11111

V

y = X *

Paired Diffsfrom one voxel

Design Matrix(Regressors)

Obs

erva

tions

(V1-

V2 D

iffer

ence

s in

Low

-Lev

el C

ontr

asts

)

Ho: V=0Contrast = C* = V Contrast Matrix:C = [1]

One-Sample Group Mean (OSGM): Paired t-Test

Page 90: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

GLM – Paired T-Test

Page 91: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

GLM – Repeated Measures

Page 92: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Constructing Contrasts

Page 93: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Constructing Contrasts

• What is the null hypothesis?

• Make the null hypothesis equal to 0

• Label the columns based on the weighting of the components of the null hypothesis– For repeated measures, form the sub-elements of

the contrast, then apply the weights

Page 94: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Constructing Contrasts

• S1G1C1: [1 zeros(1,10) 1 0 1 0 0 1 0 0 0 0 0]• S1G1C2: [1 zeros(1,10) 1 0 0 1 0 0 1 0 0 0 0]• S2G1C1: [0 1 zeros(1,9) 1 0 1 0 0 1 0 0 0 0 0]• G1: [ones(1,6)/6 zeros(1,5) 1 0 1/3 1/3 1/3 1/3 1/3 1/3 0 0 0]• G1vsG2: [ones(1,6)/6 ones(1,5)/5 1 -1 0 0 0 1/3 1/3 1/3 -1/3

-1/3 -1/3] – (NOTE: This is not a valid contrast, even though it can be constructed.)

Page 95: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Contrast Validity• Do you only have between-subject factors?

– All contrasts valid

• Do you only have within-subject factors?– Any contrast comparing levels of a factor/interaction is

valid– Effect of a single level is not valid

• Do you have between- and within-subject factors?– Any contrast comparing levels of a factor/interaction is

valid– Interaction contrasts are valid– Group/between-subject effects are not valid (e.g. G1vG2)– Effect of a single level is not valid

Page 96: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Constructing Contrasts

• S1G1C1: [1 zeros(1,10) 1 0 1 0 0 1 0 0 0 0 0]• S1G1C2: [1 zeros(1,10) 1 0 0 1 0 0 1 0 0 0 0]• S2G1C1: [0 1 zeros(1,9) 1 0 1 0 0 1 0 0 0 0 0]• G1C1: [ones(1,6)/6 zeros(1,5) 1 0 1 0 0 1 0 0 0 0 0]• G2C1: [zeros(1,6) ones(1,5)/5 0 1 1 0 0 0 0 0 1 0 0]• *C1:[ones(1,6)/12 ones(1,5)/10 1/2 1/2 1 0 0 1/2 0 0 1/2 0

0]• *C1:[ones(1,11)/11 5/11 6/11 0 0 5/11 0 0 6/11 0 0]• C1vsC2: [zeros(1,11) 0 0 1 -1 0 1/2 -1/2 0 1/2 -1/2 0 ]• C1vsC2: [zeros(1,11) 0 0 1 -1 0 5/11 -5/11 0 6/11 -6/11 0 ]

Page 97: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 98: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Power Calculations

• The probability that the test will reject the null hypothesis, when the null hypothesis is false.

• In general, you want to say that you have 80-90% power in your study.

• Estimate your effect size, specify your power, determine the sample size needed.

• CANNOT BE DONE POST-HOC!!!

Page 99: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Power Calculations• Estimate your effect size

– Which brain region?• Minimum N to achieve % power in a set of regions (McLaren

et al. 2010)

– Where to find effect sizes?• Previous studies, pilot studies

• Specify your power (option A)– The higher the better, but more power means a larger N

• Specify your N (option B)– Increasing N will increase the power

Page 100: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Power Calculations - $7600 study

(Mumford et al. 2008)

Page 101: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Programs

• G*Power

• http://fmripower.org/

• http://fmri.wfubmc.edu/cms/talkPowerSampleSizeCalculation voxel-wise

Page 102: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren
Page 103: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Caveat 1: What is analyzed…

• Missing Data– NaN– Zeros

Also AFNI/FSL

Page 104: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Caveat 2: Designs

• Between-subject Designs

• Within-subject Designs

• Mixed Designs

Page 105: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Pick your design Carefully

All of these designs test the same effect; however only the top 2 give you the correct RFX results and are generalizable to the population. The top right model is a variant of the GLM that creates a second error term (more on this next week).

Page 106: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Pick your design Carefully

Page 107: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Variance Corrections

• The issue of non-sphericity

Page 108: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Repeated Measures in FSL

• Limited to designs that have no violations of sphericity.

Page 109: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Misc. Considerations

Page 110: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Correction for Multiple Comparisons

• Cluster-based– Monte Carlo simulation – Permutation Tests– Surface Gaussian Random Fields (GRF)

• There but not fully tested• False Discovery Rate (FDR) – built into tksurfer

and QDEC. (Genovese, et al, NI 2002)

Page 111: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Clustering1. Choose a voxel/vertex-wise threshold

• Eg, 2 (p<.01), or 3 (p<.001)• Sign (pos, neg, abs)

2. A cluster is a group of connected (neighboring) voxels/vertices above a threshold

3. Cluster has a size (volume in mm3 and area in mm2)

p<.01 (-log10(p)=2)Negative

p<.0001 (-log10(p)=4)Negative

Page 112: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

What to report in papers

• Be explicit about the model– What are the factors– What are the covariates– What did you set as the variance and dependence for each

factor

• Be explicit about the contrast you are using• Be explicit about how to interpret the contrast

– Group means, group intercepts, covariate adjusted group means

• Be explicit about the thresholds used– Corrections for multiple comparisons– Small Volume Correction (corrected in SPM8 in late Feb. 2012)

Page 113: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

SPM/FSL/AFNI/CUSTOM

• It is important to recognize that all programs that utilize the GLM will produce the same result. However, if your design matrices or variance correction methods are different, then you will see differences.

• Some slides show illustrations from FSL, others show illustrations from SPM, MATLAB, or other software. These can be done in all programs.

Page 114: Why N’ How (I forgot the title) Donald G. McLaren, Ph.D. Department of Neurology, MGH/HMS GRECC, ERNM Veteran’s Hospital mclaren

Useful Mailing Lists• SPM – http://www.jiscmail.ac.uk/list/spm.html

• FSL -- http://www.jiscmail.ac.uk/list/fsl.html

• Freesurfer -- http://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSupport

• CARET -- http://brainvis.wustl.edu/wiki/index.php/Caret:Mailing_List

• I highly recommend reading the posts on these lists as they will save you time in the future.