Quick Summary
This guide will equip you to perform a complete chi-square significance test for categorical data. You will learn to distinguish between tests for homogeneity and independence, state appropriate hypotheses, verify the necessary conditions, and calculate the chi-square test statistic and p-value. Ultimately, you will be able to draw a statistically sound conclusion in the context of a problem, determining if there is a significant difference between population distributions or a significant association between two variables.
Key Concepts
The chi-square (χ^2) tests for homogeneity and independence are used to analyze categorical data presented in a two-way table. While the calculations are identical, the study design and hypotheses differ.
Test for Homogeneity: Used when you have independent random samples from two or more populations (or treatment groups) and want to compare the distribution of a single categorical variable across these populations.
- Example: Comparing the distribution of political party affiliation (Democrat, Republican, Independent) across three different states. You would take a separate random sample from each state.
Test for Independence: Used when you have a single random sample from one population and measure two different categorical variables for each individual. The goal is to determine if there is an association between these two variables in the population.
- Example: Taking one random sample of students from a university and asking for their class year (Freshman, Sophomore, etc.) and their primary source of news (Social Media, TV, Print).
The Chi-Square Test Procedure
Data Organization: Data is organized in a two-way table (or contingency table), where rows represent one variable and columns represent the other.
[Image: A generic 2x3 two-way table showing row totals, column totals, and the grand total in the margins.]
Hypotheses: Hypotheses are always stated in words, not symbols.
Null Hypothesis (H₀): States that there is no difference (for homogeneity) or no association (for independence).
Homogeneity H₀: The distribution of [categorical variable] is the same for all [populations or treatments].
Independence H₀: There is no association between [variable 1] and [variable 2] in the [population of interest].
Alternative Hypothesis (Hₐ): States that there is a difference or an association.
Homogeneity Hₐ: The distribution of [categorical variable] is not the same for all [populations or treatments].
Independence Hₐ: There is an association between [variable 1] and [variable 2] in the [population of interest].
Conditions for Inference: Three conditions must be checked and verified.
Random: The data must come from well-designed random samples or a randomized experiment.
Homogeneity: Data must come from two or more independent random samples or from groups in a randomized experiment.
Independence: Data must come from one random sample.
10% Condition: When sampling without replacement, the sample size (n) should be no more than 10% of the population size (N) for each sample. (n \le 0.10N).
Large Counts:All expected counts must be at least 5. This is the most critical condition. You must show your work for this.
Calculations:
Expected Counts: The count we would expect in each cell if H₀ were true.
- Formula:
Chi-Square Test Statistic (χ^2): This statistic measures the difference between the observed data and what we would expect if H₀ were true. A larger χ^2 value indicates more evidence against H₀.
Formula:
The Σ symbol means you calculate the term for every cell in the table and then sum them all up.
Degrees of Freedom (df): Determines the specific chi-square distribution to use.
- Formula:
P-value: The probability of getting a χ^2 statistic as extreme or more extreme than the one calculated, assuming H₀ is true. It is the area to the right of your calculated χ^2 value on the chi-square distribution curve.
[Image: A right-skewed chi-square distribution curve with df=4. The area to the right of a calculated χ^2 value (e.g., 9.49) is shaded to represent the p-value.]
Conclusion:
Compare the p-value to your significance level (α).
If p-value \le α, you reject H₀. There is convincing evidence for the alternative hypothesis (that there is a difference in distributions or an association between variables).
If p-value > α, you fail to reject H₀. There is not convincing evidence for the alternative hypothesis.
Key Vocabulary
Chi-Square Test for Homogeneity: An inference procedure used to determine whether the distribution of a single categorical variable is the same across several distinct populations or treatment groups.
Chi-Square Test for Independence: An inference procedure used to determine whether there is a statistically significant association between two categorical variables in a single population.
Observed Counts: The actual, recorded frequencies of outcomes from the sample data, presented in the cells of a two-way table.
Expected Counts: The theoretical frequencies of outcomes we would anticipate in each cell of a two-way table if the null hypothesis were true.
Chi-Square Test Statistic (χ^2): A measure of the discrepancy between observed counts and expected counts, calculated by summing the squared differences divided by the expected counts for all cells.
Degrees of Freedom (df): For a chi-square test on a two-way table, it is calculated as (rows - 1) × (columns - 1) and defines the specific shape of the chi-square distribution.
Two-Way Table: A table that displays the frequency distribution of two categorical variables simultaneously. The rows correspond to the categories of one variable, and the columns correspond to the categories of the other.
Calculator Tech (TI-84)
The TI-84 makes performing a chi-square test very efficient.
1. Enter the Observed Counts into a Matrix:
Press
2nd-> [MATRIX].Arrow over to
EDITand select1:[A].Enter the dimensions of your two-way table (rows x columns). Do NOT include totals.
Type in your observed counts, pressing
ENTERafter each one.Press
2nd->MODE[QUIT] to return to the home screen.
2. Perform the Chi-Square Test:
Press
STAT-> arrow over toTESTS.Scroll down and select
C:χ^2-Test....You will see the following screen:
`Observed:[A] The calculator will automatically calculate the expected counts and store them in this matrix (usually ). You don't need to do anything here.
or : Select .
Press
ENTER.
3. Interpret the Output:
The calculator will display:
(Your calculated test statistic)
(Your p-value)
(Your degrees of freedom)
To check the Large Counts condition: After running the test, the expected counts are stored in matrix . Go to
2nd-> [MATRIX], select2:[B], and pressENTERto view the expected counts and ensure they are all \ge 5.
How to Show Work on the FRQ
To earn full credit on an inference question, you must use the four-step State-Plan-Do-Conclude (SPDC) process.
STATE
Hypotheses: Define your null (H₀) and alternative (Hₐ) hypotheses in the context of the problem.
For Homogeneity:
H₀: The distribution of [variable] is the same for all [populations/groups].
Hₐ: The distribution of [variable] is not the same for all [populations/groups].
For Independence:
H₀: There is no association between [variable 1] and [variable 2] for the [population].
Hₐ: There is an association between [variable 1] and [variable 2] for the [population].
Significance Level: State the alpha (α) level. If not given, use α = 0.05.
PLAN
Name the Test: "We will perform a Chi-Square Test for [Homogeneity/Independence]."
Check Conditions:
Random: State that the data come from [independent random samples / a single random sample / a randomized experiment], as described in the problem.
10% Condition: If sampling without replacement, confirm that each sample size is less than 10% of its respective population size.
Large Counts: State that all expected counts are at least 5. You MUST show evidence for this. The best way is to state the smallest expected count.
- Example: "All expected counts are \ge 5. The smallest expected count is [value], calculated as (Row Total × Column Total) / Grand Total = (value × value) / value = [value]."
DO
General Formula: Write the formula for the test statistic: .
Calculations:
Show the calculation for at least one expected count.
Show the calculation for at least one term of the chi-square sum.
Example:
Example:
Test Results: Report the values from your calculator.
Test Statistic:
Degrees of Freedom:
P-value:
CONCLUDE
Decision: Compare your p-value to α. "Because the p-value of [value] is [less than / greater than] α = [value]..."
Conclusion in Context: "...we [reject / fail to reject] H₀. We [have / do not have] convincing evidence that [restate Hₐ in context]."
Practice Problems
Problem 1:
A pharmaceutical company is testing a new medication for allergy relief. In a randomized experiment, 300 volunteers with allergies were randomly assigned to one of three groups: Group A (New Medication), Group B (Competitor's Medication), and Group C (Placebo). After two weeks, each participant rated their allergy relief as "Significant Improvement," "Some Improvement," or "No Improvement." The results are in the table below.
| Relief Level | Group A (New Med) | Group B (Competitor) | Group C (Placebo) | Total |
|---|---|---|---|---|
| Significant Improvement | 55 | 45 | 20 | 120 |
| Some Improvement | 35 | 30 | 35 | 100 |
| No Improvement | 10 | 25 | 45 | 80 |
| Total | 100 | 100 | 100 | 300 |
Does this experiment provide convincing evidence of a difference in the distribution of allergy relief among the three treatments? Use α = 0.01.
Solution:
STATE
H₀: The distribution of allergy relief (Significant, Some, No Improvement) is the same for all three treatments (New Med, Competitor, Placebo).
Hₐ: The distribution of allergy relief is not the same for all three treatments.
Significance Level: α = 0.01.
PLAN
Test: We will perform a Chi-Square Test for Homogeneity.
Check Conditions:
Random: The 300 volunteers were randomly assigned to the three treatment groups.
10% Condition: This is a randomized experiment, not sampling without replacement, so this condition is not applicable.
Large Counts: All expected counts are at least 5. The smallest expected count is for the "No Improvement" and "Placebo" cell: (80 × 100) / 300 = 26.67. Since 26.67 \ge 5, the condition is met.
DO
Formula:
Calculations:
Expected Count (Significant, Group A) = (120 × 100) / 300 = 40
First term of χ^2 sum = (55 - 40)^2 / 40 = 225 / 40 = 5.625
Test Results (from TI-84):
(which is approximately 0.000000635)
CONCLUDE
Decision: Because the p-value of ~0 is less than α = 0.01, we reject H₀.
Conclusion in Context: We have convincing evidence that the distribution of allergy relief is not the same for the new medication, the competitor's medication, and the placebo.
Problem 2:
A guidance counselor at a large high school wants to know if there is an association between a student's class level and their primary method of studying for final exams. The counselor takes a simple random sample of 250 students and records their class level and preferred study method. The data are summarized below.
| Study Method | Freshman | Sophomore | Junior | Senior | Total |
|---|---|---|---|---|---|
| Study Group | 15 | 18 | 22 | 10 | 65 |
| Re-read Notes | 25 | 30 | 20 | 15 | 90 |
| Practice Tests | 10 | 20 | 35 | 30 | 95 |
| Total | 50 | 68 | 77 | 55 | 250 |
Is there convincing evidence of an association between class level and study method at this high school?
Solution:
STATE
H₀: There is no association between class level and primary study method for students at this high school.
Hₐ: There is an association between class level and primary study method for students at this high school.
Significance Level: Since none is given, we will use α = 0.05.
PLAN
Test: We will perform a Chi-Square Test for Independence.
Check Conditions:
Random: The data come from a simple random sample of 250 students.
10% Condition: It is reasonable to assume there are more than 10 × 250 = 2500 students in a "large high school."
Large Counts: All expected counts are at least 5. The smallest expected count is for the "Freshman" and "Study Group" cell: (65 × 50) / 250 = 13. Since 13 \ge 5, the condition is met.
DO
Formula:
Calculations:
Expected Count (Freshman, Study Group) = (65 × 50) / 250 = 13
First term of χ^2 sum = (15 - 13)^2 / 13 = 4 / 13 \approx 0.308
Test Results (from TI-84):
CONCLUDE
Decision: Because the p-value of 0.0055 is less than α = 0.05, we reject H₀.
Conclusion in Context: We have convincing evidence of an association between a student's class level and their primary study method at this high school.
Common Mistakes to Avoid
Confusing Homogeneity and Independence: The calculations are the same, but the conclusion depends on the study design. Remember: Homogeneity = Multiple Samples/Groups, comparing one variable. Independence = One Sample, looking for an association between two variables.
Checking Conditions on Observed Counts: The Large Counts condition applies to EXPECTED counts, not the observed counts in the original table. You must calculate or use your calculator to find the expected counts before you can verify this condition.
Incorrect Hypotheses: Do not use symbols like , , or in your hypotheses. Chi-square hypotheses are always written in words describing the relationship (or lack thereof) between the variables.
Incorrect Degrees of Freedom: The degrees of freedom are not based on the sample size. Always use the formula .
Stating a Cause-and-Effect Conclusion: An association between two variables (from a Test for Independence) does not imply that one causes the other. Correlation is not causation. Your conclusion should only state that an association exists.