Statistical modeling and Inference (for non-fMRI data)

145
Statistical Modeling and Inference UCLA Advanced NeuroImaging Summer School, 2007

Transcript of Statistical modeling and Inference (for non-fMRI data)

Page 1: Statistical modeling and Inference (for non-fMRI data)

Statistical Modeling andInference

UCLA Advanced NeuroImagingSummer School, 2007

Page 2: Statistical modeling and Inference (for non-fMRI data)

Models help tell stories1

23

45

6

Page 3: Statistical modeling and Inference (for non-fMRI data)

P<0.01

Models help tell stories1

23

45

6

Page 4: Statistical modeling and Inference (for non-fMRI data)

Goal of next 2 hours

• Hour 1– Brush up on some stats lingo– Review the general linear model (GLM)– How to estimate the GLM

• Hour 2– Hypothesis testing– Building Models

Page 5: Statistical modeling and Inference (for non-fMRI data)

Statistical Terms

• Probability: The expected relativefrequency of a particular outcome.– If you flip a “fair” coin a lot of times 50% of

the time you’ll get “heads”• P(heads)=0.5

– You measure the heights of people and30% of the time they are taller than 69inches

• P(height>69)=0.3

Page 6: Statistical modeling and Inference (for non-fMRI data)

Statistical Terms

• Random variable– Values of the variable are different every

time it is observed (eg, height)– Use capital letters for random variables– Use lower case for observed values– P(H>h)=Probability that height is larger

than some observed height h

Page 7: Statistical modeling and Inference (for non-fMRI data)

Statistical Terms

• Probability distribution– Describes the distribution of a random

variable– Defined by density function, f(h)– Area under density gives probability

Page 8: Statistical modeling and Inference (for non-fMRI data)

Statistical Terms

• How do we know what the correctdistribution of a random variable is?– By observation: Most data we deal with is

distributed normally– Many distributions are related to the normal

• Chisqare is the square of a normal• T uses a normal and a chisquare• F is the ratio of two chisquares

Page 9: Statistical modeling and Inference (for non-fMRI data)

Statistical Terms• Statistical Independence

– X and Y are independent if the occurrenceof X tells us nothing about Y

• Expected Value– The mean of a random variable ( )––––

• Only if X and Y are independent!!

Page 10: Statistical modeling and Inference (for non-fMRI data)

Statistical Terms• Variance

– How the values of the RV are dispersed about themean

–––

• Covariance– How much 2 RV’s vary together–– If 2 RV’s are independent, BUT the

opposite is not true

Page 11: Statistical modeling and Inference (for non-fMRI data)

Statistical Terms

• Bias and Variance can be used toassess an estimator– Bias: On average, the estimate is correct– Variance: The reliability of the estimate– Efficient: The most efficient estimate has

the lowest variance among all unbiasedestimators

Page 12: Statistical modeling and Inference (for non-fMRI data)

Bias and Variancehigh bias / low variance low bias / high variance

low bias / low variancehigh bias / high variance

Page 13: Statistical modeling and Inference (for non-fMRI data)

The Model

• For the ith observational unit

• : The dependent (random) variable• : Predictor variable (not random)• , : Model parameters• : Random error, how the observation

deviates from the population mean

Page 14: Statistical modeling and Inference (for non-fMRI data)

• Simple linear regression• Simple: Because there is only 1

regressor and an intercept• Linear: Because it is linear in its

parametersNot linear!

Page 15: Statistical modeling and Inference (for non-fMRI data)

Fixed and Random Parts

• Fixed parts– describes the mean of , ( )

• Random part– describes the variability of

• has a mean of 0• has a constant variance• are uncorrelated• It follows that the variance of is

Page 16: Statistical modeling and Inference (for non-fMRI data)

X

Age

Reacti

on T

ime (

s)

Y

10 20

1

2

3

4

Page 17: Statistical modeling and Inference (for non-fMRI data)

Fitting the Model

Age

Rea

ctio

n Ti

me

(s) Q: Which line fits the data best?

Page 18: Statistical modeling and Inference (for non-fMRI data)

Fitting the Model

Age

Rea

ctio

n Ti

me

(s)

A: Minimize the distancebetween the data and theline (error).

Q: Absolute distance?squared distance?

Error term

Page 19: Statistical modeling and Inference (for non-fMRI data)

Least Squares• Minimize squared differences

