<<

11-3 Contingency Tables Basic Concepts of Testing for Independence In this section we consider contingency tables (or two-way tables), which include frequency counts for A contingency table (or two-way frequency table) is a table in categorical arranged in a table with a least two rows and which frequencies correspond to two variables. at least two columns.

(One variable is used to categorize rows, and a second We present a method for testing the claim that the row and variable is used to categorize columns.) column variables are independent of each other.

Contingency tables have at least two rows and at least two columns.

11

Example Definition

Below is a contingency table summarizing the results of foot procedures as a success or failure based different treatments. Test of Independence

A test of independence tests the null hypothesis that in a contingency table, the row and column variables are independent. Notation Hypotheses and Test

O represents the observed frequency in a cell of a H0 : The row and column variables are independent. contingency table. H1 : The row and column variables are dependent. E represents the expected frequency in a cell, found by assuming that the row and column variables are ()OE− 2 independent χ 2 = ∑ r represents the number of rows in a contingency table (not E including labels). (row total)(column total) c represents the number of columns in a contingency table E = (not including labels). (grand total)

O is the observed frequency in a cell and E is the expected frequency in a cell.

22

Critical Values Expected Frequencies Referring back to slide 3, the observed frequency is 54 successful surgeries. Critical Values 1. Found in Table A-4 using The expected frequency is calculated using the first row total of 66, the first column total of 182, and the grand degrees of freedom = (r –1)(c –1) total of 253. r is the number of rows and c is the number of columns (row total)(column total) E = 2. Tests of Independence are always right-tailed. (grand total) ()()66 182 ==47.478 ()253 Example Example - Continued Does it appear that the choice of treatment affects the Requirement Check: success of the treatment for the foot procedures? 1. Based on the study, we will treat the subjects as Use a 0.05 level of significance to test the claim that being randomly selected and randomly assigned to success is independent of treatment group. the different treatment groups. 2. The results are expressed in frequency counts. 3. The expected frequencies are all over 5.

The requirements are all satisfied.

33

Example - Continued Example - Continued The hypotheses are: We use a χ2 distribution with this :

H : Success is independent of the treatment. 22 2 0 (OE−−) (54 47.478) ( 5 − 6.174) χ 2 ==∑ ++" H1 : Success and the treatment are dependent. E 47.478 6.174

= 58.393 The significance level is α = 0.05. Example - Continued Example - Continued

Critical Value: The critical value of χ2 = 7.815 is found in Table A-4 with α = 0.05 and degrees of freedom of

Because the test statistic does fall in the critical region, we reject the null hypothesis.

()()()rc−−=−−=1 1 4121( ) 3

A graphic of the chi-square distribution is on the next slide.

44

Relationships Among Key Components Example - Continued in Test of Independence Interpretation:

It appears that success is dependent on the treatment.

Although this test does not tell us which treatment is best, we can see that the success rates of 81.8%, 44.6%, 95.9%, and 77.3% suggest that the best treatment is to use a non-weight-bearing cast for 6 weeks.