AP Statistics • Inference for Categorical Data: Chi-Square

Skills Focus: Selecting an Appropriate Inference Procedure for Categorical Data

Learn to match every categorical data scenario to the right chi-square or proportion test with confidence.

A scatter plot with data columns and a percentage symbol.
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

Statistical inference for categorical data has a rich history rooted in the need to analyze counts, proportions, and frequency distributions rather than continuous measurements. While methods for quantitative data—such as the t-test and ANOVA—were developed alongside the foundations of parametric statistics, categorical data demanded its own family of techniques. The story of these methods intertwines with the broader evolution of hypothesis testing, from Karl Pearson's pioneering goodness-of-fit statistic to the modern AP Statistics curriculum that asks you to choose among several related procedures.

1900 • Pearson's Chi-Square Statistic

Karl Pearson introduced the χ² goodness-of-fit test, providing the first rigorous method to compare observed frequency distributions against hypothesized proportions.

1922 • Fisher's Exact Test & Likelihood Foundations

Ronald Fisher developed exact tests for 2 × 2 tables and formalized the concept of likelihood, setting the stage for choosing between exact and approximate categorical procedures.

1934 • Neyman–Pearson Framework

Jerzy Neyman and Egon Pearson formalized Type I and Type II errors, providing the decision-theoretic language we still use when selecting and evaluating inference procedures.

1952 • Extension to r × c Tables

The chi-square test of independence and the test of homogeneity were generalized for larger contingency tables, expanding the toolkit for multi-category comparisons.

2019 • AP Statistics Curriculum Update

The College Board reorganized AP Statistics to emphasize procedural selection skills, requiring students to distinguish among chi-square and proportion-based procedures given a research scenario.

The central challenge in categorical inference has always been the same: given a set of observed counts or proportions and a research question, which statistical procedure yields valid conclusions? This lesson equips you with a systematic decision framework so that on the AP exam—and in applied research—you can identify the correct test within seconds of reading a problem.

SECTION 2

Core Principles & Definitions

Before you can select the right procedure, you must internalize a small set of foundational ideas that differentiate the categorical inference tests on the AP Statistics exam. Each test is tailored to a specific type of research question, number of variables, and number of populations or treatments. Misidentifying any of these features leads to choosing the wrong test and losing credit on both multiple-choice and free-response questions.

1

One-Sample z-Test for a Proportion

Tests whether a single population proportion equals a hypothesized value p₀. Uses one categorical variable with exactly two outcomes (success/failure) from one sample or population.
2

Two-Sample z-Test for a Difference in Proportions

Compares proportions of success between two independent populations or treatments. Still focuses on a single two-outcome categorical variable, but now across two groups.
3

Chi-Square Goodness-of-Fit Test

Tests whether the distribution of one categorical variable (with two or more categories) in a single population matches a hypothesized distribution of proportions.
4

Chi-Square Test of Homogeneity

Compares the distribution of one categorical variable across two or more independent populations or treatments. Data are collected via independent random samples from each population.
5

Chi-Square Test of Independence

Tests whether two categorical variables are associated within a single population. Data come from one sample, and each individual is classified on both variables simultaneously.
✦

KEY TAKEAWAY

Think of selecting an inference procedure like choosing the right tool at a workbench. A wrench, pliers, and socket driver all grip and turn, but each fits a specific bolt head. The z-tests for proportions are your precision wrenches—designed for binary outcomes and one or two groups. The chi-square tests are your adjustable tools—flexible enough to handle any number of categories and multiple populations. Choosing the wrong tool doesn't just slow you down; it strips the bolt. Likewise, choosing the wrong test invalidates your conclusion.

SECTION 3

Visual Decision Flowchart

The flowchart below is your single most powerful tool for selecting the correct categorical inference procedure. Start at the top with the research question and follow the decision nodes downward. Each branch point asks a concrete question about the number of variables, the number of categories, or the number of populations involved. Study this diagram until the pathway becomes automatic.

Categorical Data Inference?How many categorical variables?OneTwoHow many populations / groups?One sample, two variablesχ² Test of Independence(association between two variables)OneTwo +How many categories?How many categories?23+23+1-Prop z-Test(p = p₀)χ² GOF Test(distribution match)2-Prop z-Test(p₁ − p₂ = 0)χ² Homogeneity(same distribution?)Note: When comparing two groups on a binary variable, both the 2-prop z-test and χ² homogeneity are valid; the z-test allows one-sided alternatives.
Follow the flowchart from top to bottom. Start by counting the number of categorical variables, then identify how many populations or groups are involved, and finally check the number of categories. Each terminal node names the appropriate procedure.

