TEST-5 Material F - Test and Chi-Square Test PDF
TEST-5 Material F - Test and Chi-Square Test PDF
TEST-5 Material F - Test and Chi-Square Test PDF
F-Test:
Procedure:
Let small samples of sizes n1 , n2 drawn from two populations and variances 21 and 2 2
respectively. Let s12 , s2 2 be the variances of samples. We want to test the equality of
variances of the two populations.
2 2
ns ns
Let S 1 1 1
2
, S 22 2 2
n1 1 n2 1
2
S1
If S 21 S 2 2 , then the test statistic F 2
S2
Inference:
1) A group of 10 rats fed on diet A and another group of 8 rats fed on diet B recorded the following
increase in weight
Diet A 5 6 8 1 12 4 3 9 6 10
Diet B 2 3 6 8 10 1 2 8 - -
Show that the estimates of the population variance from the samples are not significantly different
Solution:
Null hypothesis H0 : There is no significant difference between the variance
increase in weight due to diets A & B (i.e) S12= S22
Alternative hypothesis H1 : S12≠ S22
Test Statistic :
S12 S 22
F or F
S 22 S12
To calculate sample means and variance:
x x- x (x - x )2 y y- y (y- y )2
(x -6.4) (y-5)
5 -1.4 1.96 2 -3 9
6 0.4 0.16 3 -2 4
∑𝑥 y
Mean of diet A = 𝑥̅ = Mean of diet B y
𝑛1 n2
64 40
Here n1 = 10, x Here n2 =8,𝑦̅ =
10 8
𝑥̅ = 6.4 𝑦̅ = 5
2
yy
S2 2
n2 1
82
𝑆22=
8−1
2
S2 = 11.7143
2
xx
S1 2
n1 1
102.40
10 1
S21 = 11.3778
S2 2
F
S12
S2 2 S2 2
11.7143
11.3778
Fcal = 1.0296 with degrees of freedom υ= (n2-1, n1-1)
υ = (7,9)
Tabulated value of F(7,9)=3.12
Since Fcal < Ftab ,H0 is a accepted.
(ie) there is no significant difference in population variance from the samples.
2) Test if the variances are significantly different for
X1 24 27 26 21 25
X2 27 30 32 36 28 23
Solution:
To test the variance are significantly different , we use F - test
Given n1 = 5,n2=6
Calculation for means and S.D of the samples
x x- x (x - x )2 y y- y (y- y )2
(x -24.6) (y-29.33)
24 -0.6 0.36 27 -2.33 5.4289
equal to 160 and 91 respectively. Can they be regarded as drawn from the same normal population.
Solution:
x x
2
160 ie) n1s1 160
2
Given, n1 = 9 , i
y 2
y 91 ie) n2 s2 91
2
n2 = 8 , i
2
ns 160 160
S 1 1 1 =
2
20
n1 1 9 1 8
2
ns 91 91
S 2
2 2 2 = 13
n2 1 8 1 7
2
S1
Since S 21 S 2 2 , F 2
S2
20
1.54
13
Level of significance : 5 %
(ie) the two samples could have come from two normal populations with the same variances.
4) The nicotine contents in two random samples of tobacco are given below:
Sample I 21 24 25 26 27
Sample II 22 27 28 30 31 36
Can you say that the two samples came from the same population?
Solution:
∑𝑥 123 ∑𝑦 174
𝑥̅ = = = 24.6 𝑦̅ = = = 29
𝑛1 5 𝑛2 6
∑(𝑥 − 𝑥̅ ) = 21.2 2 2
∑(𝑦 − 𝑦̅) = 108
∑(𝑥−𝑥̅ )2 ∑(𝑦−𝑦̅)2
𝑆12 = 𝑆22 =
𝑛1 −1 𝑛2 −1
21.20 108
= 5−1 = 6−1
𝑆12 = 5.3 𝑆22 = 21.6
21.6
Test statistic F
5 .3
t-test
̅̅̅−x
x1 ̅̅̅2
Test Statistic t=
n s2 +n s2 1 1
√( 1 1 2 2 )( + )
n1 +n2 −2 n1 n2
4.4 4 .4
= = = - 1.92
21.2 108 1 1 2.2943
9 5 6
Therfore , the two samples could have been drawn from the same normal population.
Chi-square test
A test for resting the significance of discrepancy between experimental values and the
theoretical values obtained under some theory or hypothesis is known as 2 test for
goodness of fit.
2 Oi Ei 2
Ei
where Oi -observed frequency ,
Ei - expected frequency
and is used to test whether difference between observed and expected frequency are
2
significant
Application of Chi - square test:
1.To test the goodness of fit
Oij Eij 2
The test statistic 2
Eij
If c T
2 2
(i) , H0 is accepted . ( ie) the attributes A and B are independent.
If c T
2 2
(ii) , H0 is rejected . ( ie) the attributes A and B are not independent.
1) The number of air-craft accidents that occurred during the various days of the week.Test
whether the accidents are uniformly distributed over the week.
Day Mon Tues Wed Thurs Fri Sat
No. of accidents 15 19 13 12 16 15
= 2.01
Degrees of freedom v = 6-1 = 5
T 2 11.07
Tabulated value :
Since c 2.01 T 11.07 , H0 is accepted . ( ie) the accidents may be regarded to
2 2
agreement with the belief that accident conditions were the same during this 10 week period.
Solution:
100
Expected frequency of a accidents each week = 10
10
Null hypothesis Ho : The accident conditions were the same during the 10 week period
Observed Expected (0-E) 0 E 2
frequency (0) frequency E
(E)
12 10 2 0.4
8 10 -2 0.4
20 10 10 10.0
2 10 -8 6.4
14 10 4 1.6
10 10 0 0
15 10 5 2.5
6 10 -4 1.6
9 10 -1 0.1
4 10 -6 3.6
Σ=100 100 26.6
0 E 2
Now 2
E
2 = 26.6
(ie) calculated value 2 = 26.6
Degrees of freedom d.f= υ = n-1 = 10-1
υ=9
Since 2 cal > 2 tab, we reject the null hypothesis (ie) The accident conditions were not the same
during the 10 week period.
3) The theory predicts that the proportion of beans in four group should be 9 : 3 : 3 : 1.In an
examination with 1600 beans,the numbers in the four groups were 882, 313 , 287, and 118.Does the
expremental results support the theory.
Solution:
We want to test that the proportion of beans in the four groups are in the ratio 9: 3: 3: 1
H0 : The experiment support the theory (ie) the number of beans in the four groups are in the
ratio 9 : 3:3:1
Based on H0 the expected number of beans in the four groups are as follows :
9 3
E(1) = 1600 900 , E(2) = 1600 300
16 16
3 1
E(3) = 1600 300 , E(4) = 1600 100
16 16
Observed Expected (0i-Ei) 0 E 2
frequency (0) frequency E
(E)
882 900 -18 0.36
313 300 13 0.56
287 300 -13 0.56
118 100 18 3.24
Σ=1600 1600 4.72
T 2 7.82
Tabulated value :
4) Fit a binomial distribution for the following data and also test the goodness of fit.
x 0 1 2 3 4 5 6 Total
f 5 18 28 12 7 6 4 80
Solution:
The probability law for binomial distribution is P( X x) nC x p x q n x , x 0,1,2,3,......
Mean of a binomial distribution = np from which we can find p.
x: 0 1 2 3 4 5 6 Total
f : 5 18 28 12 7 6 4 80
fx: 0 18 56 36 28 30 24 192
Mean x
fx 192 2.4
f 80
(ie) np = 2.4 or 6p = 2.4
p 0.4 and hence q 0.6
The expected frequencies are given by E ( x) = N nC x p x q n x , x 0,1,2,3,......
E ( x) = 80 6Cx 0.4 0.6
x 6 x
, x 0,1,2,3,.....6.
E(0) = 80 6C0 0.4 0.6 , 3.73 4
0 60
28 25 3 0.36
12 22 -10 4.545
7 11 3 0.642
6 17 3 14
4 0
Σ=80 80 6.389
Since E O ,
i i Degrees of freedom v = n – k 4 -2 = 2
T 2 5.99
Tabulated value :
(ie) the binomial fit for the given distribution is not satisfactory.
5) Fit a Poisson distribution for the following distribution and also test the goodness of fit.
x 0 1 2 3 4 5 Total
f 142 156 69 27 5 1 400
e x
The probability law for poisson distribution is P( X x) , x 0,1,2,3.......
x!
x: 0 1 2 3 4 5 Total
f : 142 156 69 27 5 1 400
fx: 0 156 138 81 20 5 400
Mean x
fx 400 1
f 400
e x e 1
The expected frequencies are given by E ( x) = N 400 .x 0,1,2,3, , , , , ,
x! x!
e 1 e 1
E ( 1) = 400 . 400 147.15 147
x! 1!
e 1 e 1
E ( 2) = 400 . 400 73.58 74
x! 2!
e 1 e 1
E ( 3) = 400 . 400 24.53 25
x! 3!
e 1 e 1
E ( 4) = 400 . 400 6.13 6
x! 4!
e 1 e 1
E ( 5) = 400 . 400 1.23 1
x! 5!
T 2 5.99
Tabulated value :
Smokers Non-smokers
Literates 83 57
Illitrates 45 68
Based on this ,can you say that there is no relation between smoking and literacy?
Oi Ei Ei(rounded) Oi-Ei 0 E 2
E
83 128 140 71 12 2.03
70.83
253
57 125 140 69 12 2.09
69.17
253
45 128 113 57 -12 2.53
57.17
253
68 125 113 56 12 2.57
55.83
253
ΣOi=253 ΣEi =253 9.22
0 E 2
Now 2
E
2 = 9.22
(ie) calculated value 2 = 9.22
Degrees of freedom d.f= υ =(m-1) (n-1) = (2-1)(2-1) = 1
υ=1
From the table : Tabulated value T 3.84
2
Since 2 cal > 2 tab, we reject the null hypothesis (ie) There is some association between literacy
and smoking.
1. The degrees of freedom for the Chi-Square test statistic when testing for independence in a contingency table
with 4 rows and 4 columns would be
(a) test for difference in two variances. (b) to make inference about a population mean.
(c) to test for homogeneity of proportions. (d) for pairwise multiple comparisons of means.
3. To determine whether a set of observed frequencies differ from their corresponding expected
4. When using the chi-square test for differences in two proportions with a contingency table that has
r rows and c columns, the degrees of freedom for the test statistic will be: