Professional Documents
Culture Documents
Week10 One and Two Way Anova
Week10 One and Two Way Anova
Analysis of Variance
Review and Preview
One-Way ANOVA
Two-Way ANOVA
One-Way ANOVA
Two-Way ANOVA
Spreads A centred
C
B
A
20 40 60 80
1
1 3j = y3j - 3
2
2 = 2 -
3
3
If the variation between the sample means is
small, relative to the variation within the
samples, then there would be considerable
overlap of observations in the different
samples, and we would be unlikely to detect
any differences among the population means.
2j = y2j - 2
= 1 = 2 = 3
If we consider all of the data together, regardless of
which sample the observation belongs to, we can
measure the overall total variability in the data by:
k ni
ij
( x - x̄ ) 2
i =1 j =1
ij
( x - x ) 2
= i
( x - x ) 2
+ ij i
( x - x ) 2
i =1 j =1 i =1 j =1 i =1 j =1
0 1 2 3 4
40
20
0
1 2 3
group
Analysis of Variance
> summary.1way(fit2)
ANOVA Table:
Df Sum Squares Mean Square F-statistic p-value
Between Groups 2 1446.60015 723.30007 1.95683 0.14748
Within Groups 87 32157.7458 369.62926
Total 89 33604.34595 No evidence against H0
Numeric Summary:
Sample size Mean Median Std Dev Midspread
All Data 90 49.98675 49.70776 19.43134 24.86226
1 30 45.08567 42.91017 19.83452 23.30580
2 30 49.96857 55.10369 19.79035 26.50691
3 30 54.90600 52.83934 17.99504 26.97609
Means
Table of Effects: (GrandMean and deviations & effects
from GM) similar to
typ.val 1 2 3 previous example
49.98675 -4.90108 -0.01817 4.91926
Analysis of Variance
Variation between groups is small compared to the variation within groups
40
20
0
1 2 3
group
A significant F-test tells us that at least two of the
underlying population means are different, but it
does not tell us which ones differ from the others.
We need extra tests to compare all the means, which
we call Multiple Comparisons.
We look at the difference between every pair of group
population means, as well as the confidence interval
for each difference.
When we have k groups, there are:
k k! k ( k - 1)
= =
k choose 2 2 2! ( k 2 )!
- 2
possible pair-wise comparisons.
H 0 : 1 = 2 = 3
H1 : At least one of the means is different from the others.
H0 : 1 = 2 H0 : 1 = 3 H0 : 2 = 3
n2 = 22 x2 = 94.136364
MS(error) = 248.424127
102.705128 - 94.136364
= = 2.252
1 1
248.424127 +
78 22
Conclusion:
Although the ANOVA test tells us that at
least one of the sample means is
different from the others, the
Bonferroni test results do not identify
any one particular sample mean that is
significantly different from the others.
One-Way ANOVA
Two-Way ANOVA
For the row factor, F = 0.07 and the P-value is 0.791. Fail
to reject the null hypothesis, there is no evidence that IQ
scores are affected by the gender of the subject.