PSYC 6130

32
PSYC 6130 One-Way Independent ANOVA

description

PSYC 6130. One-Way Independent ANOVA. Generalizing t-Tests. t-Tests allow us to test hypotheses about differences between two groups or conditions (e.g., treatment and control). What do we do if we wish to compare multiple groups or conditions simultaneously? Examples: - PowerPoint PPT Presentation

Transcript of PSYC 6130

Page 1: PSYC 6130

PSYC 6130

One-Way Independent ANOVA

Page 2: PSYC 6130

PSYC 6130, PROF. J. ELDER 2

Generalizing t-Tests

• t-Tests allow us to test hypotheses about differences between two groups or conditions (e.g., treatment and control).

• What do we do if we wish to compare multiple groups or conditions simultaneously?

• Examples:– Effects of 3 different therapies for autism

– Effects of 4 different SSRIs on seratonin re-uptake

– Effects of 5 different body orientations on judgement of induced self-motion.

Page 3: PSYC 6130

PSYC 6130, PROF. J. ELDER 3

Reinterpreting the 2-Sample t-Statistic

2

1 2

222p

X Xn

ts

2 2

2 2 21 2

The is an estimate of the variance of the population,

derived by averaging the variances the two samples:

denominator

within1( )2

p

p

s

s s s

Page 4: PSYC 6130

PSYC 6130, PROF. J. ELDER 4

Reinterpreting the 2-Sample t-Statistic

2 2To see this, recall that X X

ss s nsn

2 22

1 1 2 2 1 21 1Thus, ( ) ( )2 2Xs X X X X X X

2 2 21 2 1 2

1For 2 groups, ( ) ( ) , where ( )2G G GXs X X X X X X X

2

1 2

222p

X Xn

ts

2The is also an estimate of the variance of the population,derived from the

numeratorbetwvariance the sample mee .en ans

2 2

1 2 2 11 1( ) ( )2 2X X X X

21 2

1( )2X X

Page 5: PSYC 6130

PSYC 6130, PROF. J. ELDER 5

-10.2 4.8-1.8 6.715.2 -0.8-0.4 8.912.3 23.1-7.0 5.20.1 -0.1

-7.8 9.15.9 0.6

-2.5 -11.1

Mean 0.4 4.6 2.5Std Dev 8.4 8.8

Example1X 2X

GX

Page 6: PSYC 6130

PSYC 6130, PROF. J. ELDER 6

The F Distribution 2

1 2

222p

X Xn

ts

2

Thus, under the null hypothesis, the numerator and denominator are

estimates of the same population varindependent iance .

The ratio of 2 independent, unbiased estimates of the same variancefoll distriows an .butionF

F distribution for 2 groups of size n=13

0 2 4 6 8 100

0.1

0.2

0.3

0.4

0.5

Page 7: PSYC 6130

PSYC 6130, PROF. J. ELDER 7

Within and Between Variances

• Recall that the variance is, by definition, the mean squared deviation of scores from their mean.

• Since the numerator of the t2 statistic estimates the variance from the deviations of group means, it is called the mean-square-between MSbet.

• Since the denominator of the t2 statistic estimates the variance from the deviations within groups, it is called the mean-square-within MSW.

• These definitions allow us to generalize to an arbitrary number of groups.

Thus bet

W

MSFMS

Page 8: PSYC 6130

PSYC 6130, PROF. J. ELDER 8

Generalizing to > 2 Groups

bet

W

MSFMS

2

i i iall scores

( ) 1 1, where X n Xi i Gbet G

bet T T

n X XMS X

df N N

2( 1)i iW

w

n sMS

df

Page 9: PSYC 6130

PSYC 6130, PROF. J. ELDER 9

Degrees of Freedom

• Recall that the sample variance follows a scaled chi-square distribution, parameterized by the degrees of freedom.

• Thus the F distribution is a ratio of two chi-square distributions, each with different degrees of freedom.

