0% found this document useful (0 votes)
12 views5 pages

Contingency-Table

The document explains the concept of a contingency table, which compares two variables by organizing data into rows and columns to identify potential correlations. It details how to perform a Pearson’s Chi-squared test to determine the significance of the data, including steps for calculating expected values and test statistics. Additionally, it provides examples and activities related to analyzing the relationship between gender and political party preference, as well as smoking status and lung cancer incidence.

Uploaded by

a21-0531-548
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

Contingency-Table

The document explains the concept of a contingency table, which compares two variables by organizing data into rows and columns to identify potential correlations. It details how to perform a Pearson’s Chi-squared test to determine the significance of the data, including steps for calculating expected values and test statistics. Additionally, it provides examples and activities related to analyzing the relationship between gender and political party preference, as well as smoking status and lung cancer incidence.

Uploaded by

a21-0531-548
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Contingency Table

OBJECTIVE:
At the end of the lesson the student shall be
- able to understand what contingency
table is.

Contingency table data that compares 2 variables


-one data set is populated in rows, while the other data
Is populated in columns, the values of the cells where
rows and columns intersect can suggest whether
or not the 2 sets are correlated.
Use it would encompass anything that compares 2 data
sets.
For example a contingency table could offer a
comparison of gender and preferred cell phone
brand.
Example of a contingency able
Count
Gen der
Men Women Total
College Major
Humanities 4 10 14
Nat. Science 11 10 21
Social Scxience 8 14 22
Total 23 34 57
Pearson’s Chi-squared test can give the significance of
the data in a contingency table.
- is used to test hypothes
- it compares the size of any discrepancies between
the expected results and the actual results, given
the size of the sample and the number of variables in
the relationship.
Formula:
X2c = ∑(Oi –Ei)2 / Ei

Where: c= degree of freedom


O= observe value
E= expected value
Example:
Let us know if gender has anything to do with
Political party preference. There are 440 voters in
a simple random sample to determine their preferred
Political party. The survey shows.
Republican Democrat Independent Total
Male 100 70 30 200
Female 140 60 20 220
Total 240 130 50 440
To see if gender is linked to political party preference.
Steps:
1. Define hypothesis
Ho: There is a link between gender and political
Party preference.
2. Calculate the expected values
Expected value = (row total)x(column total)
____________________
Total no of observations
=(240X200)/440
=109
Expected value = (240X220)/440= 120
Expected value = (240X440)/440 = 240

Expected values
Republican Democrat Independent Total
Male 109 59 22.72 200
Female 120 65 25 220
Total 240 130 50 440

3. Calculate (O-E)2 /E for each cell in the table


Republican Democrat Independent Total
Male 0.74311927 2.050847 2.332676056 200
Female 3.33333333 0.384615 1 220
Total 240 130 50 440

4. Calculate test statistics X2


X2 is the sum of all the values in the last table
= 0.743 + 2.05 + 2.33 + 3.33 + 0.384 + 1
= 9.837
Get the degrees of freedom
= table’s no. of columns -1 multiplied by the
Table’s no. of rows – 1 or (c-1)(r-1)
= (3-1)(2-1) =2
Compare the obtained statistics to the critical ones
In the Chi-square table, for a confidence level of
0.05 and 2 degrees of freedom the critical
Statistic is 5.991, less than our obtained 9.83.
You can reject the null hypothesis because
the critical statistic is higher than your obtained
Statistic, this means there is an association between
gender and political preference.
Activity
1. A medical study examine thes the association between
smoking status (smoker, non-smoker) and the
Occurrence of lung canser disease(yes,no) The
Information is as follows:
Smoker yes 90, No 60
Non-smoker yes 30 No 60
Find out if smoking status is related to the incidence of
lung disease do a Chi-square test.
2. A company surveys customers to determine their
age group(under 20, 20-40, over 40) and preferred
product.Categories (food, apparel or electronics)
The info gathered is under 20 Electronic-50,
Clothing-30, food 20, 20-40 Electronics-30, clothing-40,
Food-80

You might also like