SlideShare a Scribd company logo
THE CHI-SQUARE TEST
THE CHI-SQUARE TEST
BACKGROUND AND NEED OF THE TEST
BACKGROUND AND NEED OF THE TEST
Data collected in the field of
Data collected in the field of
medicine is often qualitative.
medicine is often qualitative.
--- For example, the presence or
--- For example, the presence or
absence of a symptom, classification
absence of a symptom, classification
of pregnancy as ‘high risk’ or ‘non-
of pregnancy as ‘high risk’ or ‘non-
high risk’, the degree of severity of a
high risk’, the degree of severity of a
disease (mild, moderate, severe)
disease (mild, moderate, severe)
The measure computed in each
The measure computed in each
instance is a proportion,
instance is a proportion,
corresponding to the mean in the case
corresponding to the mean in the case
of quantitative data such as height,
of quantitative data such as height,
weight, BMI, serum cholesterol.
weight, BMI, serum cholesterol.
Comparison between two or more
Comparison between two or more
proportions, and the test of
proportions, and the test of
significance employed for such
significance employed for such
purposes is called the “Chi-square
purposes is called the “Chi-square
test”
test”
---- KARL PEARSON IN 1889, DEVISED
---- KARL PEARSON IN 1889, DEVISED
AN INDEX OF DISPERSION OR TEST
AN INDEX OF DISPERSION OR TEST
CRITERIOR DENOTED AS “CHI-
CRITERIOR DENOTED AS “CHI-
SQUARE “. (
SQUARE “. (X
X 2 ).
).
The formula for
The formula for X
X 2 –test is,
–test is,
Chi- Square
Chi- Square
 
( o - e ) 2
e
X
X 2
=
=
reject
reject H
Ho
o if
if 
2
2
>
> 
2
2
.
.
,
,df
df
where df = (
where df = (r
r-1)(
-1)(c
c-1)
-1)

2
2
= ∑
= ∑
(
(O
O -
- E
E)
)2
2
E
E
3.
3. E is the expected frequency
E is the expected frequency
^
^
E
E =
=
^
^
(total of all cells)
(total of all cells)
total of row in
total of row in
which the cell lies
which the cell lies
total of column in
total of column in
which the cell lies
which the cell lies
•
•
1.
1. The summation is over all cells of the contingency
The summation is over all cells of the contingency
table consisting of r rows and c columns
table consisting of r rows and c columns
2.
2. O is the observed frequency
O is the observed frequency
4.
4. The degrees of freedom are df = (r-1)(c-1)
The degrees of freedom are df = (r-1)(c-1)
APPLICATION OF CHI-SQUARE
APPLICATION OF CHI-SQUARE
TEST
TEST
 TESTING INDEPENDCNE (OR
TESTING INDEPENDCNE (OR
ASSOCATION)
ASSOCATION)
 TESTING FOR HOMOGENEITY
TESTING FOR HOMOGENEITY
 TESTING OF GOODNESS-OF-
TESTING OF GOODNESS-OF-
FIT
FIT
Chi-square test
Chi-square test
Purpose
Purpose
To find out whether the association between two
To find out whether the association between two
categorical variables are statistically significant
categorical variables are statistically significant
Null Hypothesis
Null Hypothesis
There is no association between two variables
There is no association between two variables
Chi-square test
Chi-square test
 
  df
c
b
c
b
d
c
b
a
d
b
c
a
N
bc
ad
N
df
b
a
d
c
d
b
c
a
bc
ad
n
f
d
e
e
o
corrected
c
r
1
2
2
2
2
2
2
)
1
)(
1
(
2
2
~
1
~
)
)(
)(
)(
(
2
~
)
)(
)(
)(
(
)
(
.
~
1

























 

1.
2.
3.
4.
Test statistics
Test statistics
Chi-square test
Chi-square test
 Objective
Objective :
: Smoking is a risk factor for MI
Smoking is a risk factor for MI
 Null Hypothesis:
Null Hypothesis: Smoking does not cause MI
Smoking does not cause MI
D (MI) D-(No MI) Total
Smokers 29 21 50
Non-smokers 16 34 50
Total 45 55 100
Chi-Square
Chi-Square
E
O
29
E
O
21
E
O
16
E
O
34
MI Non-MI
Smoker
Non-Smoker
Chi-Square
Chi-Square
E
O
29
E
O
21
E
O
16
E
O
34
MI Non-MI
Smoker
Non-smoker
50
50
55
45 100
Estimating the Expected Frequencies
Estimating the Expected Frequencies
E
E =
=
^
^ (row total for this cell)•(column total for this cell)
(row total for this cell)•(column total for this cell)
n
n
Classification
Classification 1
1
Classification
Classification 2
2
1
1
2
2
3
3
4
4 c
c
r
r
1
1 2
2 3
3
C
C1
1 C
C2
2 C
C3
3 C
C4
4 C
Cc
c
R
R1
1
R
R2
2
R
R3
3
R
Rr
r
E
E =
=
^
^ R
R2
2C
C3
3
n
n
Chi-Square
Chi-Square
E
O
29
E
O
21
E
O
16
E
O
34
MI Non-MI
Smoker
Non-smoker
50
50
55
45 100
50 X 45
100
22.5 =
22.5
Chi-Square
Chi-Square
E
O
29
E
O
21
E
O
16
E
O
34
Alone Others
Males
Females
50
50
55
45 100
22.5 27.5
22.5 27.5
Chi-Square
Chi-Square
 Degrees of Freedom
Degrees of Freedom
df
df = (R-1) (C-1)
= (R-1) (C-1)
 Critical Value (Table A.6) = 3.84
Critical Value (Table A.6) = 3.84
 X
X2
2
= 6.84
= 6.84
THE CHI-SQUARE TEST IN DEPTH AND WITH EXAMPLES
Age
Age
Gender
Gender <30
<30 30-45
30-45 >45
>45 Total
Total
Male
Male 60 (60)
60 (60) 20 (30)
20 (30) 40 (30)
40 (30) 120
120
Female
Female 40 (40)
40 (40) 30 (20)
30 (20) 10 (20)
10 (20) 80
80
Total
Total 100
100 50
50 50
50 200
200
Chi- square test
Find out whether the sex is equally
distributed among each age group
Test for Homogeneity (Similarity)
Test for Homogeneity (Similarity)
To test similarity between frequency distribution or
To test similarity between frequency distribution or
group. It is used in assessing the similarity between
group. It is used in assessing the similarity between
non-responders and responders in any survey
non-responders and responders in any survey
Age (yrs) Responders Non-responders Total
<20 76 (82) 20 (14) 96
20 – 29 288 (289) 50 (49) 338
30-39 312 (310) 51 (53) 363
40-49 187 (185) 30 (32) 217
>50 77 (73) 9 (13) 86
Total 940 160 1100

More Related Content

PDF
7. Chi square test.pdf pharmaceutical biostatistics
PPTX
Parametric & non parametric
PDF
Chisquare Test of Association.pdf in biostatistics
PPT
Chi – square test
PPTX
Chi square test
PPTX
Chi sqyre test
PPTX
Chi square test final
7. Chi square test.pdf pharmaceutical biostatistics
Parametric & non parametric
Chisquare Test of Association.pdf in biostatistics
Chi – square test
Chi square test
Chi sqyre test
Chi square test final

Similar to THE CHI-SQUARE TEST IN DEPTH AND WITH EXAMPLES (20)

PPTX
Chi square
PPTX
Biostatistics- lesson is chapter-10.pptx
PPTX
Chi square test
PPTX
Chi squared test
PPT
chi-squaretest-170826142554.ppt
PPTX
Chi Squ.pptx.statisticcs.109876543210987
PPT
chi-squaretest-170826142554 (1).ppt
PPTX
Busniess stats
PPTX
CHI-SQUARE-TEST.pptx
PPTX
Lecture chi squire. For Postgraduate and Undergraduate
PPT
Chi-square IMP.ppt
PPTX
Chi-square test.pptx
PPTX
Tests of statistical significance : chi square and spss
PPTX
Chi squared test
PPTX
Chi -square test
PPTX
Chi square
PPT
Chi square test final presentation
PPTX
CHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptx
PPTX
Chi square test
PPTX
Chi-Square Test assignment Stat ppt.pptx
Chi square
Biostatistics- lesson is chapter-10.pptx
Chi square test
Chi squared test
chi-squaretest-170826142554.ppt
Chi Squ.pptx.statisticcs.109876543210987
chi-squaretest-170826142554 (1).ppt
Busniess stats
CHI-SQUARE-TEST.pptx
Lecture chi squire. For Postgraduate and Undergraduate
Chi-square IMP.ppt
Chi-square test.pptx
Tests of statistical significance : chi square and spss
Chi squared test
Chi -square test
Chi square
Chi square test final presentation
CHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptx
Chi square test
Chi-Square Test assignment Stat ppt.pptx
Ad

Recently uploaded (20)

DOCX
Business Management - unit 1 and 2
PPTX
Probability Distribution, binomial distribution, poisson distribution
PDF
Business model innovation report 2022.pdf
PDF
Power and position in leadershipDOC-20250808-WA0011..pdf
PDF
WRN_Investor_Presentation_August 2025.pdf
PPTX
Belch_12e_PPT_Ch18_Accessible_university.pptx
PDF
Ôn tập tiếng anh trong kinh doanh nâng cao
PDF
DOC-20250806-WA0002._20250806_112011_0000.pdf
PDF
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
PDF
Laughter Yoga Basic Learning Workshop Manual
PDF
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
PDF
Solara Labs: Empowering Health through Innovative Nutraceutical Solutions
PDF
IFRS Notes in your pocket for study all the time
PPTX
5 Stages of group development guide.pptx
PPTX
Lecture (1)-Introduction.pptx business communication
PDF
COST SHEET- Tender and Quotation unit 2.pdf
DOCX
unit 1 COST ACCOUNTING AND COST SHEET
PPTX
Principles of Marketing, Industrial, Consumers,
PPTX
New Microsoft PowerPoint Presentation - Copy.pptx
PDF
Chapter 5_Foreign Exchange Market in .pdf
Business Management - unit 1 and 2
Probability Distribution, binomial distribution, poisson distribution
Business model innovation report 2022.pdf
Power and position in leadershipDOC-20250808-WA0011..pdf
WRN_Investor_Presentation_August 2025.pdf
Belch_12e_PPT_Ch18_Accessible_university.pptx
Ôn tập tiếng anh trong kinh doanh nâng cao
DOC-20250806-WA0002._20250806_112011_0000.pdf
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
Laughter Yoga Basic Learning Workshop Manual
Katrina Stoneking: Shaking Up the Alcohol Beverage Industry
Solara Labs: Empowering Health through Innovative Nutraceutical Solutions
IFRS Notes in your pocket for study all the time
5 Stages of group development guide.pptx
Lecture (1)-Introduction.pptx business communication
COST SHEET- Tender and Quotation unit 2.pdf
unit 1 COST ACCOUNTING AND COST SHEET
Principles of Marketing, Industrial, Consumers,
New Microsoft PowerPoint Presentation - Copy.pptx
Chapter 5_Foreign Exchange Market in .pdf
Ad

THE CHI-SQUARE TEST IN DEPTH AND WITH EXAMPLES

  • 1. THE CHI-SQUARE TEST THE CHI-SQUARE TEST BACKGROUND AND NEED OF THE TEST BACKGROUND AND NEED OF THE TEST Data collected in the field of Data collected in the field of medicine is often qualitative. medicine is often qualitative. --- For example, the presence or --- For example, the presence or absence of a symptom, classification absence of a symptom, classification of pregnancy as ‘high risk’ or ‘non- of pregnancy as ‘high risk’ or ‘non- high risk’, the degree of severity of a high risk’, the degree of severity of a disease (mild, moderate, severe) disease (mild, moderate, severe)
  • 2. The measure computed in each The measure computed in each instance is a proportion, instance is a proportion, corresponding to the mean in the case corresponding to the mean in the case of quantitative data such as height, of quantitative data such as height, weight, BMI, serum cholesterol. weight, BMI, serum cholesterol. Comparison between two or more Comparison between two or more proportions, and the test of proportions, and the test of significance employed for such significance employed for such purposes is called the “Chi-square purposes is called the “Chi-square test” test”
  • 3. ---- KARL PEARSON IN 1889, DEVISED ---- KARL PEARSON IN 1889, DEVISED AN INDEX OF DISPERSION OR TEST AN INDEX OF DISPERSION OR TEST CRITERIOR DENOTED AS “CHI- CRITERIOR DENOTED AS “CHI- SQUARE “. ( SQUARE “. (X X 2 ). ). The formula for The formula for X X 2 –test is, –test is,
  • 4. Chi- Square Chi- Square   ( o - e ) 2 e X X 2 = =
  • 5. reject reject H Ho o if if  2 2 > >  2 2 . . , ,df df where df = ( where df = (r r-1)( -1)(c c-1) -1)  2 2 = ∑ = ∑ ( (O O - - E E) )2 2 E E 3. 3. E is the expected frequency E is the expected frequency ^ ^ E E = = ^ ^ (total of all cells) (total of all cells) total of row in total of row in which the cell lies which the cell lies total of column in total of column in which the cell lies which the cell lies • • 1. 1. The summation is over all cells of the contingency The summation is over all cells of the contingency table consisting of r rows and c columns table consisting of r rows and c columns 2. 2. O is the observed frequency O is the observed frequency 4. 4. The degrees of freedom are df = (r-1)(c-1) The degrees of freedom are df = (r-1)(c-1)
  • 6. APPLICATION OF CHI-SQUARE APPLICATION OF CHI-SQUARE TEST TEST  TESTING INDEPENDCNE (OR TESTING INDEPENDCNE (OR ASSOCATION) ASSOCATION)  TESTING FOR HOMOGENEITY TESTING FOR HOMOGENEITY  TESTING OF GOODNESS-OF- TESTING OF GOODNESS-OF- FIT FIT
  • 7. Chi-square test Chi-square test Purpose Purpose To find out whether the association between two To find out whether the association between two categorical variables are statistically significant categorical variables are statistically significant Null Hypothesis Null Hypothesis There is no association between two variables There is no association between two variables
  • 8. Chi-square test Chi-square test     df c b c b d c b a d b c a N bc ad N df b a d c d b c a bc ad n f d e e o corrected c r 1 2 2 2 2 2 2 ) 1 )( 1 ( 2 2 ~ 1 ~ ) )( )( )( ( 2 ~ ) )( )( )( ( ) ( . ~ 1                             1. 2. 3. 4. Test statistics Test statistics
  • 9. Chi-square test Chi-square test  Objective Objective : : Smoking is a risk factor for MI Smoking is a risk factor for MI  Null Hypothesis: Null Hypothesis: Smoking does not cause MI Smoking does not cause MI D (MI) D-(No MI) Total Smokers 29 21 50 Non-smokers 16 34 50 Total 45 55 100
  • 12. Estimating the Expected Frequencies Estimating the Expected Frequencies E E = = ^ ^ (row total for this cell)•(column total for this cell) (row total for this cell)•(column total for this cell) n n Classification Classification 1 1 Classification Classification 2 2 1 1 2 2 3 3 4 4 c c r r 1 1 2 2 3 3 C C1 1 C C2 2 C C3 3 C C4 4 C Cc c R R1 1 R R2 2 R R3 3 R Rr r E E = = ^ ^ R R2 2C C3 3 n n
  • 15. Chi-Square Chi-Square  Degrees of Freedom Degrees of Freedom df df = (R-1) (C-1) = (R-1) (C-1)  Critical Value (Table A.6) = 3.84 Critical Value (Table A.6) = 3.84  X X2 2 = 6.84 = 6.84
  • 17. Age Age Gender Gender <30 <30 30-45 30-45 >45 >45 Total Total Male Male 60 (60) 60 (60) 20 (30) 20 (30) 40 (30) 40 (30) 120 120 Female Female 40 (40) 40 (40) 30 (20) 30 (20) 10 (20) 10 (20) 80 80 Total Total 100 100 50 50 50 50 200 200 Chi- square test Find out whether the sex is equally distributed among each age group
  • 18. Test for Homogeneity (Similarity) Test for Homogeneity (Similarity) To test similarity between frequency distribution or To test similarity between frequency distribution or group. It is used in assessing the similarity between group. It is used in assessing the similarity between non-responders and responders in any survey non-responders and responders in any survey Age (yrs) Responders Non-responders Total <20 76 (82) 20 (14) 96 20 – 29 288 (289) 50 (49) 338 30-39 312 (310) 51 (53) 363 40-49 187 (185) 30 (32) 217 >50 77 (73) 9 (13) 86 Total 940 160 1100