ANOVA
ANOVA
2
So far…
3. Simple Random Samples from two populations
with known σ.
- Two sample z-test.
4. Simple Random Samples from
two populations with unknown σ.
- Two sample t-test.
3
Sampling Study with k>2
Populations
• In the previous lecture, we compared means from
two independent groups.
• In this lecture, we extend the procedure to consider
means from k independent groups, where k is 2 or
greater
• One sample is drawn independently and randomly
from each of k > 2 populations.
4
Test of Significance for Three or More
Population
5
Test of Significance for Three or More Population
2. Population proportion
• 2 test
6
Analysis of Variance
(ANOVA)
7
Comparison of several means -
Analysis of variance
• A t-distribution can be used for testing hypotheses about
differences of means for independent samples if both
populations are normal and have the same variances.
9
Hypothesis in ANOVA
between groups k
SSB = niMi 2 T 2 / N
i 1
within groups
SSW = S niMi
i 1
2
Total
SST =
S T2 /N
(= SSB +SSW)
13
The significance test for differences between the groups is based on a
comparison of the between groups and within groups mean squares.
♣ If the observed differences between the means of the groups are simply
due to chance variation, the variation between these group means will be
about the same as the variation within individuals of the same type.
♣ If there are real differences, the between groups variation will be larger.
The mean squares are compared using the F-test. This test is sometimes
known as variance-ratio test.
Between groups
F= ,
Within groups
D.F. = d.f. Between-groups, d.f. within-groups
= (k-1, N-k)
15
• The within-groups mean square is also called the
error mean square (MSE); the degrees of freedom
is error degrees of freedom and the SS is error sum
of squares (SSE).
– Between Groups Variance – measures how groups
vary about the Grand mean.
– Within Groups Variance – measures how scores in
each group vary about the group mean.
16
• If calculated F > Ftabulated reject HO.
– Ftabulated depends on , degree of freedom for the
numerator and degree of freedom for the denominator
• Follow-up Procedures
– “significant” F only tells us there are differences, not
where specific differences lie.
17
Critical values for the F-statistic
…
DCH,
AAU
18
Assumptions
The data are normally distributed or the samples have come from
Normally distributed populations.
The population value for the standard deviation between individuals is
the same for each group (equal variance).
Moderate departures from normality may be safely ignored, but the
effect of unequal standard deviations may be serious. In the latter
case, transforming the data may be useful.
19
Assumptions in ANOVA…
• distributional assumptions:
- Independence
- Normality
- Equal variance (homoscedasticity)
20
Assumptions in ANOVA…
• We are familiar with the first two distributional
assumptions from our study of the independent t
test.
• The independence assumptions supposes we have
k simple random samples, one from each of the k
populations.
21
Assumptions in ANOVA…
• The Normality assumption supposes that each
population has a Normal distribution or the sample
is large enough to impose Normal sampling
distributions of means through the Central Limit
Theorem.
• Check with
- Residuals plot
- Shpiro – Wilk’s test
22
Tests for
Heteroscedasticity
• It is prudent to assess the equal variance
assumption before conducting an ANOVA.
• These include
- Bartlett’s test, and
- Levene’s test.
23
Pair-wise comparisons of group means
One way ANOVA is an extension of the two sample t test. When there
are only two groups, the F value will be the square of the
corresponding t value with (1, N-2) degrees of freedom. Remember the
degrees of freedom for the two sample t test is N-2.
Further analysis is required to find out how the means differ, for
example, whether one group differs from all the others.
24
Example
♣ The table below shows red cell folate levels for the three groups after 24
hours' ventilation. We wish to compare the three groups, and test the null
hypothesis that the three groups have the same red cell folate levels.
♣ Examination of the data does not reveal any obvious outliers and the
data in each group look plausible samples from a Normal distribution. The
standard deviation in group I is rather higher than those in the other groups,
but moderate variability is not a problem. Bartlett's test is useful for
assessing the null hypothesis that more than two samples come from
populations with the same variance. Some computer programs incorporate
this test.
25
Red cell folate levels (μg/l) in three groups of cardiac
bypass patients given different levels of nitrous oxide
ventilation (Amess et al., 1978)
26
calculations
k
N= ni
i 1
= 8 + 9 + 5 = 22
Σxi = T = 243+251+275+ ….+293+328 = 6231
Σni X i - (Σxi)/ N
= 1820021 - 1780305
= 39716
Hypotheses
Ho : μ1 = μ2 = μ3
Since the P value is less than 0.05, the null hypothesis is rejected.
28
Multiple Comparison Tests
1. Tukey’s HSD Procedure (Honestly Significant
Difference)
2. Scheffe”s Procedure – most versatile
3. Newman-Keuls Procedure
4. Dunnet’s Procedure
5. Dunn’s multiple-comparison
6. Least Significance Difference (LSD)
29
Choice of Multiple Comparisons of Means
• The choice of a multiple comparisons method in
ANOVA will depend on the type of experimental
design used and the comparisons of interest to the
analyst.
For example,
• Tukey ( 1949) developed his procedure specifically for
pairwise comparisons when the sample sizes of the
treatments are equal.
30
Choice of Multiple Comparisons of
Means...
• The Bonferroni method, like the Tukey procedure, can
be applied when pair wise comparisons are of interest;
however,
• Bonferroni's method does not require equal sample
sizes.
• Scheffe (1953) developed a more general procedure for
comparing all possible linear combinations of treatment
means ( called contrasts).
31
Choice of Multiple Comparisons of
Means...
• Scheffé test – Suitable for pair-wise comparison
between all groups, not simply pair wise compare
– Corrects for the increased risk of a Type I error
(most conservative post-hoc test)
• Dunnet test – Useful for “planned comparisons”,
e.g. comparing two different groups against a
single control group
32
The Bonferroni t procedure
• also called Dunn’s multiple-comparison procedure)
Let m = the total number of possible comparisons.
• All pair wise differences (xi- xj )
are compared with the statistic
MSW MSW
t
2m
, n-k ni nj
33
The Bonferroni t
procedure…
• If the difference exceed the above value, the
differences are significantly different from zero.
34
Tukey’s HSD Test
• Frequently used for testing the null hypotheses that
all possible pairs of treatment means are equal when
the samples are all of the same size.
• Makes use of a single value against which all mean
differences are compared.
• This value, called the HSD, which is given by
MSW MSW MSE
HSD q ,k , N k q ,k , N k
ni nj n
35
Tukey’s HSD Test…
a the chosen level of significance
k the number of means in the experiment
N the total number of observations in the
experiment
q obtained from studentized range distribution with
, k, and N-k.
If the difference exceed the above value, the
differences are significantly different from zero.
36
Pair-wise comparisons of group means
Benferroni method
The modified t tests to compare the pairs of groups of interest, using the
Benferroni method to adjust the p-values are given as follows:
Returning to the red cell follate data given above, the residual
standard deviation is
2090 = 45.72.
Modified t tests to compare groups I and II, I and III and II and III
are performed by calculating:
37
i) groups I and II
t = (316.6 - 256.4) / (45.72 x( 18 19 ) = 2.71 on 19
degrees of freedom. The corresponding P
value = 0.014 and the corrected P value
P' = 0.014x3
= 0.042
Therefore, the main explanation for the difference between the groups that was
identified in the analysis of variance is thus the difference between groups I and II.
38
Exercise
A botanist plants random samples of each of four different strains of wheat on five plots
of land. The plots are of the same size and fertility and the same fertilizer is used on
each. The yields per plot are as follows:
39