stat6 chi square test
TRANSCRIPT
Chi square testChi square test
Uses and ApplicationsUses and Applications
Used when you have frequency Used 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 whether In the 2X2 table, it is used to test whether
there is an there is an associationassociation between the row between the row and the column variables; ie whether the and the column variables; ie whether the distribution of individuals among the distribution of individuals among the categories of one variable is categories of one variable is independentindependent of their distribution among of their distribution among the categories of the other. the categories of the other.
Example, Influenza vaccination trialExample, Influenza vaccination trial
InfluenzaInfluenza No No 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 of Is the difference (in the percentages of
influenza) due to vaccination or occurred influenza) due to vaccination or occurred by chance?by chance?
To answer, a Chi square test is done To answer, a Chi square test is done which compares the observed numbers in which compares the observed numbers in each of the four categories in the each of the four categories in the contingency table with the numbers to be contingency table with the numbers to be expected if there was no difference in the expected if there was no difference in the effectiveness between the vaccine and effectiveness between the vaccine and placebo.placebo.
The expected frequencies:The expected frequencies:
InfluenzaInfluenza No No 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 vaccine Ho: The proportion of influenza among the vaccine group = The proportion of influenza among the group = 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 22 )( −∑=χ
Solution, continuedSolution, continued
09.532.172
)2.172140(
8.187
)8.187220(
8.47
)8.4780(
2.52
)2.5220( 22222 =−+−+−+−=χ
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