• Minimize

– Works out nicely distribution-wise– You can use calculus to get the estimates

Page 20: Statistical modeling and Inference (for non-fMRI data)

Property of Least Squares

• Gauss-Markov theorem– Under the assumptions we’ve made so far

(error has mean 0, with constant varianceand uncorrelated) the least squaresestimators are unbiased and haveminimum variance among all unbiasedlinear estimates

• i.e. The logical way to estimate themodel gives really great estimates!

Page 21: Statistical modeling and Inference (for non-fMRI data)

What’s maximum likelihood?

• Instead of minimizing error, maximizethe likelihood that we would have gottenour data for some given parameters

110

Mean =110small likelihood

110100 120 120 130

Mean =120large likelihood

Page 22: Statistical modeling and Inference (for non-fMRI data)

Maximum Likelihood

• When assuming normality, leads to thesame results as least squares

• If it is the same, why bring it up?– Studying is a Frequentist

approach– Next week you’ll hear about Bayesian

methods, which focus on

Page 23: Statistical modeling and Inference (for non-fMRI data)

What about the variance?

• We also need an estimate for– Start with the mean square error

– Divide by the appropriate degrees offreedom

• # of independent pieces of information -# parameters in model

Page 24: Statistical modeling and Inference (for non-fMRI data)

Multiple Linear Regression

• Add more parameters to the model

• Least square works, but is messy• Time for linear algebra!

Page 25: Statistical modeling and Inference (for non-fMRI data)

Matrices

• is a 2x3 matrix

Rowindex

Columnindex

Page 26: Statistical modeling and Inference (for non-fMRI data)

Matrices

• Square matrix- Same # of rows andcolumns

• Vector- column(row) vector has 1column(row)

Page 27: Statistical modeling and Inference (for non-fMRI data)

Matrices

• Special matrices– Diagonal Matrix

– Identity -

Page 28: Statistical modeling and Inference (for non-fMRI data)

Matrices

• Transpose: or . Swap columnsand rows.

• Element-wise addition and subtraction– Dimensions must match

Page 29: Statistical modeling and Inference (for non-fMRI data)

Matrices

• Multiplication: Trickier– Number of columns of first matrix must

match number of rows of second matrix

Page 30: Statistical modeling and Inference (for non-fMRI data)

Matrices

• Multiplication

Page 31: Statistical modeling and Inference (for non-fMRI data)

Matrices

• Multiplication

1x4+

Page 32: Statistical modeling and Inference (for non-fMRI data)

Matrices

• Multiplication

1x4+2x1=6

Page 33: Statistical modeling and Inference (for non-fMRI data)

Matrices

• Multiplication

1x2+2x4=10

Page 34: Statistical modeling and Inference (for non-fMRI data)

Matrices

• Multiplication

Page 35: Statistical modeling and Inference (for non-fMRI data)

Matrix Inverse• Denoted•• Only for square matrices• Only exists if matrix is full rank

– All columns (rows) are linearly independent

• , but I’ll spare the details

Page 36: Statistical modeling and Inference (for non-fMRI data)

Rank Deficient Matrices

2*column1=column3 column1+column2=column3

Page 37: Statistical modeling and Inference (for non-fMRI data)

Pseudoinverse

• If the columns *only* are linearlyindependent, then is invertible

• Pseudoinverse:•• Matrix doesn’t need to be square

Page 38: Statistical modeling and Inference (for non-fMRI data)

Expectation and Variance

Page 39: Statistical modeling and Inference (for non-fMRI data)

Expectation and Variance

• Let RV Y be a nx1 vector and a is a 1xnvector of constants––––

Page 40: Statistical modeling and Inference (for non-fMRI data)

Matrix Operations

• A few final properties

(when A is invertible)

(when A and B are invertible)

Page 41: Statistical modeling and Inference (for non-fMRI data)

Back to linear regression. .

.

. . .

. . .

. . .

. . .

. . .

(nx1) (nx4) (4x1) (nx1)

Page 42: Statistical modeling and Inference (for non-fMRI data)

Back to linear regression. .

.

. . .

. . .

. . .

. . .

. . .

(nx1) (nx4) (4x1) (nx1)

Page 43: Statistical modeling and Inference (for non-fMRI data)

Viewing the Design Matrix

• Look at the actualnumbers

M F age

Page 44: Statistical modeling and Inference (for non-fMRI data)

Viewing the Design Matrix

• Look at in imagerepresentation– Darker=smaller #

M F age

Page 45: Statistical modeling and Inference (for non-fMRI data)

Viewing the Design Matrix

• Look at in imagerepresentation– Darker=smaller #– Useful for large fMRI

designs

fMRI example (FSL)

Page 46: Statistical modeling and Inference (for non-fMRI data)

• The distribution of Y is a multivariateNormal

Multiple Linear Regression

0

00

0

Page 47: Statistical modeling and Inference (for non-fMRI data)

Multiple Linear Regression

• is really easy to derive

Page 48: Statistical modeling and Inference (for non-fMRI data)

Multiple Linear Regression

• is really easy to derive

Same as least squares, but much easier tounderstand…thanks linear algebra!

Page 49: Statistical modeling and Inference (for non-fMRI data)

Multiple Linear Regression

where

• N=length(Y)• p=length( )

Page 50: Statistical modeling and Inference (for non-fMRI data)

Statistical Properties

•So the estimate is unbiased

Page 51: Statistical modeling and Inference (for non-fMRI data)

Statistical Properties

•So the estimate is unbiased

Page 52: Statistical modeling and Inference (for non-fMRI data)

Statistical Properties

•So the estimate is unbiased

Page 53: Statistical modeling and Inference (for non-fMRI data)

Statistical Properties

•So the estimate is unbiased

Page 54: Statistical modeling and Inference (for non-fMRI data)

Linear regression is flexible!

• One sample t-test• Two sample t-test• Paired t-test• ANOVA• ANCOVA• Correlation analysis• So, we call it the general linear model (GLM)

Page 55: Statistical modeling and Inference (for non-fMRI data)

Hypothesis Testing• How we evaluate the estimates• Fitted model B matches the data better

than fitted model AA B

Page 56: Statistical modeling and Inference (for non-fMRI data)

5 Parts of Hypothesis Tests

• The null hypothesis, H0

• The alternative hypothesis, HA

• The test statistic and p-value• The rejection region• The conclusion about the hypothesis

Page 57: Statistical modeling and Inference (for non-fMRI data)

H0 and HA

• Null Hypothesis, H0– Typically what you want to disprove– H0: My boyfriend is cheating on me

• Alternative Hypothesis, HA– Typically what you want to be true– HA: My boyfriend isn’t cheating on me

Page 58: Statistical modeling and Inference (for non-fMRI data)

How to use H0 and HA

• Assuming the null is true (my boyfriend ischeating on me), how likely are my data?

– Case 1: He buys me gifts, emails me throughoutthe day, cooks me dinner, tells everybody howawesome it is that he’s dating a biostatistician

• If he were cheating on me, these things wouldn’t be verylikely…so reject H0 in favor of HA

– Case 2: He stays out late, never says anythingnice to me, keeps talking about his fun femalecoworker, has lipstick on his collar

• If he were cheating on me, these things would be verylikely…so accept H0.

Page 59: Statistical modeling and Inference (for non-fMRI data)

How to use H0 and HA

• Assuming the null is true (my boyfriend ischeating on me), how likely are my data?

– Case 1: He buys me gifts, emails me throughoutthe day, cooks me dinner, tells everybody howawesome it is that he’s dating a biostatistician

• If he were cheating on me, these things wouldn’t be verylikely…so reject H0 in favor of HA

– Case 2: He stays out late, never says anythingnice to me, keeps talking about his fun femalecoworker, has lipstick on his collar

• If he were cheating on me, these things would be verylikely…so do not reject H0.

Page 60: Statistical modeling and Inference (for non-fMRI data)

H0 and HA in GLM• Your study

– How is reaction time associated with age?–

• Two-sided hypothesis– As age increases, reaction time changes–– Rejection of null means slope is positive or

negative

Page 61: Statistical modeling and Inference (for non-fMRI data)

H0 and HA in GLM

• One-sided hypothesis test– As age increases reaction time decreases–– Rejecting null only concludes a negative

slope– Typically the type of hypothesis test for

fMRI

Page 62: Statistical modeling and Inference (for non-fMRI data)

Test Statistic

• Decision about H0 is based on our data• We need a statistic with a known

distribution!–– Ugh! We don’t know

Page 63: Statistical modeling and Inference (for non-fMRI data)

Test Statistic

• We do know

Page 64: Statistical modeling and Inference (for non-fMRI data)

Contrasts• Sometimes we’re interested in the sums

or differences of 2 parameters– Compare G1 to G2––

•• c is a contrast

G1 G2 G3

Page 65: Statistical modeling and Inference (for non-fMRI data)

Contrasts• Sometimes we’re interested in the sums

or differences of 2 parameters– Compare G1 to G2––

•• c is a contrast

G1 G2 G3

Page 66: Statistical modeling and Inference (for non-fMRI data)

Contrasts• Sometimes we’re interested in the sums

or differences of 2 parameters– Compare G1 to G2––

•• c is a contrast

G1 G2 G3

Page 67: Statistical modeling and Inference (for non-fMRI data)

Test Statistic

• Of course we can test contrasts ofparameters as well–

Page 68: Statistical modeling and Inference (for non-fMRI data)

P Values 1-Sided Hypothesis

• Given the null is true, how likely is it toobtain a value more extreme than ourstatistic?– What is meant by ‘more extreme’?

Page 69: Statistical modeling and Inference (for non-fMRI data)

• Start with the distribution under the null– There were 22 observations (N=22)– Simple linear regression (p=2)– Null is a central T distribution with 20 df

Page 70: Statistical modeling and Inference (for non-fMRI data)

T20

Page 71: Statistical modeling and Inference (for non-fMRI data)

Observed test statistic=2

Page 72: Statistical modeling and Inference (for non-fMRI data)

P value

more extreme

Page 73: Statistical modeling and Inference (for non-fMRI data)
Page 74: Statistical modeling and Inference (for non-fMRI data)

Sum=P value

Page 75: Statistical modeling and Inference (for non-fMRI data)

Assessing a P Value• 0.1<p

– Data support the null• 0.05<p<0.1

– Weak evidence against the null• 0.01<p<0.05

– Some evidence against the null• 0.001<p<0.01

– Good evidence against the null• p<0.001

– Really good evidence against the null

Page 76: Statistical modeling and Inference (for non-fMRI data)

Notes About P Values

• The P value is not the probability thatthe null is true– (one sided)

• 1-p is not the probability that thealternative is true

Page 77: Statistical modeling and Inference (for non-fMRI data)

Rejection Region

• We need to choose a threshold• A p value is significant if it falls below

the threshold• Denoted by , typically set at 0.05 or

0.01– The probability that the null is rejected

when it is true– For if 100 independent tests

were conducted and the null was true, 5times we’d reject the null

Page 78: Statistical modeling and Inference (for non-fMRI data)

Types of Error

Null HypothesisTRUE FALSE

DecisionReject null

Accept null

Page 79: Statistical modeling and Inference (for non-fMRI data)

Types of Error

Null HypothesisTRUE FALSE

DecisionReject null

Accept null Correct!

Correct!

Page 80: Statistical modeling and Inference (for non-fMRI data)

Types of Error

Null HypothesisTRUE FALSE

DecisionReject null

Accept null Correct!

Correct!Type I Error

Type II Error

Page 81: Statistical modeling and Inference (for non-fMRI data)

Power

• Probability of rejecting the null, whenthe alternative is true–

• Ideal situation has low and highpower– Power is a function of– Increasing increases power

Page 82: Statistical modeling and Inference (for non-fMRI data)

Testing Multiple Contrasts

• You can test multiple contrastssimultaneously– Are any of my beta’s 0?–– Use a contrast matrix

– Turns into an F test•• r=rank(c)

Page 83: Statistical modeling and Inference (for non-fMRI data)

F tests are great!

• If the F test isn’t significant, then noneof the individual t tests will be significant

• I’ve heard of reviewers getting angrywhen two insignificant t tests werereported as opposed to 1 F test

• Why does it matter how many tests werun?

Page 84: Statistical modeling and Inference (for non-fMRI data)

Multiple Testing Problems

• What if we perform many hypothesistests?

• ‘Confidence coefficient’• Joint confidence coefficient for 5

independent tests–– Much smaller than we’d like

Page 85: Statistical modeling and Inference (for non-fMRI data)

Multiple Testing Problems

• Bonferroni method– Use–– If then

– With fMRI data multiple testing a a hugeproblem and Bonferroni is tooconservative…stay tuned

Page 86: Statistical modeling and Inference (for non-fMRI data)

Let’s talk about models!