1, where number of groups.betdf k k

, where = total number of subjects over all groups.

1W T T

i

df N k Nn

1tot bet W Tdf df df N

Page 10: PSYC 6130

PSYC 6130, PROF. J. ELDER 12

Testing Hypotheses

3.32 for .05 (Appendix F)critF

bet

W

MSFMS

2

0

Large values of suggest that differences between the groups

are inflating the estimate of reject .bet

FMS H

0 2 4 6 8 100

0.2

0.4

0.6

0.8

1

p(F)

F distribution for 3 groups of size n=13

Page 11: PSYC 6130

PSYC 6130, PROF. J. ELDER 13

Page 12: PSYC 6130

PSYC 6130, PROF. J. ELDER 14

When k=2

• ANOVA will give exactly the same result as two-tailed t-test.

• One-tailed tests must be done using t-tests.

Page 13: PSYC 6130

PSYC 6130, PROF. J. ELDER 15

Example

From the Canadian Generalized Social Survey, Cycle 6 (1992)

Page 14: PSYC 6130

PSYC 6130, PROF. J. ELDER 16

Example

DescriptivesDuring 12 months-Number of contacts: Psychologist

N Mean Std. Deviation

MARRIED 6601 0.185 2.034WIDOWED 1630 0.082 1.023SEPARATED OR DIVORCED 1012 0.900 4.688SINGLE 2568 0.620 4.012Total 11811 0.326 2.811

Page 15: PSYC 6130

PSYC 6130, PROF. J. ELDER 17

Reporting Results

• A one-way ANOVA demonstrates that frequency of

contact with clinical psychologists depends on marital

status. Widowed individuals had the least contact

(M=0.082). Married individuals (M=0.185) had

somewhat more contact. Single (M=0.620) and

separated or divorced (M=0.900) had substantially more

contact. F(3,11807)=33.3, MSE = 7.8, p<.001.

Page 16: PSYC 6130

PSYC 6130, PROF. J. ELDER 18

Summary Table (SPSS)

ANOVA

During 12 months-Number of contacts: Psychologist

783.673 3 261.224 33.332 .00092531.091 11807 7.83793314.764 11810

Between GroupsWithin GroupsTotal

Sum ofSquares df Mean Square F Sig.

Page 17: PSYC 6130

PSYC 6130, PROF. J. ELDER 19

Interpreting the F Ratio

+ between-group estimate of error variancewithin-gro

estup

imate of treatestimate of er

ment ror v

effari

ec

ce

tan

F

Page 18: PSYC 6130

PSYC 6130, PROF. J. ELDER 20

Effect Size and Proportion of Variance Accounted For

2Proportion of variance accounted for (sample): bet

tot

SSSS

Page 19: PSYC 6130

PSYC 6130, PROF. J. ELDER 21

(Approxiately) Unbiased Effect Size

2 ( 1)Proportion of variance accounted for (population): bet W

tot W

SS k MSSS MS

Page 20: PSYC 6130

PSYC 6130, PROF. J. ELDER 22

Reporting Results

• A one-way ANOVA demonstrates that frequency of

contact with clinical psychologists depends on marital

status. Widowed individuals had the least contact

(M=0.082). Married individuals (M=0.185) had

somewhat more contact. Single (M=0.620) and

separated or divorced (M=0.900) had substantially more

contact. F(3,11807)=33.3, p<.001. However, the size of

the effect was relatively small: 2 0.008.

Page 21: PSYC 6130

PSYC 6130, PROF. J. ELDER 23

Planning a Study: ANOVA and Power

Estimating power for ANOVA: Xn

can be used to plan experiments, relating , and (Appendix ncF)n k

.05 :

Page 22: PSYC 6130

PSYC 6130, PROF. J. ELDER 24

Example

• You are interested in whether there is a link between PSYC 6130 final grades and the professor teaching the section.

• Grades typically have a standard deviation of about 15%

• There are typically 3 sections, each with around 12 students.

