Sie sind auf Seite 1von 30

Analysis of Variance

ANOVA
Which Test Should I Use?
Assumptions Met?
Question to ask
yourself: Yes No
1. Am I only working with Chi-square
categorical variables? (independence or goodness of fit)
Start
Here
2. Am I looking at the
association between 2+ Pearson’s r Spearman’s r
numeric variables?
3. Am I comparing two
Independent Samples
unrelated groups on a numeric -
t-test
outcome?
4. Am I comparing two related
groups on a numeric outcome? Paired Samples
-
t-test

5. Am I comparing three or
One-way
more groups on a numeric
ANOVA
outcome?
ANOVA
 The Analysis of Variance
actually refers to a We’ll focus on
broad swath of tests running just
 One-way ANOVAs one-way ANOVAS
 Factorial ANOVAs
 Repeated Measures And understanding/
ANOVAs reading the others

 It also lays the foundation


for more advanced
techniques such as
ANCOVAs and GLM
(general linear models)
ANOVA tests
What do they do?

 What they do
 Let us look for difference between 3+ groups
 Let us examine interaction effects

 What we need
 Independent variable (categorical)
 The 3+ groups you’re comparing

 Dependent variable (numeric)


 Whatever you expect to vary between the groups

 Let’s take a look at an example


ANOVA Example
 Umamageswari, M., Karthikeyan, T., &
Maniyar, Y. A. (2017). Antidiabetic
Activity of Aqueous Extract of Solanum
nigrum Linn Berries in Alloxan Induced
Diabetic Wistar Albino Rats. Journal of
Clinical and Diagnostic Research :
JCDR, 11(7), FC16–FC19.
http://doi.org/10.7860/JCDR/2017/265
63.10312

 What we need
 Independent Variable
(Trichotomous+)
 Dependent Variable
(Numeric)
ANOVA Example
 RQ: Will nigrim
“[Solanum Solanum nigrim
extract] in the Linn extract
dose of improve
400 mg/kg/day glucose
reduced the
blood glucose
scores over significantly
time in ratson day
with7 induced
(257±5.2 mg/dl, p<0.001)
diabetes?
onwards and 14th day fasting blood glucose level was 197±8.2
 Independent Variable: day (0, 1, 7, 14, 21)
mg/dl (p<0.001), 21st day blood glucose level was 169.5±7.3 mg/dl
 Dependent Variable: fasting blood glucose
(p<0.001).”
Anova tests
Nuts & Bolts

 Now that we have our heads


around what an ANOVA is used
for, let’s work our way through
the practical nuts and bolts
 Between vs Within Group Variance
 Null vs. Alternative
 Tails
 Test Assumptions
 Uses
 Interpretation
 Post Hoc
Between vs. Within Group Variance
Let’s look at the equation
ANOVA Equation:

n1 (Xbar1 - XbarG)2 + n2(Xbar2 - XbarG)2 + n3(Xbar3 - XbarG)2


MSk - B1
Error

The
The top
top of
of the
the equation
equation is
is referred
referred to
to as
as MS
MSBB

It
It represents
represents the
the differences
differences
between
between each
each of
of the
the groups
groups we’re
we’re comparing
comparing
Between Mean Squares
The MSB describes the variability
between the groups we’re studying
(ie: signal)

Different? Different?

Sample 1 Sample 2 Sample 3


ANOVA Equation:

MSB
(n1-1)SD12 + (nMS
2-1)SD2
2
… (nk-1)SDk2
W
N-K

The
The bottom
bottom of
of the
the equation
equation is
is referred
referred to
to as
as MS
MSWW

It
It represents
represents the
the overall
overall noise
noise
amongst
amongst all
all the
the groups
groups we’re
we’re comparing
comparing
Within Mean Squares

Sample 1 Sample 2 Sample 3

Our Within Means Squares refers to the variability


amongst all our samples pooled together
(ie: Noise)
General Equation:
The Point

MSB
MSW

The point:

We’re looking to see if the


differences between our groups

are larger than the natural differences


we observed between all our data points
ANOVA
an example

 The Scenario
 Births are big business! Let’s
look at a simplified study
comparing three popular
techniques

 I have 15 people, all of whom


are due to give birth this
month. Water
Birthing
 Five people will try each of
three different popular birth
procedures and rate their pain
levels on a scale from 1-50
immediately after birth
Between vs Within Groups
Question 1

 Does
There this
is nodata have high between group
variation
variance
within eachor high within group variance?
treatment

B H W
10 20 30 There is variation
between group
10 20 30
10 20 30
10 20 30
10 20 30
Between vs Within Groups
Question 2

 Does There is considerable


this data have high between group
variation within each condition
variance or high within group variance?
B H W
50 50 50
5 5 5
35 35 35
10 10 10 There is no variation
between the groups
20 20 20
Mean 24 24 24 All had the same mean
H0 vs. HA
ANOVA
H0 and H1

 Null Hypothesis (H0)


μ 1 = μ 2 = μ 3
Ex: all subjects experienced
equivalent amounts of pain

 Alternative Hypothesis (HA)


At least one of the means is
different from at least one of
the other means.
Tails
ANOVA
F-Distribution

H0 HA

%

• F-tests use squared units…


• So, do we need to be worried about the number of tails
here?
Assumptions
 Very similar to t-tests
 Random sampling

Outcome is normally
distributed

 Equality of variance

 Groups are independent


of one another
Uses for
ANOVAs
ANOVA
Uses

 So, now that we can compare


three groups… why would we?

 For the same reasons we’d run


a t-test!
 To test hypotheses

 To compare the composition of our


samples prior to digging in to our
hypotheses

 To identify variables for use in other


analyses
ANOVA
Interpretation

 Imagine we ran an analysis on those fifteen


pregnant women we mentioned earlier and
detected a real difference in the level of pain
they experienced.

 Our interpretation might look something like:

 Based on this sample of 15 pregnant women, a one-


way ANOVA revealed at least one statistically significant
difference between the pain rating of patients who
underwent childbirth using The Bradley Method,
HypnoBirthing, or Water Birthing ( F(2, 12) = 3.90, p < .05)”
ANOVA
Post Hoc Test
 “…at least one statistically significant
difference…”
 Does this really tell us which groups
experienced less or more pain?

 No! The problem with ANOVAs is that


they’re a global test.
 They check whether there are any
differences between any groups
 They don’t tell you which groups
differed

 We need a post hoc test!


Post Hoc Tests
 Post Hoc ≈ after the fact

 A series of tests used to determine


which groups differ

 There are many different Post Hoc


tests out there…
Post Hoc Test Use
Bonferroni A simple, conservative option
Tukey HSD Designed for = group sizes
Tukey Kramer Designed for ≠ group sizes
Scheffe A conservative option for complex analyses
And many, many more…
Post Hoc Tests

StatisticallyStatisticallyStatistically
Significant?Significant?Significant?

Sample 1 Sample 2 Sample 3

It’s just like running a bunch of t-tests


to compare each possible pair…
In Reality
H0 is True H0 is True HA is True

Type 2 Error
Our Test Says


HA is True

Type 1 Error


…Except they control for Type 1 Errors
Red Flags

Are these post hoc


results?

If so, what post hoc


test was run?

Which group is the


comparison group?

Are we sure the


overall ANOVA was
significant?

Das könnte Ihnen auch gefallen