Notice the critical fork at the top: if only one categorical variable is under study, you proceed down the left branch, where the number of populations and the number of categories guide you to the correct test. If two categorical variables are being examined within a single population, you move to the right branch and land on the chi-square test of independence. The subtlety that most students miss is the distinction between homogeneity and independence: both use the same χ² computation and the same (r − 1)(c − 1) degrees of freedom, but they arise from fundamentally different sampling designs.

SECTION 4

Mathematical Framework

Although the focus of this lesson is on selecting the right procedure rather than computing test statistics, understanding the underlying formulas strengthens your ability to differentiate tests. Each procedure has a characteristic test statistic, degrees of freedom, and set of conditions, and knowing these helps you confirm that your procedural choice matches the problem's structure.

ONE-PROPORTION Z-TEST STATISTIC

z=(p^−p0)/√(p0(1−p0)/n)z = (p̂ − p₀) / √(p₀(1 − p₀) / n)

where p̂ is the sample proportion, p₀ is the hypothesized population proportion, and n is the sample size. Conditions: np₀ ≥ 10 and n(1 − p₀) ≥ 10; data come from a random sample.

TWO-PROPORTION Z-TEST STATISTIC

z=(p^1−p^2)/√(p^c(1−p^c)(1/n1+1/n2))z = (p̂₁ − p̂₂) / √(p̂_c(1 − p̂_c)(1/n₁ + 1/n₂))

where p̂_c = (X₁ + X₂)/(n₁ + n₂) is the pooled proportion under H₀: p₁ = p₂. Conditions: n₁p̂_c ≥ 10, n₁(1 − p̂_c) ≥ 10, and analogously for sample 2; independent random samples or random assignment.

CHI-SQUARE TEST STATISTIC

χ2=Σ(Observed−Expected)2/Expectedχ² = Σ (Observed − Expected)² / Expected

Used for all three chi-square tests (GOF, homogeneity, independence). The summation extends over all cells. For GOF: df = k − 1 where k is the number of categories. For homogeneity/independence: df = (r − 1)(c − 1). Condition: all expected counts ≥ 5.

EXPECTED COUNT FORMULAS

GOF:Ei=n×pi∣Contingencytable:Eij=(rowitotal×columnjtotal)/grandtotalGOF: E_i = n × p_i | Contingency table: E_ij = (row i total × column j total) / grand total

For a goodness-of-fit test, each expected count is the total sample size times the hypothesized proportion for that category. For two-way tables (homogeneity and independence), expected counts come from row and column totals.

⚠

AP Exam Tip

On the free-response section, naming the wrong procedure—even if your arithmetic is flawless—typically costs you the 'identify' point and may invalidate subsequent reasoning. Always state the procedure name explicitly (e.g., 'I will perform a chi-square test of homogeneity') before writing hypotheses.

SECTION 5

Detailed Decision Guide: Key Distinguishing Features

The most common errors on the AP exam involve confusing the chi-square test of homogeneity with the chi-square test of independence, or failing to recognize when a simpler z-test for proportions suffices. The following comparison table and diagram isolate the exact features that distinguish each procedure. Internalize these distinctions and you will navigate even the trickiest scenarios with ease.

Feature1-Prop z2-Prop zχ² GOFχ² Homogeneityχ² Independence
# of variables11112
# of categories222+2+2+ each
# of populations1212+1
Sampling design1 SRS2 independent SRS1 SRSIndependent samples from each pop.1 SRS classified on 2 variables
Hypotheses focusp = p₀p₁ − p₂ = 0Distribution matches claimDistributions are same across pops.Variables are independent
Allows one-sided Hₐ?YesYesNoNoNo

Comparison of the five categorical inference procedures tested on the AP Statistics exam.

