Lesson-2 1
Lesson-2 1
College of Science
Department of Mathematics and Statistics
CATEGORICAL DATA
ANALYSIS
Prepared by:
Ms. Katrina D. Elizon
Contingency Tables
A 2−way contingency table a.k.a. cross-tabulation
is simply a two-way array containing the joint
distribution of two categorical random variables.
∑
πi,j = 1
Heart Attack
Group Total
Yes No
Placebo
Aspirin
Total
Independence
Heart Attack
Group Total
Yes No
Placebo 179 10,843 11,022
Aspirin 105 10,932 11,037
Total 284 21,775 22,059
Table 2
Group
Group Total
Placebo Aspirin
Yes 179 105 284
No 10,843 10,932 21,775
Total 11,022 11,037 22,059
Question???
Calculate the odds ratio for table 1, and try to
reverse the order of the row or the order of the
column. What did you notice when we compared
the odds ratio to the previous result?
Table 1
Heart Attack
Group Total
Yes No
Placebo 179 10,843 11,022
Aspirin 105 10,932 11,037
Total 284 21,775 22,059
Several ways to compare probabilities in a table:
3. Odds Ratio
When both variables are response variables, the
odds ratio can be de ned using joint probabilities as
π11 /π12 π11π22
θ= =
π21 /π22 π12π21
The odds ratio is also called the cross-product
ratio, because it equals the ratio of the products
π11π22 a n d π12π21 o f c e l l p ro b a b i l i t i e s f ro m
diagonally opposite cells.
fi
Several ways to compare probabilities in a table:
3. Odds Ratio
The sample version of θ replaces πij ’s by pij ’s, or,
equivalently by nij’s: