33
PSYCH 200: ANOVA PSYCH 200: ANOVA PART 1 PART 1 Decomposing variance Decomposing variance One-way ANOVA One-way ANOVA Multiple comparisons Multiple comparisons

8 a class slides one way anova part 1

  • Upload
    mjb70

  • View
    683

  • Download
    2

Embed Size (px)

Citation preview

Page 1: 8 a class slides   one way anova part 1

PSYCH 200: ANOVAPSYCH 200: ANOVAPART 1PART 1

Decomposing varianceDecomposing varianceOne-way ANOVAOne-way ANOVA

Multiple comparisonsMultiple comparisons

Page 2: 8 a class slides   one way anova part 1

Beyond Beyond tt tests tests

• T-tests only let us compare 2 groupsT-tests only let us compare 2 groups

• A sample vs. a populationA sample vs. a population

• A sample vs. another sampleA sample vs. another sample

• But what if we want to compare 3 groups or more?But what if we want to compare 3 groups or more?

Page 3: 8 a class slides   one way anova part 1

For example…For example…

Does class level influence amount of study time?Does class level influence amount of study time?

Do gender and education level interact in determining Do gender and education level interact in determining one’s susceptibility to sexual harassment?one’s susceptibility to sexual harassment?

How do gender and marital status contribute to one’s How do gender and marital status contribute to one’s level of anxiety?level of anxiety?

Which of three therapeutic methods are most effective Which of three therapeutic methods are most effective at battling depression?at battling depression?

Page 4: 8 a class slides   one way anova part 1

Comparing multiple groupsComparing multiple groups• Are there differences between these (3+) groups?Are there differences between these (3+) groups?

• If so, where do the differences occur?If so, where do the differences occur?• A ≠ B ≠ CA ≠ B ≠ C

• A = B A = B ≠ C≠ C

• Freshman > Seniors > Sophomores = JuniorsFreshman > Seniors > Sophomores = Juniors

• Why not just conduct multiple Why not just conduct multiple tt tests? tests?• It’s cumbersome and sloppyIt’s cumbersome and sloppy::

» How many tests must we perform across 3 groups? 5 groups?How many tests must we perform across 3 groups? 5 groups?» For 5 Groups (A,B,C,D,E) we would have to do 10 TestsFor 5 Groups (A,B,C,D,E) we would have to do 10 Tests

• It inflates our overall Pr (Type It inflates our overall Pr (Type II error) for a given alpha error) for a given alpha» For three For three tt tests, with tests, with αα = 0.05 each, = 0.05 each, Pr (Type Pr (Type II error) error) ≈ 0.15≈ 0.15

• We need a new method for comparing multiple groupsWe need a new method for comparing multiple groups

Page 5: 8 a class slides   one way anova part 1

Basic terminologyBasic terminology

FactorFactor An independent variable (or grouping variable)

LevelLevel A particular value that a factor can possess

Group meanGroup mean The mean value of the DV across observations within a particular level of an IV

Class

FreshmanSophomoreJuniorSenior

Grand meanGrand mean The mean value of the DV across observations in the experiment as a whole

Page 6: 8 a class slides   one way anova part 1

ANOVAANOVAOne-way ANOVAOne-way ANOVA An An ananalysis alysis oof the f the vavariance in a set of scores or riance in a set of scores or

observations, with the goal of determining observations, with the goal of determining whether the differences in means across levels whether the differences in means across levels of some factor is significantly greater than the of some factor is significantly greater than the differences among scores in generaldifferences among scores in general

““Difference in values”Difference in values”

““Natural variability”Natural variability”

““Difference in group means”Difference in group means”

One One factorfactor

““Variability across group means”Variability across group means”

• We will start with a We will start with a One-Way Between Subjects One-Way Between Subjects ANOVAANOVA..

• Independent Groups, just like the Independent Sample Independent Groups, just like the Independent Sample t-testt-test

Page 7: 8 a class slides   one way anova part 1

ANOVA Example

0

1

2

3

4

5

6

7

0 1 2 3

Group

Score

Data

Group mean

Grand Mean

Page 8: 8 a class slides   one way anova part 1

ANOVA Example

0

1

2

3

4

5

6

7

0 1 2 3

Group

Score

Data

Group mean

Grand Mean

total

treatment

error

errortreatment

Page 9: 8 a class slides   one way anova part 1

X

Group 1Group 1Group 2Group 2

X

H0 vs. H1 - 2 GroupsH0 vs. H1 - 2 Groups

Page 10: 8 a class slides   one way anova part 1

XX

Group 1Group 1Group 2Group 2

X

H0 vs. H1 - 3 GroupsH0 vs. H1 - 3 Groups

X

Group 3Group 3

Group MeanGroup Mean Grand MeanGrand Mean

Page 11: 8 a class slides   one way anova part 1

Decomposing varianceDecomposing variance

““Natural variability”Natural variability”

““Variability across group means”Variability across group means”

The essence of an ANOVA is to determine how the variability across group means (treatment effect) relates to the natural variability (or error in measurement). Specifically, we want to know the Specifically, we want to know the relative amount of total variability that is relative amount of total variability that is attributable to each of these sources.attributable to each of these sources.

FF =

Page 12: 8 a class slides   one way anova part 1

F = 1

Variability due to groups = Natural variability

F > 1

Variability due to groups > Natural variability

F > 1

Variability due to groups > Natural variability

Decomposing varianceDecomposing variance

Page 13: 8 a class slides   one way anova part 1

Decomposing varianceDecomposing variance

• Variability between groups is called Variability between groups is called between groups between groups variabilityvariability

• Natural variability is the variability among groups or the Natural variability is the variability among groups or the variability within groups, and is called variability within groups, and is called within groups within groups variability variability (same as natural variability)(same as natural variability)

• The goal is to determine if the variability between The goal is to determine if the variability between groups is larger than the variability within groups.groups is larger than the variability within groups.

Page 14: 8 a class slides   one way anova part 1

Decomposing varianceDecomposing variance

XX

Group 1Group 1Group 2Group 2

XX

Group 3Group 3

Page 15: 8 a class slides   one way anova part 1

Implications of the Implications of the FF ratio ratio• FF distribution differs from distribution differs from zz and and tt in some key respects: in some key respects:

• Is always positiveIs always positive

• Is centered around 1, not 0Is centered around 1, not 0

• Distribution is skewed, not normal/symmetricDistribution is skewed, not normal/symmetric

• Assumptions of the one-way ANOVA Assumptions of the one-way ANOVA FF ratio ratio• Normal sampling distribution (normal population and/or large Normal sampling distribution (normal population and/or large NN))

• Homogeneity of varianceHomogeneity of variance

• Independent observationsIndependent observations

• Interpretations of hypotheses and directionalityInterpretations of hypotheses and directionality• In a one-way ANOVA, HIn a one-way ANOVA, H11 is is alwaysalways “ “μμ11, , μμ22, …, , …, μμkk are not all equal” are not all equal”

• In a one-way ANOVA, HIn a one-way ANOVA, H00 is is alwaysalways “ “μμ11 = = μμ22 = … = = … = μμkk””

• We are always looking for We are always looking for FF > 1, so it is > 1, so it is alwaysalways one-tailed one-tailed

• NO MORE DIRECTIONAL OR NON-DIRECTIONAL!NO MORE DIRECTIONAL OR NON-DIRECTIONAL!

Page 16: 8 a class slides   one way anova part 1

One-way ANOVA: ExamplesOne-way ANOVA: ExamplesHH11: Amount of study time varies by class level: Amount of study time varies by class level

μμfreshmanfreshman, , μμsophomoresophomore, , μμjuniorjunior, , μμseniorsenior are not all equal are not all equal

HH00: Amount of study time does not vary by class level: Amount of study time does not vary by class level

μμfreshmanfreshman == μμsophomoresophomore == μμjuniorjunior = = μμseniorsenior

HH11: Three therapeutic methods have differing degrees of effectiveness in : Three therapeutic methods have differing degrees of effectiveness in

treating depressiontreating depression μμcognitivecognitive, , μμpsychodynamicpsychodynamic, , μμbiomedicalbiomedical, are not all equal, are not all equal

HH00: Three therapeutic methods have the same degree of effectiveness in : Three therapeutic methods have the same degree of effectiveness in

treating depressiontreating depression μμcognitivecognitive == μμpsychodynamicpsychodynamic == μμbiomedicalbiomedical

Page 17: 8 a class slides   one way anova part 1

One Way ANOVA ExampleOne Way ANOVA Example• Imagine you are performing a study in which you are interested in Imagine you are performing a study in which you are interested in

the effect of magnetism on moral reasoning. You believe that a the effect of magnetism on moral reasoning. You believe that a magnetic wave pointed at a certain part of the brain can affect our magnetic wave pointed at a certain part of the brain can affect our moral decision making.moral decision making.

You have 16 people come into the lab. 5 of them are in the control You have 16 people come into the lab. 5 of them are in the control condition and are not exposed to any magnetic wave (control 1), 6 condition and are not exposed to any magnetic wave (control 1), 6 are in the magnetic wave condition at the part of the brain are in the magnetic wave condition at the part of the brain responsible for moral decision making (experimental condition), responsible for moral decision making (experimental condition), and 5 are also exposed to a magnetic wave, but at a part of the and 5 are also exposed to a magnetic wave, but at a part of the brain not responsible for moral reasoning (control 2).brain not responsible for moral reasoning (control 2).

After the manipulation, everyone takes a test of moral reasoning After the manipulation, everyone takes a test of moral reasoning on a scale of 1-10.on a scale of 1-10.

Page 18: 8 a class slides   one way anova part 1

One Way ANOVA ExampleOne Way ANOVA Example

HH11: Magnetic Waves can affect moral reasoning: Magnetic Waves can affect moral reasoning

μμcontrol 1control 1, , μμcontrol 2control 2, , μμexperimentalexperimental, , are not all equalare not all equal

HH00: Magnetic Waves cannot affect moral reasoning: Magnetic Waves cannot affect moral reasoning

μμcontrol 1control 1, , μμcontrol 2control 2, , μμexperimentalexperimental, , are all equalare all equal

Factor ?Factor ? Magnetic Wave LevelMagnetic Wave Level

Levels ?Levels ? 3: Control 1, Control 2, Experimental3: Control 1, Control 2, Experimental

DV ?DV ? Moral Reasoning Test (1-10 scale)Moral Reasoning Test (1-10 scale)

• STEP 1: Null and Alternative HypothesesSTEP 1: Null and Alternative Hypotheses

• STEP 2: Identity Factor, Levels, and DVSTEP 2: Identity Factor, Levels, and DV

Page 19: 8 a class slides   one way anova part 1

ExampleExample

Control 1Control 1 Control 2Control 2 ExperimentalExperimental

XX 7.07.0 7.47.4 5.05.0

ss 1.001.00 1.141.14 .89.89

nn 55 55 66

XX = 6.38= 6.38

Page 20: 8 a class slides   one way anova part 1

3 4 5 6 7 8

X

Control 2Control 2

Control 1Control 1

ExperimentalExperimental

ExampleExample

Page 21: 8 a class slides   one way anova part 1

Decomposing varianceDecomposing variance

““Natural variability”Natural variability”

““Variability across group means”Variability across group means”FF =

““Estimate of population variance”Estimate of population variance”

““Average deviation from grand mean”Average deviation from grand mean”

Page 22: 8 a class slides   one way anova part 1

Decomposing varianceDecomposing variance• STEP 3: We need to identify the two sources of STEP 3: We need to identify the two sources of

variance (Between and Within/Natural/Error)variance (Between and Within/Natural/Error)

• We need equations to do that…We need equations to do that…

• Well… let’s think about what variance is.Well… let’s think about what variance is.

Page 23: 8 a class slides   one way anova part 1

FF = ““Average deviation from grand mean”Average deviation from grand mean”

““Estimate of population variance”Estimate of population variance”

General formula for variance of a set of numbers:General formula for variance of a set of numbers:

Σ (X – X )2

SSdf

MSMSBB MSMSWW

Decomposing varianceDecomposing variance

Page 24: 8 a class slides   one way anova part 1

Variance within-groupsVariance within-groupsa.k.a. a.k.a. Natural Variability Natural Variability or or Error varianceError variance

• As always, we are trying to obtain the best As always, we are trying to obtain the best estimate of the (common) population variance, estimate of the (common) population variance, σσ 22