• Focus on residuals and degrees offreedom

• Goal…make our t stat as big as we canwithout using too many DF

Page 87: Statistical modeling and Inference (for non-fMRI data)

Let’s talk about models!

• Focus on residuals and degrees offreedom

• Goal…make our t stat as big as we canwithout using too many DF

Can’t do much aboutthese pieces

Page 88: Statistical modeling and Inference (for non-fMRI data)

Let’s talk about models!

• Focus on residuals and degrees offreedom

• Goal…make our t stat as big as we canwithout using too many DF

Try to decrease thisestimate

Page 89: Statistical modeling and Inference (for non-fMRI data)

Variance Estimate

• Recall

• If we make our model fit better, theestimate will decrease– Add in regressors to model confounding

factors (age, gender, etc)– Make sure the regressors you do have

capture the trends you are modeling

Page 90: Statistical modeling and Inference (for non-fMRI data)

Linear regressor is not significant (p=0.5)

Page 91: Statistical modeling and Inference (for non-fMRI data)

Quadratic regressor is significant (p<0.0001)

Page 92: Statistical modeling and Inference (for non-fMRI data)

Watch degrees of freedom!

T16

P=0.05

Page 93: Statistical modeling and Inference (for non-fMRI data)

Watch degrees of freedom!

T16

P=0.05

Add 13 regressors,increasing statistic

Page 94: Statistical modeling and Inference (for non-fMRI data)

Watch degrees of freedom!

T16T3

Both havep=0.05

Page 95: Statistical modeling and Inference (for non-fMRI data)

Recall

• GLM is flexible– One Sample T Test– ANOVA– Two sample T Test– Paired T test

• What do the models look like?

Page 96: Statistical modeling and Inference (for non-fMRI data)

1-Sample T Test

Overall mean

Page 97: Statistical modeling and Inference (for non-fMRI data)

Mean group 1

Mean group 2

2-Sample T Test

Page 98: Statistical modeling and Inference (for non-fMRI data)

2-Sample T TestOR

Page 99: Statistical modeling and Inference (for non-fMRI data)

Understanding a model

• If you’re unsure about a model or thecontrasts– Plug in numbers– Look at graphs (fMRI data)

• Always ask yourself if your model isdoing what you want it to

Page 100: Statistical modeling and Inference (for non-fMRI data)

For example…

• For the 2 sample T test– Set– Then G1=8 and G2=3– So is the mean of group 2

and is the differencebetween the groups

– What are the contrasts to test• Mean of G2• Mean of G1• G1-G2

Page 101: Statistical modeling and Inference (for non-fMRI data)

For example…

• For the 2 sample T test– Set– Then G1=8 and G2=3– So is the mean of group 2

and is the differencebetween the groups

– What are the contrasts to test• Mean of G2• Mean of G1• G1-G2

Page 102: Statistical modeling and Inference (for non-fMRI data)

For example…

• For the 2 sample T test– Set– Then G1=8 and G2=3– So is the mean of group 2

and is the differencebetween the groups

– What are the contrasts to test• Mean of G2• Mean of G1• G1-G2

Page 103: Statistical modeling and Inference (for non-fMRI data)

Paired T Test

• A common mistake is to use a 2-sample t testinstead of a paired test

• Tire example

• 2-sample T test p=0.58• Paired T test p<0.001

8.38.859.19.7411.812.339.49.8210.210.61Tire BTire AAutomobile

Page 104: Statistical modeling and Inference (for non-fMRI data)

Why so different?

Page 105: Statistical modeling and Inference (for non-fMRI data)

Why so different?

Mean A

Mean B

Page 106: Statistical modeling and Inference (for non-fMRI data)

Why so different?

Difference is OK

Page 107: Statistical modeling and Inference (for non-fMRI data)

Why so different?

Residuals areHUGE!

Page 108: Statistical modeling and Inference (for non-fMRI data)

Paired T Test

Adjust for themean of each pair

Page 109: Statistical modeling and Inference (for non-fMRI data)

Paired T Test

Mean A

Mean B

Page 110: Statistical modeling and Inference (for non-fMRI data)

Paired T Test

Difference is same

Residual variance much smaller

Page 111: Statistical modeling and Inference (for non-fMRI data)

Paired T Test GLM

Mean ofeach pair

Difference

Page 112: Statistical modeling and Inference (for non-fMRI data)

