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

Analysis of Variance

When we used z test or t test we had only two groups

If we have more than 2 groups then we will have to use z test or t test for more than once.

Eg if we have 4 groups

A,B,C,AND D

two at a time
4
( )=6 A with B , A with C , A with D
2
B with C , B with D and C with D

Here we can use Analysis of variance

ANOVA is used to compare equality of several population means

Null hypothesis is

H0: µ1=µ2=µ3…….=µn H1: not all µ1=µ2=µ3…….=µn

𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 1
Test statistic is F= F is ratio of variances
𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒 2

The technique is called as Analysis of variance but we are testing equality of several population
means.

Remember
1
Variance =𝑛 ∑(𝑋𝑖 − 𝑋̅)2
1 1 1 2 𝑛
= ∑(𝑋𝑖 − 𝑋̅)2= ∑(𝑋𝑖 2 − 2𝑋𝑖𝑋̅ + 𝑋̅ 2 )= ∑ 𝑋𝑖 2 − 𝑋̅ ∑ 𝑋𝑖 + 𝑋̅ 2
𝑛 𝑛 𝑛 𝑛 𝑛

1
Variance = 𝑛 ∑ 𝑋𝑖 2 − 𝑋̅ 2

Principles of experimentation

1. Randomization-
2. Replication
3. Local Control
Example

Method 1 Method 2 Method 3


Observations Observations Observations
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7
8

Example- 4 fertilizers A, B, C, D

A A B C C D A

B B C B A B C

D D A A D C B

C C D D B A D

Null hypothesis is

H0: µ1=µ2=µ3…….=µn H1: not all µ1=µ2=µ3…….=µn

Method 1 Method 2 Method 3


Observations Observations Observations
X11 X21 X31
X12 X22 X32
X13 X23 X33
X14 X24 ..
.. X25 ..
.. ..
X1m .. X3m
X2m
There are n treatments (method) and m observations

Method 1 Method 2 Method 3


Observations Observations Observations
X11 X21 X31
X12 X22 X32
X13 X23 X33
X14 X24 ..
.. X25 ..
.. ..
X1m .. X3m
X2m

Sum T1 T2 T3 Grand Total =G

Observations Observations Observations


X112 X212 X312
X122 X222 X322
X132 X232 X332
.. X242 ..
.. X252 ..
X1m2 ..
.. X3m2
X2m2

Total ∑ ∑ 𝑋𝑖𝑗 2
𝐺2
Calculate Correction Factor C F=
𝑚𝑛

Total sum of squares TSS= ∑ ∑ 𝑋𝑖𝑗 2 -CF


𝑇𝑖 2
Treatment Sum of Squares= ∑ 𝑚
-CF

ANOVA TABLE

Source of Degrees of Sum of Mean Sum of F ratio F table


Variation Freedom Squares Square

Treatment n-1 𝑇𝑖 2 SS treatment MSS At 5%


∑ -CF
𝑚 / df Treatment / F(n-1), n(m-1)
M SS Error
Error (mn-1)-(n-1) By subtraction SS Error / df

Total mn-1 ∑ ∑ 𝑋𝑖𝑗 2 -CF

Decision rule: if F calculated > F tabulated, then we reject H0, otherwise accept it.
Illustration

There are three training methodologies used for training the new recruits. The methods are used for
a long period, but the performance of the new recruits is not in the same way. Hence it is required to
test the similarity of the result of these three training methods. The scores of the new recruits after
the training is given in the following table

Method 1 45 55 42 58 56 53 58
Method 2 42 49 62 74 58 56 52
Method 3 56 69 68 67 63 65 65
Test at 5% level of significance whether the methods are equally effective in training the new
recruits.

H0: the three training methods are equally effective Or There is no significant difference in the
training methodologies Or µ1=µ2=µ3

H1: not all µ1=µ2=µ3

Method 1 45 55 42 58 56 53 58
Method 2 42 49 62 74 58 56 52
Method 3 56 69 68 67 63 65 65

Changing origin to 60

Total
Method 1 -15 -5 -18 -2 -4 -7 -2 -53
Method 2 -18 -11 2 14 -2 -4 -8 -27
Method 3 -4 9 8 7 3 5 5 33
Total -47

Source of Degrees of Sum of Mean Sum of F ratio F table


Variation Freedom Squares Square

Treatment n-1=3-1=2 𝑇𝑖 2 SS treatment F=MSS At 5%


∑ -CF=
𝑚 / df Treatment / F(n-1) , n(m-1)=
661-105.19
=555.80/2 = M SS Error F2,18=3.55
= 555.80
277.90 =277.90/54.66
= 5.083
Error (mn-1)-(n-1) = By subtraction SS Error / df As F calculated > F tabulated
18 = 1539.81- = 984/18 = we reject the H0
555.81 = 984 54.66
Total mn-1= 21-1= ∑ ∑ 𝑋𝑖𝑗 2 -CF =
20 1645-105.19
=1539.81

the three training methods are not equally effective Or There is significant difference in the training
methodologies Or not all µ1=µ2=µ3
Anova: Single Factor

SUMMARY
Groups Count Sum Average Variance
Method 1 7 367 52.42857 40.95238
Method 2 7 393 56.14286 104.1429
Method 3 7 453 64.71429 18.90476

ANOVA
Source of Variation SS df MS F P-value F crit
Between Groups 555.8095 2 277.9048 5.083624 0.017773 3.554557
Within Groups 984 18 54.66667

Total 1539.81 20

Example 2

A marketing campaign was conducted in four metro cities. The number of retail outlets were
different in every metro. We need to test whether the marketing campaign has same effect in all the
metro cities. Use α=5%

Amount in Rs. Lakhs: revenue in one week

Metro city A Metro city B Metro City C Metro City D


275 230 234 275
230 256 256 280
233 280 280 290
140 290
Note: the number of observations may be different

H0: marketing campaign has the same effect in all the metro cities

H1: marketing campaign does not have the same effect in all the metro cities

Anova: Single Factor

SUMMARY
Groups Count Sum Average Variance
Metro city A 4 878 219.5 3231
Metro city B 4 1056 264 717.3333
Metro City C 3 770 256.6667 529.3333
Metro City D 3 845 281.6667 58.33333

ANOVA
Source of Variation SS df MS F P-value F crit
Between Groups 7475.167 3 2491.722 1.913716 0.191347 3.708265
Within Groups 13020.33 10 1302.033

Total 20495.5 13

As F cal < F Tab , we accept H0

:marketing campaign has the same effect in all the metro cities

Examples

1.

The three teams have performed in various occasions as below

Test at 5% level of significance if their performance is same

Team 1 Team 2 Team 3


22 19 25
25 27 34
25 16 16
26 23 27
23 18 31

2. The four sections appeared for the same test in a subject taught by the same professor. The
scores are as below, test at 5% level of significance if the performance of all the sections is same.

Section A 78 65 66 98 45 85 65 25 14
Section B 89 23 44 45 68 79 92 65 63
Section C 56 48 56 57 84 96 75 80 47
Section D 32 49 66 57 99 80 71 61 59

You might also like