Chi square testChi square test
Uses and ApplicationsUses and Applications
 Used when you have frequencyUsed when you have frequency
distribution of qualitative type of variables.distribution of qualitative type of variables.
 Applications:Applications:
 To test goodness of fit.To test goodness of fit.
 In the 2X2 table, it is used to test whetherIn the 2X2 table, it is used to test whether
there is anthere is an associationassociation between the rowbetween the row
and the column variables; ie whether theand the column variables; ie whether the
distribution of individuals among thedistribution of individuals among the
categories of one variable iscategories of one variable is
independentindependent of their distribution amongof their distribution among
the categories of the other.the categories of the other.
Example, Influenza vaccination trialExample, Influenza vaccination trial
InfluenzaInfluenza NoNo
influenzainfluenza
TotalTotal
VaccineVaccine 2020
(8.3%)(8.3%)
220220 240240
PlaceboPlacebo 8080
(36.4%)(36.4%)
140140 220220
TotalTotal 100100
(21.7%)(21.7%)
360360 460460
The question is:The question is:
 Is the difference (in the percentages ofIs the difference (in the percentages of
influenza) due to vaccination or occurredinfluenza) due to vaccination or occurred
by chance?by chance?
 To answer, a Chi square test is doneTo answer, a Chi square test is done
which compares the observed numbers inwhich compares the observed numbers in
each of the four categories in theeach of the four categories in the
contingency table with the numbers to becontingency table with the numbers to be
expected if there was no difference in theexpected if there was no difference in the
effectiveness between the vaccine andeffectiveness between the vaccine and
placebo.placebo.
The expected frequencies:The expected frequencies:
InfluenzaInfluenza NoNo
influenzainfluenza
TotalTotal
VaccineVaccine 52.252.2 187.8187.8 240240
PlaceboPlacebo 47.847.8 172.2172.2 220220
TotalTotal 100100 360360 460460
Solution, continuedSolution, continued
 Ho: The proportion of influenza among the vaccineHo: The proportion of influenza among the vaccine
group = The proportion of influenza among thegroup = The proportion of influenza among the
placebo group.placebo group.
 Level of significance (alpha) = 0.05Level of significance (alpha) = 0.05
 D.f. = (No. of rows-1) (No. of columns-1).D.f. = (No. of rows-1) (No. of columns-1).
 Test statistics: Chi square test.Test statistics: Chi square test.
E
EO 2
2 )( −∑
=χ
Solution, continuedSolution, continued
09.53
2.172
)2.172140(
8.187
)8.187220(
8.47
)8.4780(
2.52
)2.5220( 2222
2
=
−
+
−
+
−
+
−
=χ
The tabulated value for X2
for 1 d.f. is 3.841
The calculated value (53.09) > tabulated value
Therefore reject Ho and conclude that there is statistically
significant difference between the 2 proportions. This
difference is unlikely to be due to chance.
Therefore the vaccine is effective.
P < 0.05
Stat6 chi square test

Stat6 chi square test

  • 1.
    Chi square testChisquare test
  • 2.
    Uses and ApplicationsUsesand Applications  Used when you have frequencyUsed when you have frequency distribution of qualitative type of variables.distribution of qualitative type of variables.  Applications:Applications:  To test goodness of fit.To test goodness of fit.  In the 2X2 table, it is used to test whetherIn the 2X2 table, it is used to test whether there is anthere is an associationassociation between the rowbetween the row and the column variables; ie whether theand the column variables; ie whether the distribution of individuals among thedistribution of individuals among the categories of one variable iscategories of one variable is independentindependent of their distribution amongof their distribution among the categories of the other.the categories of the other.
  • 3.
    Example, Influenza vaccinationtrialExample, Influenza vaccination trial InfluenzaInfluenza NoNo influenzainfluenza TotalTotal VaccineVaccine 2020 (8.3%)(8.3%) 220220 240240 PlaceboPlacebo 8080 (36.4%)(36.4%) 140140 220220 TotalTotal 100100 (21.7%)(21.7%) 360360 460460
  • 4.
    The question is:Thequestion is:  Is the difference (in the percentages ofIs the difference (in the percentages of influenza) due to vaccination or occurredinfluenza) due to vaccination or occurred by chance?by chance?  To answer, a Chi square test is doneTo answer, a Chi square test is done which compares the observed numbers inwhich compares the observed numbers in each of the four categories in theeach of the four categories in the contingency table with the numbers to becontingency table with the numbers to be expected if there was no difference in theexpected if there was no difference in the effectiveness between the vaccine andeffectiveness between the vaccine and placebo.placebo.
  • 5.
    The expected frequencies:Theexpected frequencies: InfluenzaInfluenza NoNo influenzainfluenza TotalTotal VaccineVaccine 52.252.2 187.8187.8 240240 PlaceboPlacebo 47.847.8 172.2172.2 220220 TotalTotal 100100 360360 460460
  • 6.
    Solution, continuedSolution, continued Ho: The proportion of influenza among the vaccineHo: The proportion of influenza among the vaccine group = The proportion of influenza among thegroup = The proportion of influenza among the placebo group.placebo group.  Level of significance (alpha) = 0.05Level of significance (alpha) = 0.05  D.f. = (No. of rows-1) (No. of columns-1).D.f. = (No. of rows-1) (No. of columns-1).  Test statistics: Chi square test.Test statistics: Chi square test. E EO 2 2 )( −∑ =χ
  • 7.
    Solution, continuedSolution, continued 09.53 2.172 )2.172140( 8.187 )8.187220( 8.47 )8.4780( 2.52 )2.5220(2222 2 = − + − + − + − =χ The tabulated value for X2 for 1 d.f. is 3.841 The calculated value (53.09) > tabulated value Therefore reject Ho and conclude that there is statistically significant difference between the 2 proportions. This difference is unlikely to be due to chance. Therefore the vaccine is effective. P < 0.05