Chapter 18: Chi-Squared Test: SA A D SD O
Chapter 18: Chi-Squared Test: SA A D SD O
Chapter 18: Chi-Squared Test: SA A D SD O
1. Two hundred adult smokers are asked whether they agree to quit smoking. 2. The power lines across a range of mountains are constantly struck by lightning.
The results are shown in the table below. The number of occurrence per week is recorded for the past 72 weeks.
The results obtained are shown in the table.
Response Strongly agree Agree Disagree Strongly disagree
No. of smokers 97 55 33 15 No. of lightning strikes per week 0 1 2 3 ≥4
No. of weeks 14 21 17 12 8
A researcher claims that the smokers' response towards quit smoking is in
the ratio of 4 : 3 : 2 : 1. Determine, at the 5% significance level, whether the Perform a 2 goodness of fit test, at the 1% significance level, to determine
researcher's claim is justified. [8] whether the data fits a Poisson distribution with a mean of 2. [8]
Ho : Smokers' response towards quit smoking is in the ratio of 4 : 3 : 2 : 1 You may use the probability distribution of a Poisson random variable with
mean 2 given below.
H1 : Smokers' response towards quit smoking is not in the ratio of 4 : 3 : 2 : 1
No. of occurrence 0 1 2 3 ≥4
Probability 0.1353 0.2707 0.2707 0.1804 0.1429
SA A D SD Sum
Oi 97 55 33 15 200
H0 : The observed data fits a Po(2)
4 3 2 1
(200) = 80 (200) = 60 (200) (200) H1 : The observed data does not fits a Po(2)
Ei 10 10 10 10
= 80 = 40 = 20 200
x (Oi E i )2
(Oi Ei )2 x Oi [ ( 2x ! ) ] x 72
Ei = e 2
Ei
Ei 3.613 0.417 1.225 1.25 6.505
0 14 9.742 1.861
1 21 19.490 0.117
v=4–1=3: At = 0.05, reject Ho if 2cal > 20.05 (3) (= 7.815) 2 17 19.490 0.318
3 12 12.989 0.075
Since 2cal = 6.505 (< 7.815) Do not reject Ho (Accept Ho) ≥4 8 72 – [E1 + E2 + E3 + E4] = 10.289 0.509
There is insufficient evidence to reject the researcher’s claim at 5 % significance level 72 72 2cal = 2.880
Note : There is sufficient evidence to accept the researcher’s claim at 5 %
significance level. v=5–1=4: At = 0.01, reject Ho if 2cal > 20.01, 4 (= 13.28)
18-1
3. The numbers of dengue cases reported for the first 4 months of a certain year in 4. The symptom of hypertension and smoking habit for 120 individuals is shown
a state is shown the table below. in the contingency table below.
No. of cases 0 1 2 3 4 5 ≥6 Smoking
No. of days 3 12 20 28 23 18 16 habit Heavy Moderate Non-
Symptom of smokers smokers smokers
Test at the 5% significance level whether the Poisson distribution with a hypertension
parameter of 3.5 is a suitable model for the data. [8] Presence 22 25 15
Ho : Poisson distribution with mean 3.5 is a suitable model for the data. Absence 16 18 24
H1 : Poisson distribution with mean 3.5 is not a suitable model for the data.
Using a chi-squared test, at the 5% significance level, determine whether
the symptom of hypertension is independent of smoking habit. [11]
3 .5 x
X Po(3.5) : Ei = P(X = x) x 120 = e –3.5 . x 120
x! H0 : The symptom of hypertension is independent of smoking habit
0 H1 : The symptom of hypertension is not independent of smoking habit
3.5 3 .5
x = 0 : E1 = e –3.5 . x 120 = 3.624 x = 1: E2 = e –3.5 . x 120 = 12.683
0! 1!
r xc Smoking habits
–3.5 3.5 2 –3.5 3.5 3 n Total
x = 2 : E3 = e . x 120 = 22.195 x = 3: E4 = e . x 120 = 25.894 H M N
2! 3!
3.5 4 3.5 5 62 x 38 62 x 43
x = 4 : E5 = e –3.5 . x = 5: E6 = e –3.5 .
Symptom
x 120 = 22.657 x 120 = 15.860 P = 19.63 = 22.22 62 – E11 – E12 = 20.15 62
4! 5! 120 120
5
A 38 – E11 = 18.37 43 – E12 = 20.78 39 – E13 = 18.85 58
x ≥ 6 : E7 = 120 – Ei = 17.087
i0 Total 38 43 39 120
Since E1 < 5, combine E1 with E2.
18-2
5. An environmentalist investigates whether there is association between 6. A survey of 200 participants to study the preferred communication methods of two
temperature and air quality. Temperature and air quality of 200 randomly generations is carried out. The results of the survey are shown in the table below.
selected days are recorded as follows :
Preferred communication method
Air quality Internet Phone call SMS
Good Moderate Unhealthy X 28 43 39
Generation
Low 25 20 11 Y 47 17 26
Temp
Moderate 28 27 16
High 18 21 34 Determine, at the 5% significance level, whether there is evidence to reject the
null hypothesis that preferred communication methods and the generations are
Perform a chi-squared test at the 5% significance level to determine
independent. [10]
whether there is an association between temperature and air quality. [11]
H0 : The PCMs and the generations are independent.
Ho : There is no association between temperature and air quality
H1 : The PCMs and the generations are not independent.
H1 : There is an association between temperature and air quality
Gen.
L 56 200 200
200 200
Temperature
18-3
7. The milk yield from two breeds of goats, 8. A farmer claims that three types of eggs of grades A, B and C which are produced
Milk yield in his poultry farm are in the ratio of 2 : 4 : 3 respectively. In a random sample
A and B, is categorised as low, medium
or high. One hundred goats in a random Low Medium High of 180 eggs, 30 eggs are classified as grade A, 96 eggs as grade B and 54 eggs
sample are classified according to breed A 32 20 16 as grade C. Perform a test, at the 1 % significance level, to determine whether
Bread
and milk yield. The results are there is an evidence that the farmer’s claim is justified. [8]
summarised in the table. B 10 18 4
Ho : The data are in the ratio of 2 : 4 : 3
Perform a chi-squared test, at the 5% significance level, to determine whether
H1 : The data are not in the ratio of 2 : 4 : 3
there is an association between the breed of goats and the milk yield. [11]
A B C Sum
Ho : There is no association between the breed of
goats and the milk yield Oi 30 96 54 180
H1 : There is an association between the breed of 2 x 180 = 40 4 x 180 = 40
goats and the milk yield Ei 9 9 180 – E1 – E2 = 60 180
(Oi Ei )2 At the 1% significance level, there is sufficient evidence to justify the farmer’s claim
Oi Ei
Ei At the 1% significance level, there is insufficient evidence the farmer’s claim is not
32 28.56 0.414 justified
10 13.44 0.881 Since 2cal = 6.744 (> 5.991) Reject Ho At the 1% significance level, there is no evidence that the ratio is not 2 : 4 : 3
20 25.84 1.320
18 12.16 2.805 We have sufficient evidence to conclude
16 13.6 0.424 that There is an association between
4 6.4 0.900 the breed of goats and the milk yield
at = 0.05.
100 100 2cal = 6.744
18-4
9. The classification of 100 chickens
according to the breed and the Size of eggs Alternative : (With Yates Correction)
size of eggs produced are shown Small Large
in the contingency table.
A 42 18 ( Oij E ij 0.5)2
Bread
Test at the 5% significance level Oij Eij
E ij
whether there is a relationship between B 19 21 Since 2cal = 4.205 (> 3.841) Reject Ho
breed and the size of eggs produced. [8] 42 36.6 0.656
18 23.4 1.026 We have sufficient evidence to conclude
Ho : There is no relationship between breed and the size of eggs produced 19 24.4 0.984 that there is a relation between breed and
H1 : There is a relationship between breed and the size of eggs produced 21 15.6 1.539 the size of eggs produced at = 0.05.
100 100 2cal = 4.205
Milk yield
Total
S L
60 x 61 = 36.6
A
100 60 – E11 = 23.4 60
Breed
(Oij E ij )2
Oij Eij
E ij
Since 2cal = 5.107 (> 3.841) Reject Ho
42 36.6 0.797
18 23.4 1.246
19 24.4 1.195 We have sufficient evidence to conclude
21 15.6 1.869 that there is a relation between breed and
the size of eggs produced at = 0.05.
100 100 2cal = 5.107
18-5