Sampling Design Determines the TestONE POPULATIONSingle SRS drawn2 cat1-Prop z3+ catχ² GOFTWO+ POPULATIONSIndependent samples per group2 cat2-Prop z3+ catχ² Homog.ONE POP, TWO VARIABLESSingle SRS, classify on bothr × ctableχ² IndependenceKey Overlap Zone: 2 Groups × Binary Variable2-Proportion z-test✓ Allows one-sided Hₐ≈χ² Homogeneity (2 × 2)✗ Two-sided only; z² = χ²Both are valid for two-sided tests on binary data from two groups. Choose z when directionality matters.
This diagram organizes the five procedures by their sampling design. The bottom panel highlights the overlap zone where both the two-proportion z-test and the chi-square test of homogeneity are valid for a 2 × 2 table; the z-test is preferred when the alternative hypothesis is one-sided.
  • Homogeneity vs. Independence: The computation is identical, but the sampling design differs. Homogeneity uses independent samples from separate populations; independence uses a single sample classified on two variables. State the correct name in your free response.
  • z-test vs. χ² for binary data: When you have exactly two categories and two groups, the two-proportion z-test and the 2 × 2 chi-square test of homogeneity yield equivalent two-sided p-values (because z² = χ²). Use the z-test if your alternative is one-sided.
  • GOF vs. 1-Prop z: If a single population is divided into exactly two categories and you are testing whether the proportion equals a specific value, either test works, but the z-test again permits directionality.

A university campus provides a setting for comparing sampling and study-design routes.The way people or groups enter a study determines its design. Sampling within groups, selecting whole groups and assigning treatments answer different questions.

A four-by-four table of unknown cells contrasts one SRS of 600 with four separate samples of 150.In this four-by-four setup, one SRS of 600 people classified twice supports an independence test; four separate SRSs of 150 support homogeneity. Both have df = 9. The actual cell counts are needed to calculate and check expected counts.

SECTION 6

Worked Example: Choosing the Right Procedure

A university researcher surveys a random sample of 600 undergraduates and records each student's year (Freshman, Sophomore, Junior, Senior) and preferred study environment (Library, Dorm Room, Café, Other). She wants to determine whether there is an association between class year and preferred study location. Let's walk through the decision process.

Selecting and Justifying the Correct Test

  1. 1

    Step 1 — Identify the Type of Data

    Both class year and preferred study environment are categorical variables. We are not comparing means or measuring a quantitative response, so our inference procedure must come from the categorical inference family.
  2. 2

    Step 2 — Count the Variables

    There are two categorical variables: class year (4 categories) and study environment (4 categories). Two categorical variables means we are in the right branch of the flowchart, heading toward either homogeneity or independence.
  3. 3

    Step 3 — Identify the Sampling Design

    The researcher drew a single random sample of 600 students and then classified each student on both variables simultaneously. She did not sample separately from freshmen, sophomores, juniors, and seniors. This single-sample design means we are looking at independence, not homogeneity.
    → χ² Test of Independence
  4. 4

    Step 4 — State the Hypotheses

    H₀: Class year and preferred study environment are independent in the population of undergraduates at this university. Hₐ: Class year and preferred study environment are not independent (i.e., there is an association). Note that chi-square tests of independence are always two-sided.
  5. 5

    Step 5 — Verify Conditions

    Random: The sample was a random sample of 600 undergraduates. Large counts: We would need to compute all expected counts using E_ij = (row i total × column j total) / 600 and verify that every expected count is at least 5. Independence (of observations): 600 is almost certainly less than 10% of the university's undergraduate population. All conditions are plausible.
  6. 6

    Step 6 — Identify Degrees of Freedom

    df = (r − 1)(c − 1) = (4 − 1)(4 − 1) = 9. The chi-square statistic would be compared to the χ² distribution with 9 degrees of freedom.
    df = 9
💡

Contrast Scenario

Suppose instead the researcher had taken a random sample of 150 freshmen, 150 sophomores, 150 juniors, and 150 seniors, and then recorded each student's preferred study environment. Now the number of students in each class year is fixed by the sampling design—four separate samples, one per population. The correct test becomes the chi-square test of homogeneity: 'Is the distribution of study environment the same across the four class-year populations?'

SECTION 7

Strengths, Limitations & Common Pitfalls

Knowing the right procedure is only half the battle; you also need to understand the strengths and limitations of each test so you can discuss them intelligently on a free-response question or spot distractors on a multiple-choice item. The following table summarizes the practical advantages and constraints of each categorical inference procedure.

