You are on page 1of 5

9.

2 Contingency Tables
Remark 9.2.1: Last time, we considered multinomial experiments where each trial was inde-
pendent. The outcome of each trial was then placed into placed into one of k distinct categories.
However, it's a common concern when classifying data based on two criteria, whether those
categories are independent of one another.

Denition 9.2.2: Contingency Table


A contingency table is a cross tabulation of data in which the data of one variable is
distributed in columns and the data of another variable is distributed in rows. The table is
used to study the relationship between the two variables

XX
XXX Column
XX 1 2 ... c Row Totals
Row XXX
X
1 n11 n12 ... n1c R1
2 n21 n22 ... n2c R2
. . . . . .
. . . . . .
. . . . . .

r nr1 nr2 ... nrc Rr


Column Totals C1 C2 ... Cc n
Denition 9.2.3: Expected Cell Counts for Contingency Tables
The estimate of the expected number of observations falling into the cell in row i and column
j is given by
Ri Cj
Êij = ,
n
where

ˆ Ri is the total for row i,

ˆ Cj is the total for column j,

ˆ n is the sample size.

Properties 9.2.4 Hypothesis Testing for Testing Independence with Contingency


Tables
1. Hypotheses

ˆ H0 : The two classications are independent

ˆ H1 : The two classications are dependent

X (nij − Êij )2 Ri Cj
2. Test Statistic: χ2c = , where Êij = .
Êij n

3. Critical region: χ2c > χ2α where χ2α has (r − 1)(c − 1) degrees of freedom.

4. p − value : P (χ2 > χ2c )

Properties 9.2.5 Required Conditions for a Valid χ2 Contingency Table Test


1. The n observed counts are a random sample from the population of interest. We can
consider this to be a multinomial experiment with r×c possible outcomes.

2. The sample size n will be large enough so that, for every cell, the expected count
Ê(nij needs to be 5 or more. This ensures an accurate χ2 approximation.
Example 9.2.6: A survey was conducted to evaluate the eectiveness of a new u vaccine that

had been administered in a small community. The vaccine was provided free of charge in a two-
shot sequence over a period of 2 weeks to those wishing to avail themselves of it. Some people
received the two-shot sequence, some appeared only for the rst shot, and the others received
neither. A survey of n = 1000 local residents in the following spring provided the information
shown in the table below.
XX
XXX Shot Type
XXX No Vaccine One Shot Two Shot Row Totals
Status XXX
Flu 24 9 13 46

No u 289 100 565 954

Column Totals 313 109 578 1000

Is there sucient evidence to indicate a dependence between the two classications  the
vaccine category and the occurrence or nonoccurrence of the u? Use α = 0.05.
Example 9.2.7: The results of a study suggest that the initial electrocardiogram (ECG) of a

suspected heart attack victim can be used to predict in-hospital complications of an acute nature.
The study included n = 469 patients with suspected myocardial infarction (heart attack). Each
patient was categorized according to whether their initial ECG was positive or negative and
whether the person suered life-threatening complications subsequently in the hospital. The
results are summarized in the following table.
hhhh
hhComplications
hhh
hhhh No Yes Row Totals
Initial ECG hhh h
Negative 166 1 167

Positive 260 42 302

Column Totals 426 43 469

Is there sucient evidence to indicate that whether or not a heart attack patient suers compli-
cations depends on the outcome of the initial ECG? Test using α = 0.05.
Example 9.2.8: A survey of voter sentiment was conducted in four midcity political wards to

compare the fraction of voters favoring candidate A. Random samples of 200 voters were polled
in each of the four wards, with results as shown in the table below.

XX
XXX Ward
XXX 1 2 3 4 Row Totals
Opinion XXX
Favor 76 53 59 48 236

Don't favor 124 147 141 152 564

Column Totals 200 200 200 200 800

Is there sucient evidence to indicate that the fractions of voters favoring candidate A dier in
the four wards? Use α = 0.05.

You might also like