• What is the probability you would pick up an effect if the standard deviation of the mean grade is around 5%?

Page 23: PSYC 6130

PSYC 6130, PROF. J. ELDER 25

Advantages of ANOVA

• Avoid inflation in error rate due to multiple comparisons

• Can detect an effect of the treatment even when no 2 groups are significantly different.

Page 24: PSYC 6130

PSYC 6130, PROF. J. ELDER 26

6-Step Process for ANOVA

1. State the hypotheses

2. Select the statistical test and significance level

3. Select the samples and collect the data

4. Find the region of rejection

5. Calculate the test statistic

6. Make the statistical decision

0 1 2: ...: , [1,..., ] :

n

A i j

HH i j n

Page 25: PSYC 6130

PSYC 6130, PROF. J. ELDER 27

Sums of Squares Approach

bet

W

MSFMS

2, where ( )betbet bet i i G

bet

SSMS SS n X Xdf

2, where ( 1)WW W i i

w

SSMS SS n sdf

:

total bet

total bet

W

WSS SS SSMS MS M

NB

S

Page 26: PSYC 6130

PSYC 6130, PROF. J. ELDER 28

ANOVA Assumptions

• Independent random sampling

• Normal distributions

• Homogeneity of variance

Page 27: PSYC 6130

PSYC 6130, PROF. J. ELDER 29

More on Homogeneity of Variance

21

1 2 22

2: ( , )sk F df dfs

1Where larger of the 2 std devss

2 :k 2max

max 2min

Hartley's sFs

Problem: sensitive to deviations from normality.

Levene's test:

More robust

Used by SPSS

Test of Homogeneity of Variances

During 12 months-Number of contacts: Psychologist

115.537 3 11807 .000

LeveneStatistic df1 df2 Sig.

Page 28: PSYC 6130

PSYC 6130, PROF. J. ELDER 30

Levene’s Test: Basic Idea

1 21. Replace each score , ,... with its absolute deviation from the sample mean:i iX X

1 1 1

2 2 2

| |

| |i i

i i

d X X

d X X

1 22. Now run an analysis of variance on , ,... :i id d

SPSS reports an F-statistic for Levene’s test

• Allows the homogeneity of variance for two or more variables to be tested.

bet

W

MSFMS

2, where ( )betbet bet i i G

bet

SSMS SS n d ddf

2, where ( 1)W

W W i diw

SSMS SS n sdf

Page 29: PSYC 6130

PSYC 6130, PROF. J. ELDER 31

What to do if Homogeneity of Variance Assumption is Rejected

• Some adjustment procedures are available in SPSS (e.g., Welch 1951).

• We will not cover the theory behind these adjustments.

Page 30: PSYC 6130

PSYC 6130, PROF. J. ELDER 32

Fixed vs Random Effects

• Fixed Effects: interested only in the specified levels of the independent variable

(e.g., single/married/divorced/widowed)

• Random Effects: interested in a large number of possible levels of the independent variable – randomly sampling only a few of these.

e.g., – Does the order of questions on a questionnaire effect the

results?

– Does the order of stimuli in a psychophysical experiment effect the results?

Page 31: PSYC 6130

PSYC 6130, PROF. J. ELDER 33

Fixed vs Random Effects

• One-Way Independent ANOVA calculation is the same for fixed and random effect designs.

• Power and effect size calculations differ.

• More complex ANOVA designs differ.

• We restrict our attention in this course to fixed effect designs.

Page 32: PSYC 6130

PSYC 6130, PROF. J. ELDER 34

Qualitative vs Quantitative Independent Variables

• In principle, ANOVA can be applied to either qualitative or quantitative variables.

• If IV is quantitative and effect is roughly linear, usually have more power using regression (only using up 2 degrees of freedom, instead of k).

• If effect is complex (e.g., non-monotonic):– Use a higher-order regression model (e.g., quadratic)

– Use ANOVA (makes no smoothness assumptions)