• Recall the independent-samples Recall the independent-samples tt, where we , where we pooled the variance across samples to estimate pooled the variance across samples to estimate σσ 22

• Similarly, because we also assume Similarly, because we also assume homogeneity of homogeneity of variancevariance in the ANOVA, we use a pooled estimate in the ANOVA, we use a pooled estimate

• So what is that pooled estimate equation?So what is that pooled estimate equation?

Page 25: 8 a class slides   one way anova part 1

Variance within-groupsVariance within-groupsa.k.a. a.k.a. Natural Variability Natural Variability or or Error varianceError variance

• A bit of notation first…A bit of notation first…

XXi,ji,j refers to the refers to the somesome score X in group J score X in group J

XXjj refers to the average of group Jrefers to the average of group J

Page 26: 8 a class slides   one way anova part 1

Variance within-groupsVariance within-groupsMean squared error (or within-groups), MSMean squared error (or within-groups), MSWW

SSdfN - 1N - k

NumberNumberof groupsof groups

MSMSWW = =Σ (Xi,1 – X1 )

2

Σ (Xi,2 – X2 )2

Σ (Xi,k – Xk )2

SS1 + SS2 + … + SSk

Σ (Xi,j – Xj )2

sp

2=

SS1 SS2+

df2df1 + + …

+ …

Page 27: 8 a class slides   one way anova part 1

Variance within-groupsVariance within-groupsMean squared error (or within-groups), MSMean squared error (or within-groups), MSWW

3 4 5 6 7 8

X

Control 2Control 2

Control 1Control 1

ExperimentalExperimental

Page 28: 8 a class slides   one way anova part 1

Variance within-groupsVariance within-groupsMean squared error (or within-groups), MSMean squared error (or within-groups), MSWW

• So the equation is what?!?So the equation is what?!?

• Well, the equation for MSWell, the equation for MSww ( (pooled variancepooled variance) for a ) for a

One Way Between Subjects ANOVA is…One Way Between Subjects ANOVA is…

ΣΣ ((XXi,ji,j – X – Xjj ))

N - kN - kMSMSWW = =

Sum of Sum of Squares Within Squares Within

(SSw)(SSw)

Degrees of Degrees of Freedom WithinFreedom Within

(dfw)(dfw)kk = number of = number of

groups/levels in IVgroups/levels in IV

2

Page 29: 8 a class slides   one way anova part 1

Back to our Example…Back to our Example…Control 1Control 1 Control 2Control 2 ExperimentalExperimental

XX 7.07.0 7.47.4 5.05.0

ss 1.001.00 1.141.14 .89.89

nn 55 55 66

XX = 6.38= 6.38

Page 30: 8 a class slides   one way anova part 1

Back to our Example…Back to our Example…

XXjj 7.07.0 7.47.4 5.05.0

ss 1.001.00 1.141.14 .89.89

nn 55 55 66

XX = 6.38= 6.38

Control 1Control 1 Control 2Control 2 ExperimentalExperimental

XXii 7,7,8,8,67,7,8,8,6 7,7,8,9,67,7,8,9,6 4,4,6,6,5,54,4,6,6,5,5

SSSSww = = ΣΣ ((XXi,ji,j – X – Xjj )) = 13.20= 13.202

Page 31: 8 a class slides   one way anova part 1

Back to our Example…Back to our Example…

SSSSww = 13.20 = 13.20

dfdfww = N-k = N-k

• Well, in our example, we had an N of 16.Well, in our example, we had an N of 16.

• And we had 3 groups in our IV (control 1, control 2, And we had 3 groups in our IV (control 1, control 2, experimental)experimental)

• So our dfSo our dfww is 16 - 3 = 13 is 16 - 3 = 13

Page 32: 8 a class slides   one way anova part 1

General formula for variance of a set of numbers:General formula for variance of a set of numbers:

SSdf

MSMSBB MSMSWW

Decomposing varianceDecomposing variance

MSMSW W = SS = SSww/df/dfww

MSMSW W = 13.20/13 = 1.105 = 13.20/13 = 1.105

Next step… we need to find MSNext step… we need to find MSBB (Mean Square Between) (Mean Square Between)

Page 33: 8 a class slides   one way anova part 1

The End of Part 1The End of Part 1