Professional Documents
Culture Documents
DR. Waqar Al - Kubaisy
DR. Waqar Al - Kubaisy
DR. Waqar Al - Kubaisy
Waqar Al – Kubaisy
10/07/2020 1
Chi Square (χ ) test2
10/07/2020 2
SPECIFIC LEARNING OUTCOMES
On completion of this lecture, you should be able to:
1.Explain the basis for the use of Chi square tests on qualitative data
2.Explain the limitations of the Chi square tests
3.Carry out the Chi square tests
4.Interpret the findings from the Chi square tests of significance
5.Interpret degrees of freedom and critical values of Chi square
statistics from Chi square table
CONTENTS
6.Explanation of the basis for the use of Chi square tests on
qualitative data
7.Explanation of the limitations of the Chi square tests
8.Calculation of Chi square
9.Chi square table
10.Interpretation of the findings from the Chi square tests of
significance
An important thing is the type of the variable concerned. 3
10/07/2020
Data
Discrete Variable Continuous Variable
succeeded
Baghdad 180
Mu’tah 170
Syria 175
UiTM 200
10/07/2020 6
total succeeded E
Baghdad 210 185 189
Mu’tah 182 170
Syria 200 178 163.8
Total 592 533 180
10/07/2020 7
t test have been applied to test significance difference between two
means when the data measurement is continuous .
10/07/2020 11
When measuremen
When measurement is
merely the presence or absence of certain condition,
Х Absolute No
Proportion
10/07/2020 13
The data consist of counting No. in each sample or group
The data consist of proportion of individuals
in each group or sample,
So
statistical inference are made in term of proportions
While statistical inference in continuous data are
made in term of mean .
10/07/2020 14
Chi square (χ2)
It is the sum of the squared difference between the
observed(O) frequency and expected(E) frequency, divided
by the expected frequency .
(O E ) 2
2
E
Usually summation So
(O E ) 2
????????
cause could be
??????
An important thing is the type of the variable concerned.
10/07/2020 18
♂ ♀ total
succeeded 87.5% 70 75% 90 160
80%
not succeeded 12.5% 10 25% 30 40
Total 80 120 200
10/07/2020 19
expected (E)
♂ 80X.8= 80X.2 =
♀ 120X.8= 120X.2=
♂ ♀ total
O E O E
succeeded 70 64 90 96 160
not succeeded 16 10 30 40
24
Total 80 120 200
2
(observed – Expected) / Expected
10/07/2020 20
♂ ♀ total
O E O E
2
70 64 90 96 160
(observed – Expected) / Expected succeeded
not succeeded 16 10 30 40
for each cell 24
Total 80 120 200
X² =(70-64)²/64+(90-96)²/96+(30-24)²/24+(10-16)²/16
=36/64+36/96+36/24+36/16
= 0.563+.375+1.5+2.25
= 4.688
10/07/2020 21
Chi square test denoted X² This has two common applications:
first as test
whether two categorical variables are
independent or not;
second as a test of
whether two proportions are equal or not
with
the rows represent categories of one variable and
the columns categories of a second variable.
♂ ♀ total
The null hypothesis succeeded 70 90 160
is that the two variables are not 10 30 40
unrelated succeeded
Total 80 120 200
10/07/2020 23
♂ ♀ total
succeeded 87.5% 70 75% 90 160
80%
not succeeded 12.5% 10 25% 30 40
Total 80 120 200
10/07/2020 24
expected (E)
♂ 80X.8= 80X.2 =
♀ 120X.8= 120X.2=
♂ ♀ total
O E O E
succeeded 70 64 90 96 160
not succeeded 16 10 30 40
24
Total 80 120 200
2
(observed – Expected) / Expected
10/07/2020 25
2 ♂ ♀ total
O E O E
(observed – Expected) / Expected succeeded 70 64 90 96 160
for each cell not succeeded 16 10 30 40
24
Total 80 120 200
X² =(70-64)²/64+(90-96)²/96+(30-24)²/24+(10-16)²/16
=36/64+36/96+36/24+36/16
= 0.563+.375+1.5+2.25
= 4.688 ( calculated X², computed X² )
10/07/2020 26
Table of Chi-square statistics
df P =0.05 P = 0.01 P = 0.001 21 32.67 38.93 46.80
1 3.84 6.64 10.83 22 33.92 40.29 48.27
2 5.99 9.21 13.82 23 35.17 41.64 49.73
3 7.82 11.35 16.27 24 36.42 42.98 51.18
4 9.49 13.28 18.47 25 37.65 44.31 52.62
5 11.07 15.09 20.52 26 38.89 45.64 54.05
6 12.59 16.81 22.46
27 40.11 46.96 55.48
7 14.07 18.48 24.32
28 41.34 48.28 56.89
8 15.51 20.09 26.13
29 42.56 49.59 58.30
9 16.92 21.67 27.88
30 43.77 50.89 59.70
10 18.31 23.21 29.59
11 19.68 24.73 31.26 31 44.99 52.19 61.10
12 21.03 26.22 32.91 32 46.19 53.49 62.49
13 22.36 27.69 34.53 33 47.40 54.78 63.87
14 23.69 29.14 36.12 34 48.60 56.06 65.25
15 25.00 30.58 37.70 35 49.80 57.34 66.62
16 26.30 32.00 39.25 36 51.00 58.62 67.99
17 27.59 33.41 40.79
37 52.19 59.89 69.35
18 28.87 34.81 42.31
38 53.38 61.16 70.71
19 30.14 36.19 43.82 40 55.76 63.69 73.41
10/07/2020 39 54.57 62.43 72.06 27
20 31.41 37.57 45.32
So if the
actual No. of subject (observed) with condition ( O )
is close to the expected No. (E)
then the Ho will be not rejected ( )
This mean that P = Po .
Usually summation OE
O E Zero So
E Zero
To overcome this result, we. have to
square O-E make it as (O-E)²
then divided by E for each cell .
(O E ) 2
E
10/07/2020 28
(O E ) 2
2
(O E ) 2
2 sign. Difference in proportion
E
10/07/2020 30
Chi square is
used in testing difference in proportions
while t test is used in testing difference in means .
Ho P1 P2 P0
H A P1 P2 P0
Chi square (χ2)
It is the sum of the squared difference between the observed
frequency and expected frequency, divided by the expected
frequency .
(O E ) 2
2 Comparing calculated χ2 with
E tabulated χ2
in relation to critical region .
10/07/2020 31
If the variables display are Exposure and outcome.
Then
we usually we arrange the table with
exposure as the row variable and
out come as the column variable .
and display % corresponding the exposure variable
total small birth weight -ve small birth weight +ve smoker
160 60 100) 62.5%( 53 yes
300 250 50 ) 16.7( 99 no
460 310 150 Total
Example
460 pregnant women divided into two groups, 160 smoker and
300 non smoked during pregnancy, 100 smoker women, were
born small weight babies while the non smokers, born 50 small
birth weight babies
10/07/2020 33
Data
Qualitative data consist of sample of 460 pregnant women divided into two
groups, 160 smoker and 300 non smoked during pregnancy, 100 smoker
women, were born small weight babies while the non smokers, born 50
small birth weight babies
Assumption
Two independent group of pregnant women chosen randomly from normal
distribution population .
Formulation of Hypothesis
Ho
There is no significance difference in the proportion (rate) of small birth
weight babies between two groups .
Group smoker women 62.5% &
Group non smoker women 16.7%
There is no significance association between small birth weight babies And
smoking .
P1 = P2 = P0 .
HA
There is a significance difference in the low birth weight rate
between two groups of women
P1¬ ≠ P2 ≠ P0 .
low birth weight rate is higher among smokers
Critical region
Level of significance
0.95, α = 0.05
d.F = (No. of rows – 1) (No. of column – 1) = (r – 1) (c – 1)
= (2 – 1) (2 – 1) = 1
Proper test
total small birth small birth smoker
0.33=150/460 weight -ve weight +ve
0.33x160=52.8 160 60 ) 62.5%( 53 yes
0.33X300=99 100
Conclusion-????????
Decision ???????? P = 0.001
P= ?????????
10.83
Table of Chi-square statistics
df P =0.05 P = 0.01 P = 0.001 21 32.67 38.93 46.80
1 3.84 6.64 10.83 22 33.92 40.29 48.27
2 5.99 9.21 13.82 23 35.17 41.64 49.73
3 7.82 11.35 16.27 24 36.42 42.98 51.18
4 9.49 13.28 18.47 25 37.65 44.31 52.62
5 11.07 15.09 20.52 26 38.89 45.64 54.05
6 12.59 16.81 22.46
27 40.11 46.96 55.48
7 14.07 18.48 24.32
28 41.34 48.28 56.89
8 15.51 20.09 26.13
29 42.56 49.59 58.30
9 16.92 21.67 27.88
30 43.77 50.89 59.70
10 18.31 23.21 29.59
11 19.68 24.73 31.26 31 44.99 52.19 61.10
12 21.03 26.22 32.91 32 46.19 53.49 62.49
13 22.36 27.69 34.53 33 47.40 54.78 63.87
14 23.69 29.14 36.12 34 48.60 56.06 65.25
15 25.00 30.58 37.70 35 49.80 57.34 66.62
16 26.30 32.00 39.25 36 51.00 58.62 67.99
17 27.59 33.41 40.79
37 52.19 59.89 69.35
18 28.87 34.81 42.31
38 53.38 61.16 70.71
19 30.14 36.19 43.82 40 55.76 63.69 73.41
10/07/2020 39 54.57 62.43 72.06 37
20 31.41 37.57 45.32
41 56.94 64.95 74.75
61 80.23 89.59 100.88
42 58.12 66.21 76.09
62 81.38 90.80 102.15
43 59.30 67.46 77.42
63 82.53 92.01 103.46
44 60.48 68.71 78.75
64 83.68 93.22 104.72
45 61.66 69.96 80.08 65 84.82 94.42 105.97
46 62.83 71.20 81.40 66 85.97 95.63 107.26
47 64.00 72.44 82.72 67 87.11 96.83 108.54
48 65.17 73.68 84.03 68 88.25 98.03 109.79
(O E ) 2
2
E
10/07/2020 42