ProcedureStrengthsLimitations
1-Prop z-testSimple, allows one-sided alternatives, yields a confidence interval for p. Well-suited when the research question targets a single proportion.Only handles two categories (success/failure). Requires np₀ ≥ 10 and n(1 − p₀) ≥ 10; not robust to violations.
2-Prop z-testAllows one-sided alternatives; can construct a confidence interval for p₁ − p₂. Natural choice for comparing two treatments on a binary outcome.Limited to two groups and a binary variable. Requires large-count conditions on the pooled proportion. Cannot handle 3+ groups.
χ² GOFHandles any number of categories (k ≥ 2). Can test against any hypothesized distribution, including uniform, historical, or theoretical.Always two-sided; cannot detect which specific category deviates. Requires all expected counts ≥ 5.
χ² HomogeneityCompares distributions across 2+ populations. Flexible for any number of response categories. Commonly used in experiments with multiple treatment groups.Two-sided only; a significant result does not indicate which populations differ. Requires independent samples and all expected counts ≥ 5.
χ² IndependenceTests association between any two categorical variables. Requires only a single sample. Flexible table dimensions (r × c).Two-sided only; detects association but not direction or causation. Requires all expected counts ≥ 5. Does not yield an effect-size measure directly.

Strengths and limitations of each categorical inference procedure.

✦

KEY TAKEAWAY

Think of the z-tests as scalpels—precise instruments for a specific, narrow task (binary outcomes, one or two groups, with the option for directional cuts). Think of the chi-square tests as Swiss Army knives—versatile, multi-category tools, but inherently two-sided and less informative about exactly where the differences lie. On the exam, reach for the scalpel when the problem is narrow enough to warrant it, and for the Swiss Army knife when the scenario is broader.

SECTION 8

Connections to Advanced Theory

The categorical inference procedures you learn in AP Statistics are a gateway to a rich landscape of advanced methods used in biostatistics, social science, and machine learning. Understanding how these foundational tests connect to their more powerful successors deepens your conceptual grasp and prepares you for college-level coursework.

AP Statistics ProcedureAdvanced ExtensionWhat It Adds
1-Prop z-test / 2-Prop z-testLogistic RegressionModels the probability of a binary outcome as a function of one or more predictors (both categorical and quantitative), allowing for multiple covariates and interactions.
χ² Test of IndependenceLog-Linear ModelsExtends to three-way or higher-dimensional contingency tables, modeling associations among multiple categorical variables simultaneously.
χ² GOFKolmogorov–Smirnov / Anderson–DarlingTests distributional fit for continuous data; does not require binning into categories, yielding greater power against many alternatives.
χ² HomogeneityMultinomial Logistic RegressionModels the distribution of a multi-category response across groups while adjusting for confounders and estimating individual category probabilities.
All chi-square tests (small samples)Fisher's Exact Test / Permutation TestsProvides exact p-values when expected counts are too small for the χ² approximation to be reliable, especially in 2 × 2 tables.

How AP-level categorical inference procedures connect to advanced statistical methods.

A particularly elegant connection is the mathematical relationship between the z-test and the chi-square test for 2 × 2 tables. When you square the z-statistic from a two-proportion z-test, you obtain exactly the χ² statistic from the corresponding 2 × 2 homogeneity test: z² = χ². This identity arises because the chi-square distribution with 1 degree of freedom is the distribution of a squared standard normal variable. Recognizing this helps you see that these are not truly separate tests but rather different lenses on the same underlying comparison—one that supports directionality and one that does not.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A researcher takes a single random sample of 500 adults and classifies each by political affiliation (Democrat, Republican, Independent) and opinion on a policy (Favor, Oppose, No Opinion). Which inference procedure is most appropriate?
  • A. One-proportion z-test
  • B. Two-proportion z-test
  • C. Chi-square goodness-of-fit test
  • D. Chi-square test of independence
  • E. Chi-square test of homogeneity
Show answer (D)
The correct answer is D. There are two categorical variables (political affiliation and policy opinion), each with three categories, measured on a single random sample. This matches the chi-square test of independence, which tests whether two categorical variables are associated within one population. A (one-proportion z-test) is wrong because there are two variables, not one binary variable tested against a value. B (two-proportion z-test) is wrong because there are three groups and three response categories, not two groups on a binary outcome. C (chi-square GOF) is wrong because GOF applies to one variable's distribution, not the relationship between two variables. E (chi-square homogeneity) is wrong because it requires separate independent samples from each population, whereas here a single sample was drawn and then classified on both variables.

Question 2: BASIC CALCULATION

A candy manufacturer claims that 30% of candies in a bag are red, 20% are blue, 20% are green, 15% are yellow, and 15% are orange. A quality control analyst selects a random sample of 200 candies to test this claim. What are the appropriate null hypothesis and degrees of freedom?
  • A. H₀: p = 0.30; df = 1
  • B. H₀: The distribution of candy colors matches the manufacturer's claim; df = 4
  • C. H₀: The distribution of candy colors matches the manufacturer's claim; df = 5
  • D. H₀: Color and frequency are independent; df = 4
  • E. H₀: The distribution of candy colors is uniform; df = 4
Show answer (B)
The correct answer is B. This is a chi-square goodness-of-fit test because we have one categorical variable (color, with k = 5 categories) from one population, and we are testing whether the observed distribution matches a specified set of proportions. The degrees of freedom are k − 1 = 5 − 1 = 4. A is wrong because it focuses on only one color and uses a z-test framework with 1 degree of freedom. C is wrong because it uses df = 5 instead of k − 1 = 4. D is wrong because it states hypotheses for a test of independence (two variables), not a GOF test (one variable). E is wrong because the null does not claim a uniform distribution—the hypothesized proportions are unequal (0.30, 0.20, 0.20, 0.15, 0.15).

Question 3: INTERMEDIATE

In a clinical trial, 120 patients are randomly assigned to Drug A and 130 patients are randomly assigned to Drug B. After treatment, patients are classified as 'Improved,' 'No Change,' or 'Worsened.' The researchers want to compare the distribution of outcomes between the two drugs. Which procedure is most appropriate, and why might a two-proportion z-test be inappropriate here?
  • A. Chi-square test of independence, because there are two treatment groups
  • B. Chi-square test of homogeneity, because the response variable has more than two categories and two independent groups are being compared
  • C. Two-proportion z-test, because there are two treatment groups
  • D. Chi-square goodness-of-fit, because we are comparing to an expected distribution
  • E. Chi-square test of independence, because the outcome has three categories
Show answer (B)
The correct answer is B. The experiment involves two independently formed groups (Drug A and Drug B), and the response variable (outcome) has three categories: Improved, No Change, and Worsened. The research question asks whether the distribution of outcomes is the same across the two treatment groups, which is precisely the chi-square test of homogeneity. A two-proportion z-test (C) is inappropriate because it can only handle a binary response variable, and here there are three outcome categories. A (independence) is wrong because the two groups were formed by random assignment—separate groups—not by classifying members of a single sample on two variables. D (GOF) is wrong because we are comparing distributions between two groups, not testing one group's distribution against a hypothesized one. E repeats the independence error with a different justification.

Question 4: APPLIED

4 pts
A marketing team wants to know whether customer satisfaction (Satisfied, Neutral, Dissatisfied) differs between three regional offices (East, Central, West). They take independent random samples of 80 customers from each office and record satisfaction level. (a) Identify the appropriate inference procedure and state the hypotheses. (b) Calculate the degrees of freedom. (c) Suppose all expected counts are at least 5 and the chi-square test statistic is χ² = 14.72. Using a significance level of α = 0.05, state the conclusion in context. (The critical value for the appropriate df at α = 0.05 is 9.488.) (d) A colleague suggests using three separate two-proportion z-tests (East vs. Central, East vs. West, Central vs. West) to compare the proportion of 'Satisfied' customers. Explain one statistical problem with this approach.
Show answer
Rubric (4 points): Point 1 — Identify procedure and hypotheses (1 point): The appropriate procedure is the chi-square test of homogeneity because there are three independent samples (one from each regional office) and one categorical response variable (satisfaction) with three categories. H₀: The distribution of satisfaction level is the same across all three regional offices. Hₐ: The distribution of satisfaction level is not the same across all three regional offices. Point 2 — Degrees of freedom (1 point): df = (r − 1)(c − 1) = (3 − 1)(3 − 1) = 2 × 2 = 4. Point 3 — Conclusion in context (1 point): Since χ² = 14.72 > 9.488 (the critical value for df = 4 at α = 0.05), we reject H₀. There is convincing evidence at the α = 0.05 significance level that the distribution of customer satisfaction differs among the three regional offices. Point 4 — Explain the problem with multiple z-tests (1 point): Conducting three separate two-proportion z-tests at α = 0.05 inflates the overall Type I error rate beyond 0.05. With three tests, the probability of at least one false rejection (assuming all nulls are true) is approximately 1 − (1 − 0.05)³ ≈ 0.143, which is nearly three times the intended significance level. Additionally, each z-test only examines the proportion of 'Satisfied' and ignores the full three-category distribution.

Question 5: CRITICAL THINKING

5 pts
Consider two study designs investigating whether there is a relationship between exercise frequency (None, 1–3 times/week, 4+ times/week) and sleep quality (Poor, Fair, Good). Study A: A random sample of 450 adults is selected from the city's population. Each participant reports both their exercise frequency and sleep quality. Study B: Random samples of 150 adults who exercise 'None,' 150 who exercise '1–3 times/week,' and 150 who exercise '4+ times/week' are independently drawn. Each reports their sleep quality. (a) For each study, identify the appropriate chi-square test and justify your choice by explaining how the sampling design determines the test. (b) Write the null and alternative hypotheses for each study. Explain why the hypotheses, though they sound similar, are conceptually distinct. (c) Both studies produce a 3 × 3 contingency table with the same observed cell counts. Explain why the test statistic, degrees of freedom, and p-value would be numerically identical despite the different tests. (d) A journalist reports the results of Study A by saying, 'Exercising more causes better sleep.' Critique this claim, referencing the study design.
Show answer
Rubric (5 points): Point 1 — Identify both procedures with justification (1 point): Study A uses the chi-square test of independence because a single random sample of 450 adults is drawn and each individual is classified on two categorical variables (exercise frequency and sleep quality). Study B uses the chi-square test of homogeneity because three independent random samples are drawn—one from each exercise frequency subpopulation—and each participant is classified on one response variable (sleep quality). The critical distinguishing feature is the sampling design: one sample classified on two variables vs. separate samples from predefined populations. Point 2 — Hypotheses for each study (1 point): Study A — H₀: Exercise frequency and sleep quality are independent in the city's adult population. Hₐ: Exercise frequency and sleep quality are not independent. Study B — H₀: The distribution of sleep quality is the same for all three exercise frequency populations. Hₐ: The distribution of sleep quality is not the same for all three exercise frequency populations. Although both test 'no relationship,' the independence hypothesis frames it as a lack of association between two variables in a single population, while the homogeneity hypothesis frames it as identical response distributions across distinct populations. Point 3 — Explain numerical equivalence (1 point): Despite the conceptual difference, both tests use the same χ² formula: Σ (O − E)² / E, where expected counts are computed as (row total × column total) / grand total. Both use df = (3 − 1)(3 − 1) = 4. Because the observed counts are identical, the expected counts, the test statistic, and the p-value will all be numerically the same. The distinction is interpretive, not computational. Point 4 — Critique the causal claim (1 point): Study A is an observational study—participants self-reported their exercise habits rather than being randomly assigned to exercise groups. Without random assignment, we cannot establish a causal relationship between exercise and sleep quality. Confounding variables (e.g., overall health, stress, age) may explain the observed association. The journalist should say 'Exercise frequency is associated with sleep quality,' not that one causes the other. Point 5 — Quality and completeness of reasoning (1 point): Awarded for clear, well-organized communication that uses appropriate statistical vocabulary throughout; integrates references to sampling design, random assignment vs. random sampling, and the distinction between association and causation in a cohesive argument.

SUMMARY

Summary & Review

Summary

Selecting the correct inference procedure for categorical data hinges on three diagnostic questions: How many categorical variables are involved? (one vs. two), How many populations or groups are being studied? (one vs. two or more), and How many categories does the response variable have? (two vs. three or more). For a single binary variable in one population, use the one-proportion z-test; to compare binary proportions across two independent groups, use the two-proportion z-test. When the variable has three or more categories in a single population, apply the chi-square goodness-of-fit test; when comparing multi-category distributions across independently sampled groups, use the chi-square test of homogeneity; and when a single sample is classified on two categorical variables, use the chi-square test of independence.

Remember that the z-tests allow one-sided alternatives while all chi-square tests are inherently two-sided. The sampling design—one sample vs. multiple independent samples—is the key distinction between independence and homogeneity, even though the computations are identical. Always state the name of your chosen procedure explicitly, verify conditions (random sampling, expected counts ≥ 5, and the 10% condition where applicable), and connect your conclusion back to the context of the problem.

Varsity Tutors • AP Statistics • Skills Focus: Selecting an Appropriate Inference Procedure for Categorical Data