Professional Documents
Culture Documents
PSM 201 The Chi Square Test
PSM 201 The Chi Square Test
PSM 201 The Chi Square Test
BY
BABATUNDE ADEDOKUN
MBBS; MSc Epid & Med Stat (Ib.)
The Chi square test
• Significance test for testing the association
between two categorical variables
• Equivalent to a comparison of proportions
• Data usually presented in contingency tables
where the variables are cross classified
• It compares observed frequencies with the
frequencies expected assuming there was no
association between the variables i.e. under
the null hypothesis assumption
Cross-tabulations
• Categorical variables are cross classified in tables known
as contingency tables
• Horizontal panels are known as rows while the vertical
panels are called columns
• The space formed by the intersections between the row
and column is called the cell
• A contingency table is named according to the number
of categories of the row variable by that of the column
variable
• A table with an independent variable with 5 categories
and the dependent variable with 3 categories is a 5 by 3
table
Cross-tabulations 2
• Often, there is a dependency in the relationship
between two variables
– Smoking (independent variable) could influence the
risk of lung cancer (dependent variable)
– Maternal education (independent variable) affects
breastfeeding practice (dependent variable) or
utilization of antenatal care (dependent variable)
• Conventionally, the dependent variable is inserted
on top (column variable) while the independent
variable is placed at the side (row variable)
Some rules for tables
• Proper title (study population, time and place)
• Avoid overcrowding with too many variables
• Percentages should be reported along with frequencies
• Conventionally independent variables are placed in rows
and the dependent in the column section
• Some tables may not be necessary (simply describe)
• Do not present same information in table and chart at
same time
• With the independent variable in the row, percentages
should add up to 100% in the direction of the row
The chi-square test
Χ2 = Σ[(Oi-Ei)2/Ei]
where:
Oi = Observed frequencies
Ei = Expected frequencies if the null hypothesis were
true
d.f. = (r-1)x (c-1)
The chi-square test –an example
• 14 out of 60 pts seen in a PHC in a community had IBS and 4 out of 50 pts
seen in another community had IBS. Does the data suggest any association
between IBS and location.
• Solution
– Identify the independent and dependent variables
– Present data in a contingency table
Region IBS
Yes No Total
Comm 1 14 46 60
Comm 2 4 46 50
Total 18 92 110
Yes No Total
Total 18 92 110
so we reject H0