ANOVA1-way ANOVA 2-way ANOVA

A

B

Page 113: Statistical modeling and Inference (for non-fMRI data)

Modeling ANOVA with GLM

• Cell means model– 1-way ANOVA– 2-way ANOVA– EVs are easy, but contrasts are trickier

• Factor effects– 1-way– 2-way– EVs take more thought, but contrasts are

easier• ANOVA uses F tests

Page 114: Statistical modeling and Inference (for non-fMRI data)

Modeling ANOVA with GLM

• Cell means model– 1-way ANOVA– 2-way ANOVA– EVs are easy, but contrasts are trickier

• Factor effects– 1-way– 2-way– EVs take more thought, but contrasts are

easier• ANOVA = F tests!

Page 115: Statistical modeling and Inference (for non-fMRI data)

1 Way ANOVA - Cell Means

Page 116: Statistical modeling and Inference (for non-fMRI data)

1 Way ANOVA - Cell Means

Page 117: Statistical modeling and Inference (for non-fMRI data)

1 Way ANOVA - Cell Means

Page 118: Statistical modeling and Inference (for non-fMRI data)

1 Way ANOVA - Cell Means

Page 119: Statistical modeling and Inference (for non-fMRI data)

• In general– # of regressors for a factor = # levels-1– Factor with 4 levels

1 Way ANOVA - Factor Effects

Page 120: Statistical modeling and Inference (for non-fMRI data)

mean

1 Way ANOVA - Factor Effects

Page 121: Statistical modeling and Inference (for non-fMRI data)

1 Way ANOVA - Factor Effects

Page 122: Statistical modeling and Inference (for non-fMRI data)

1 Way ANOVA - Factor Effects

Page 123: Statistical modeling and Inference (for non-fMRI data)

1 Way ANOVA - Factor Effects

Page 124: Statistical modeling and Inference (for non-fMRI data)

1 Way ANOVA - Factor Effects

Page 125: Statistical modeling and Inference (for non-fMRI data)

1 Way ANOVA - Factor Effects

Page 126: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA (3x2)

Page 127: Statistical modeling and Inference (for non-fMRI data)

A1

A2

A3

B1 B2

No effect means the marginals would be the same

2 Way ANOVA (3x2)

Page 128: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA (3x2)

Page 129: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA (3x2)

Page 130: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA (3x2)

Page 131: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA (3x2)

A1

A2

A3

B1 B2

No effect means the lines would be parallel

Page 132: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA (3x2)

A1

A2

A3

B1 B2

No effect means the lines would be parallel

A1B1-A1B2=A2B1-A2B2=A3B1-A3B2

Page 133: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA (3x2)

Page 134: Statistical modeling and Inference (for non-fMRI data)

• Recall for factor effects, a factor with nlevels has regressors set up like

• A has 3 levels, so 2 regressors• B has 2 levels, so 1 regressor

2 Way ANOVA - Factor Effects

Page 135: Statistical modeling and Inference (for non-fMRI data)

A B AB

2 Way ANOVA - Factor Effects

Page 136: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA - Factor Effects

Page 137: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA - Factor Effects

Page 138: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA - Factor Effects

Page 139: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA - Factor Effects

Page 140: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA - Factor Effects

Page 141: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA - Factor Effects

Page 142: Statistical modeling and Inference (for non-fMRI data)

2 Way ANOVA - Factor Effects

Page 143: Statistical modeling and Inference (for non-fMRI data)

For more examples

• The FSL folks have a bunch of greatexamples– http://www.fmrib.ox.ac.uk/fsl/feat5/detail.html

• Check the FSL help list regularly– Subscribe at jiscmail– Often others have already asked your

questions!

Page 144: Statistical modeling and Inference (for non-fMRI data)

Why did I just tell you all ofthis?

• The GLM is a flexible model that allowsfor a variety of analyses

• Focusing on residuals and degrees offreedom will help you build good models

• Use an F test when appropriate• A lot of the stats lingo and linear

algebra stuff comes up in methodspapers

Page 145: Statistical modeling and Inference (for non-fMRI data)

Why did I just tell you all ofthis?

• The Gauss-Markov theorem tells us ourleast squares estimates are best if– Errors are mean zero, uncorrelated,

constant variance– fMRI data tend to violate these

assumptions• Multiple comparisons is a huge problem

with fMRI data and Bonferroni doesn’twork well