Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

01/13/2015

What is ANOVA?
4.ANalysis Of
VAriance  Statistical technique specially designed to test
whether the means of more than 2 quantitative
populations are equal.
Shimelis Berhanu
Haramaya University  Developed by Sir Ronald A. Fisher in 1920’s.
2014

1 3

Contents
o What is ANOVA?
ANOVA
o One way ANOVA
o Two way ANOVA One way ANOVA Two way ANOVA Three way ANOVA
Multivariate ANOVA
Effect of Irrigation Effect of Irrigation Effect of Irrigation,
on Yield & Fertilizer on Yield Fertilizer, Slope on Yield

2 4
01/13/2015

One Way ANOVA Assumptions


1) Normality: The values in each group are normally distributed.
2) Homogeneity of variances: The variance within each group
should be equal for all groups.
3) Independence of error: The error (variation of each value
around its own group mean) should be independent for each
value.

5 7

Data required Steps


One way ANOVA or single factor ANOVA: 1. State null & alternative hypotheses: Ho & H1
 Determines means of ≥3 independent groups significantly 2. State Alpha: 
different from one another. 3. Calculate degrees of Freedom: df N & dfD
4. State decision rule: F crt
 Only 1 independent variable (factor) with ≥3 levels
 Post hoc tests help determine where difference exist 5. Calculate test statistic: F cal
- Calculate variance between samples
- Calculate variance within the samples
- Calculate F statistic
- If F is significant, perform post hoc test

6. State Results & conclusion


6 8
01/13/2015

1. State null & alternative hypotheses

H 0  1   2  ...   i
H0 : all sample means are equal

H a  not all of the i are equal


At least one sample has different mean

9 11

Calculating variance between samples


2. State alpha i.e 0.05 1. Calculate the mean of each sample
3. Calculate degrees of Freedom 2. Calculate the Grand average
k-1&n-1 3. Take the difference between means of various samples
k = No of samples & grand average
n = Total No of observations 4. Square these deviations & obtain total which will give
4. State decision rule sum of squares between samples (SSC)
If test value of F > critical value of F, reject Ho 5. Divide the total obtained in step 4 by the degrees of
5. Calculate test statistic freedom to calculate the mean sum of square between
samples (MSC)

10 12
01/13/2015

Calculating Variance within Samples Calculation of F statistic


1. Calculate mean value of each sample Variability between groups
F
2. Take the deviations of the various items in a sample Variability within groups
from the mean values of the respective samples.
3. Square these deviations & obtain total which gives the F- statistic =
sum of square within the samples (SSE)
4. Divide the total obtained in 3rd step by the degrees of Compare the F-statistic value with F(critical) value which is
freedom to calculate the mean sum of squares within obtained by looking for it in F distribution tables against degrees of
samples (MSE). freedom. If calculated value of F > table value, then H0 is rejected

13 15

Between-group variance is large relative to the within-group


The mean sum of squares variance, so F statistic will be larger & > critical value, therefore
statistically significant .
Calculation of MSC Calculation of MSE Conclusion – At least one of group means is significantly
Mean sum of Squares Mean Sum Of Squares different from other group means
between samples within samples

SSC SSE Within-Group


MSC  MSE  Variance
k 1 nk Between-Group
Variance
k = No of Samples, n = Total No of observations

14 16
01/13/2015

Within-group variance is larger, and the between-group variance


smaller, so F will be smaller
One way ANOVA: Table
Reflecting the likely-hood of no significant differences between Source of SS (Sum of Degrees of MS (Mean Variance
these 3 sample means Variation Squares) Freedom Square) Ratio of F

Between MSC= MSC/MSE


SSC k-1
Samples SSC/(k-1)
Within-Group
Variance Within MSE=
Between-Group SSE n-k
Samples SSE/(n-k)
Variance

Total SS(Total) n-1

17 19

Post-hoc Tests Example - One way ANOVA


Used to determine which mean or group of means is/are Three samples obtained from normal populations with equal
significantly different from the others (significant F) variances. Test the hypothesis that sample means are equal
Depending upon research design & research question: when all
pairs of sample means are to be tested 8 7 12
 Least Significance Difference 10 5 9
 Duncan Multiple Range Test 7 10 13
 Tukey’s Procedure 14 9 12
11 9 14

18 20
01/13/2015

Solution
1.Null hypothesis Variance BETWEEN samples (ȳ1 = 10, ȳ2 = 8, ȳ3 = 12)
No significant difference in the means of 3 samples Sum of squares between samples (SSC)
2. State Alpha i.e 0.05 n1 (ȳ1 – Grand avg)2 + n2 (ȳ2 – Grand avg)2 + n3 (ȳ3 – Grand avg)2
3. Calculate degrees of freedom 5 (10 - 10) 2 + 5 (8 - 10) 2 + 5 (12 - 10) 2 = 40
k-1 & n-k = 2 & 12
4. State decision rule Calculation of Mean sum of Squares between samples (MSC)
Table value of F at 5% level of significance for d.f 2 & 12 is 3.88
SSC
The calculated value of F > 3.88, H0 will be rejected MSC   40  20
k 1 2
5. Calculate test statistic
k = No of Samples, n = Total No of observations
21 23

Variance WITH IN samples (ȳ1 = 10, ȳ2 = 8, ȳ3 = 12)


X1 (X1 – ȳ1)2 X2 (X2– ȳ2)2 X3 (X3– ȳ3)2
8 4 7 1 12 0
X1 X2 X3 10 0 5 9 9 9
8 7 12 7 9 10 4 13 1
10 5 9 14 16 9 1 12 0
7 10 13 11 1 9 1 14 4
14 9 12 30 16 14
11 9 14
Sum of squares within samples (SSE) = 30 + 16 +14 = 60
Total = 50 Total = 40 Total = 60
ȳ1= 10 ȳ2 = 8 ȳ3 = 12 Calculation of Mean Sum Of Squares within samples (MSE)

10 + 8 + 12 SSE 60
Grand average = = 10 MSE    5
3 n  k 12
22 24
01/13/2015

Calculation of ratio F AFTER ANOVA RESULTS?


Variabilit y between groups ANOVA test tells us whether we have an overall difference
F between our groups but it does not tell us which specific
Variabilit y within groups
groups differed.

F- statistic = = 20/5 = 4 Two possibilities available:


 For specific predictions k/a priori tests (contrasts)
 For predictions after the test k/a post-hoc comparisons
The Table value of F at 5% level of significance for d.f 2 & 12 is 3.88
The calculated value of F > table value
H0 is rejected. Hence there is significant difference in sample means

25 27

Short cut method


X1 (X1) 2 X2 (X2)2 X3 (X3)2
8 64 7 49 12 144 CONTRASTS
10 100 5 25 9 81
Known as priori or planned comparisons
7 49 10 100 13 169 ◦ Used when a researcher plans to compare specific group
14 196 9 81 12 144 means prior to collecting the data or
11 121 9 81 14 196 ◦ Decides to compare group means after the data has been
Total = 50 530 40 336 60 734 collected & noticing that some of the means appears to be
different
Total sum of all observations = 50 + 40 + 60 = 150 ◦ This can be tested, even when the H0 cannot be rejected
Correction factor = T2/N = (150)2/15 = 22500/15 = 1500
Total sum of squares = 530 + 336 + 734 – 1500 = 100
Sum of square b/w samples = (50)2/5 + (40)2/5 + (60)2/5 – 1500 = 40
Sum of squares within samples = 100 – 40 = 60
26 28
01/13/2015

Two Way ANOVA Two way ANOVA


Include tests of three null hypotheses:
1) Means of observations grouped by one factor are same;
2) Means of observations grouped by the other factor are the
same; and
3) There is no interaction between the two factors. The interaction
test tells whether the effects of one factor depend on the other
factor

29 31

Data required Example


When 2 independent variables have an effect on one If we want to study the effect of different level of Fertilizer and
dependent variable Irrigation water.
Compares relative influences on Dependent Variable
Examine interactions between independent variables Two independent factors - level of Fertilizer and Irrigation water
Just as we had Sums of Squares and Mean Squares in Dependent factor – Yield of crop
One-way ANOVA, we have the same in Two-way ANOVA.

30 32
01/13/2015

Ho – level of fertilizer will have no significant effect on yield of


crop
Ha –

Ho – level of irrigation will have no significant effect on yield of


crop
Ha –

Ho – fertilizer and irrigation interaction will have no significant


effect on yield of crop
Ha -
33

Two-way ANOVA Table


Source of Degrees of Sum of Mean
F-ratio P-value
Variation Freedom Squares Square
Factor A r-1 SSA MSA FA = MSA / MSE Tail area

Factor B c- 1 SSB MSB FB = MSB / MSE Tail area


Interaction (r – 1) (c – 1) SSAB MSAB FAB = MSAB / MSE Tail area

Error (within) rc(n – 1) SSE MSE


Total rcn - 1 SST

34

You might also like