Skip to main content
Back

Chi-Square Tests for Independence: Contingency Tables and Statistical Inference

Study Guide - Smart Notes

Tailored notes based on your materials, expanded with key definitions, examples, and context.

Chi-Square Tests and the F-Distribution

Section 10.2: Independence

This section introduces the use of contingency tables and the chi-square test for independence, which is a fundamental method in statistics for determining whether two categorical variables are related.

Contingency Tables

Definition and Structure

  • Contingency Table (r × c table): A table that displays the observed frequencies for two categorical variables, arranged in r rows and c columns.

  • The intersection of a row and a column is called a cell.

Example: Contingency Table

Gender

Cup

Cone

Sundae

Sandwich

Other

Male

600

288

204

24

84

Female

410

340

180

20

50

Example: The table above shows the favorite way to eat ice cream by gender for a sample of 2200 adults.

Expected Frequencies in Contingency Tables

Calculating Expected Frequencies

  • Assuming the two variables are independent, the expected frequency for each cell can be calculated using the marginal totals.

  • Marginal Frequency: The total frequency for a single category of one variable (row or column total).

  • Joint Frequency: The observed frequency in the interior cells of the table (intersection of categories).

Formula for Expected Frequency:

Example: Calculating Expected Frequencies

Gender

Cup

Cone

Sundae

Sandwich

Other

Total

Male

600

288

204

24

84

1200

Female

410

340

180

20

50

1000

Total

1010

628

384

44

134

2200

For the cell (Male, Cup):

Other expected frequencies are calculated similarly for each cell.

Summary Table: Observed vs. Expected Frequencies

Gender

Cup

Cone

Sundae

Sandwich

Other

Male (Observed)

600

288

204

24

84

Male (Expected)

550.91

342.55

209.45

24

73.09

Female (Observed)

410

340

180

20

50

Female (Expected)

459.09

285.45

174.55

20

60.91

Chi-Square Test for Independence

Purpose and Application

  • The chi-square independence test is used to determine whether two categorical variables are independent.

  • It assesses whether the occurrence of one variable affects the probability of the occurrence of the other variable.

Conditions for Use

  • The observed frequencies must be obtained from a random sample.

  • Each expected frequency must be at least 5.

Test Statistic and Degrees of Freedom

  • The sampling distribution for the test is approximated by a chi-square distribution with degrees of freedom:

  • The test statistic is:

where is the observed frequency and is the expected frequency for each cell.

Steps for Performing a Chi-Square Independence Test

  1. Verify that the observed frequencies are from a random sample and each expected frequency is at least 5.

  2. State the null hypothesis () and alternative hypothesis ():

    • : The variables are independent.

    • : The variables are dependent.

  3. Specify the level of significance ().

  4. Determine the degrees of freedom: .

  5. Find the critical value from the chi-square distribution table.

  6. Determine the rejection region (values of greater than the critical value).

  7. Calculate the test statistic using the observed and expected frequencies.

  8. Make a decision: If is in the rejection region, reject ; otherwise, fail to reject $H_0$.

  9. Interpret the result in the context of the original claim.

Worked Example: Ice Cream Preferences and Gender

Step-by-Step Solution

  • Hypotheses:

    • : Favorite way to eat ice cream and gender are independent.

    • : Favorite way to eat ice cream and gender are dependent.

  • Significance Level:

  • Degrees of Freedom:

  • Critical Value:

  • Test Statistic Calculation:

    • Plug observed and expected frequencies into the formula:

    For this example,

  • Decision: Since , reject .

  • Conclusion: There is enough evidence at the 1% significance level to conclude that favorite way to eat ice cream and gender are dependent.

Additional Example: Exercise Frequency and Gender

Contingency Table

Gender

0-1

2-3

4-5

6-7

Total

Male

40

53

26

6

125

Female

34

68

37

11

150

Total

74

121

63

17

275

Hypotheses and Test

  • : Number of days of exercise per week is independent of gender.

  • : Number of days of exercise per week depends on gender.

  • Critical value:

Calculation and Decision

  • Calculate expected frequencies for each cell using the formula above.

  • Compute the test statistic

  • Since , fail to reject .

  • Conclusion: There is not enough evidence at the 5% significance level to conclude that the number of days a student exercises per week is related to gender.

Summary Table: Steps for Chi-Square Test for Independence

Step

Description

Symbol/Formula

1

Verify random sample and expected frequencies ≥ 5

2

State hypotheses

,

3

Specify significance level

4

Determine degrees of freedom

5

Find critical value

Chi-square table

6

Determine rejection region

7

Calculate test statistic

8

Make decision

Compare to critical value

9

Interpret result

Key Terms: contingency table, marginal frequency, joint frequency, expected frequency, chi-square test for independence, degrees of freedom, significance level, rejection region.

Example Applications: Testing whether preferences, behaviors, or outcomes are associated with demographic variables such as gender, age group, or treatment group in survey or experimental data.

Pearson Logo

Study Prep