16
11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data arranged in a table with a least two rows and at least two columns. We present a method for testing the claim that the row and column variables are independent of each other.

11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Embed Size (px)

Citation preview

Page 1: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

11-3 Contingency Tables

In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data arranged in a table with a least two rows and at least two columns.

We present a method for testing the claim that the row and column variables are independent of each other.

Page 2: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

A contingency table (or two-way frequency table) is a table in which frequencies correspond to two variables.

(One variable is used to categorize rows, and a second variable is used to categorize columns.)

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

Basic Concepts of Testing for Independence

Page 3: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

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

Example

Page 4: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Test of Independence

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

Definition

Page 5: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Notation

O represents the observed frequency in a cell of a contingency table.

E represents the expected frequency in a cell, found by assuming that the row and column variables are independent

r represents the number of rows in a contingency table (not including labels).

c represents the number of columns in a contingency table (not including labels).

Page 6: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Hypotheses and Test Statistic

0

1

: The row and column variables are independent.

: The row and column variables are dependent.

H

H

22 ( )O E

E

(row total)(column total)

(grand total)E

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

Page 7: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Critical Values

Critical Values

1. Found in Table A-4 using

degrees of freedom = (r – 1)(c – 1)

r is the number of rows and c is the number of columns

2. Tests of Independence are always right-tailed.

Page 8: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Expected FrequenciesReferring back to slide 3, the observed frequency is 54 successful surgeries.

The expected frequency is calculated using the first row total of 66, the first column total of 182, and the grand total of 253.

(row total)(column total)

(grand total)

66 18247.478

253

E

Page 9: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

ExampleDoes it appear that the choice of treatment affects the success of the treatment for the foot procedures?

Use a 0.05 level of significance to test the claim that success is independent of treatment group.

Page 10: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Example - ContinuedRequirement Check:

1.Based on the study, we will treat the subjects as being randomly selected and randomly assigned to 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.

Page 11: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Example - ContinuedThe hypotheses are:

The significance level is α = 0.05.

0

1

: Success is independent of the treatment.

: Success and the treatment are dependent.

H

H

Page 12: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Example - ContinuedWe use a χ2 distribution with this test statistic:

2 2 2

2 54 47.478 5 6.174

47.478 6.174

58.393

O E

E

Page 13: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

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.

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

1 1 4 1 2 1 3r c

Page 14: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Example - Continued

Page 15: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Example - ContinuedInterpretation:

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.

Page 16: 11-3 Contingency Tables In this section we consider contingency tables (or two-way frequency tables), which include frequency counts for categorical data

Relationships Among Key Components in Test of Independence