PrepGo

Skills Focus: Selecting an Appropriate Inference Procedure for Categorical Data - AP Statistics Study Guide

Written by AP Content Team, Verified for 2026 AP Exams, Last updated: May 2026

Learn with study guides reviewed by top AP teachers. This guide takes about 1 minutes to read.

Quick Summary

This guide will equip you to master the selection of the correct inference procedure for categorical data. After working through this material, you will be able to analyze a problem's context, data collection method, and research question to confidently choose, justify, and execute the appropriate Chi-Square test: Goodness-of-Fit, Homogeneity, or Independence. This skill is critical for correctly interpreting relationships and distributions in categorical data on the AP exam.

Key Concepts

The primary goal of this unit is to choose the correct tool for the job. All three procedures covered here use the Chi-Square (χ^2) test statistic, but they answer fundamentally different questions. The key to selection is understanding how the data was collected and what is being compared.

The Chi-Square test statistic measures the difference between the data we actually collected (observed counts) and the data we would expect to see if the null hypothesis were true (expected counts).

  • Formula: χ^2 = Σ [ (Observed - Expected)^2 / Expected ]

  • A small χ^2 value means our observed data is very close to what we expected.

  • A large χ^2 value means our observed data is far from what we expected, providing evidence against the null hypothesis.

The Decision-Making Framework

To select the correct test, ask yourself these two questions in order:

  1. How many categorical variables am I analyzing?

    • One Variable: You are using a Chi-Square Goodness-of-Fit (GOF) Test.

    • Two Variables: Proceed to question 2.

  2. How many populations or groups were sampled?

    • One Sample: You are using a Chi-Square Test for Independence (to see if the two variables are associated in that single population).

    • Two or More Samples: You are using a Chi-Square Test for Homogeneity (to see if the distribution of one variable is the same across multiple populations).

[Image: A flowchart showing the decision-making process. The first box asks "How many categorical variables?" If one, it points to "Chi-Square GOF Test". If two, it points to a second box asking "How many samples/groups?" If one, it points to "Chi-Square Test for Independence". If two or more, it points to "Chi-Square Test for Homogeneity".]


Test 1: Chi-Square Goodness-of-Fit (GOF) Test

  • Purpose: To determine if the observed distribution of a single categorical variable from a single sample matches a claimed or hypothesized distribution.

  • Data: A list of observed counts for several categories.

  • Example Question: A casino claims its six-sided die is fair (i.e., each side has a 1/6 probability of landing). You roll it 120 times to test this claim.

  • Hypotheses:

    • H₀: The distribution of outcomes is the same as the claimed distribution (e.g., p₁=1/6, p₂=1/6, ... p₆=1/6).

    • Hₐ: The distribution of outcomes is different from the claimed distribution.

  • Degrees of Freedom (df): (Number of categories) - 1

Test 2: Chi-Square Test for Homogeneity

  • Purpose: To determine if the distribution of a single categorical variable is the same across two or more distinct populations or treatment groups. The name says it all: are the distributions homogenous (the same)?

  • Data: A two-way table. Data is collected by taking separate random samples from each population/group.

  • Example Question: Do high school freshmen and seniors have the same distribution of preferences for social media platforms (TikTok, Instagram, X)? You take a random sample of 100 freshmen and a separate random sample of 100 seniors.

  • Hypotheses:

    • H₀: The distribution of [categorical variable] is the same for all [populations or groups].

    • Hₐ: The distribution of [categorical variable] is not the same for all [populations or groups].

  • Degrees of Freedom (df): (Number of rows - 1) * (Number of columns - 1)

Test 3: Chi-Square Test for Independence (or Association)

  • Purpose: To determine if there is a relationship (an association) between two categorical variables within a single population.

  • Data: A two-way table. Data is collected by taking one large random sample and measuring two different variables for each individual.

  • Example Question: Is there an association between a person's gender and their preferred movie genre? You take one large random sample of 200 adults and ask them their gender and their preferred genre.

  • Hypotheses:

    • H₀: There is no association between [variable 1] and [variable 2]. (They are independent).

    • Hₐ: There is an association between [variable 1] and [variable 2]. (They are not independent).

  • Degrees of Freedom (df): (Number of rows - 1) * (Number of columns - 1)

Conditions for All Chi-Square Inference Tests

For any of the three tests, the same three conditions must be met and checked.

  1. Random: The data must come from a well-designed random sample or randomized experiment.

  2. 10% Condition / Independent: When sampling without replacement, the sample size n should be no more than 10% of the population size (N). For Homogeneity, check this for each sample. For experiments, this condition is met if treatments are randomly assigned.

  3. Large Counts: All expected counts must be at least 5. You must show the calculation for the smallest expected count to prove you've checked this.

    • For GOF: Expected Count = n * pᵢ (sample size times hypothesized proportion for category i)

    • For Homogeneity/Independence: Expected Count = (Row Total * Column Total) / Grand Total

Key Vocabulary

  • Observed Count: The actual number of individuals or outcomes from the sample data that fall into a specific category.

  • Expected Count: The theoretical number of individuals or outcomes that would fall into a specific category if the null hypothesis were true.

  • Chi-Square Distribution (χ^2): A family of right-skewed distributions that take only non-negative values. The shape of the distribution is determined by its degrees of freedom.

  • Goodness-of-Fit Test: An inference procedure used to determine whether a categorical variable has a hypothesized distribution. Involves one variable from one sample.

  • Test for Homogeneity: An inference procedure used to determine whether the distribution of a categorical variable is the same for two or more populations or groups. Involves multiple samples.

  • Test for Independence: An inference procedure used to determine whether two categorical variables are associated in a single population. Involves one sample.

  • Two-Way Table: A table used to organize data for two categorical variables. The rows represent the categories of one variable, and the columns represent the categories of the other.

Calculator Tech (TI-84)

For Chi-Square Goodness-of-Fit (GOF) Test:

  1. Enter your Observed counts into list L1.

  2. Enter your Expected counts into list L2. (You must calculate these by hand first: n * pᵢ).

  3. Press STAT -> TESTS -> D: χ^2-GOF Test...

  4. Observed:L1

  5. Expected:L2

  6. df: (Number of categories) - 1

  7. Select or . The output will give you the χ^2 test statistic, the P-value, and the degrees of freedom.

For Chi-Square Test for Homogeneity or Independence:

These two tests use the exact same calculator function. The difference is in how you state your hypotheses and conclusions.

  1. Press 2nd -> .

  2. Arrow over to EDIT and select 1: [A].

  3. Enter the dimensions of your two-way table (rows x columns). Do NOT include totals.

  4. Enter the Observed counts from your two-way table into the matrix.

  5. Press STAT -> TESTS -> C: χ^2-Test...

  6. Observed:

  7. Expected: (The calculator will automatically calculate the expected counts and store them here).

  8. Select or . The output provides the χ^2 test statistic, P-value, and df.

  9. To check the Large Counts condition: After running the test, go back to 2nd -> , arrow to EDIT, and select 2: [B]. You can now view the matrix of expected counts and verify that all are \ge 5.

How to Show Work on the FRQ

Use the four-step State-Plan-Do-Conclude process. For this topic, the "State" step is critical for identifying and justifying your choice of test.

STATE:

  1. Name the Test: "We will perform a Chi-Square [Goodness-of-Fit / Test for Homogeneity / Test for Independence]."

  2. Justify the Test: Briefly explain why you chose that test based on the problem's context. (e.g., "We are testing if the distribution of one variable is the same across three distinct groups," or "We are testing for an association between two variables from a single sample.")

  3. State Hypotheses: Write H₀ and Hₐ in the context of the problem.

    • H₀: [Null hypothesis in words]

    • Hₐ: [Alternative hypothesis in words]

  4. Significance Level: State the alpha (α) level, or use α = 0.05 if not given.

PLAN:

  1. Check Conditions: Check the Random, 10%, and Large Counts conditions.

  2. Random: "The problem states the data come from a random sample(s) of..."

  3. 10%: "It is reasonable to assume the sample size(s) of n is/are less than 10% of the total population of..."

  4. Large Counts: "All expected counts are at least 5." You MUST show the calculation for the smallest expected count to get credit. For a two-way table, state the formula: , then show the calculation for the cell with the smallest expected value.

DO:

  1. General Formula: Write the formula: χ^2 = Σ [ (Observed - Expected)^2 / Expected ].

  2. Calculated Values: Report the values from your calculator.

    • Test Statistic: χ^2 = [value]

    • Degrees of Freedom: df = [value]

    • P-value: P-value = [value]

CONCLUDE:

  1. Decision: "Because the P-value of [value] is [less than / greater than] our significance level of α = [value], we [reject / fail to reject] the null hypothesis."

  2. Conclusion in Context: State your conclusion in plain language, relating it back to the alternative hypothesis and the original question. "We [have / do not have] convincing statistical evidence that [state Hₐ in context]."

Practice Problems

Problem 1:

A marketing company for a new video game claims that 60% of players will choose the "Warrior" class, 25% will choose "Mage," and 15% will choose "Rogue." To test this claim, you take a random sample of 200 new players and find that 110 chose Warrior, 58 chose Mage, and 32 chose Rogue. Is there convincing evidence that the distribution of class choices is different from what the company claimed? Use α = 0.05.

Solution:

STATE:

  • Test: We will perform a Chi-Square Goodness-of-Fit Test.

  • Justification: We are comparing the observed distribution of a single categorical variable (player class) from one sample to a hypothesized distribution claimed by the company.

  • Hypotheses:

    • H₀: The distribution of player class choice is the same as the company's claim (p_Warrior = 0.60, p_Mage = 0.25, p_Rogue = 0.15).

    • Hₐ: The distribution of player class choice is different from the company's claim.

  • Significance Level: α = 0.05.

PLAN:

  • Random: The problem states a random sample of 200 new players was taken.

  • 10%: It is reasonable to assume 200 players is less than 10% of all new players for this game.

  • Large Counts: We must calculate the expected counts. All must be \ge 5.

    • Expected Warrior: 200 * 0.60 = 120

    • Expected Mage: 200 * 0.25 = 50

    • Expected Rogue: 200 * 0.15 = 30

    • All expected counts (120, 50, 30) are \ge 5. The condition is met.

DO:

  • Formula: χ^2 = Σ [ (Observed - Expected)^2 / Expected ]

  • Calculated Values (from TI-84):

    • Observed: {110, 58, 32}

    • Expected: {120, 50, 30}

    • Test Statistic: χ^2 = (110-120)^2/120 + (58-50)^2/50 + (32-30)^2/30 = 0.833 + 1.28 + 0.133 = 2.246

    • Degrees of Freedom: df = (categories) - 1 = 3 - 1 = 2

    • P-value: χ^2cdf(2.246, 1E99, 2) = 0.3253

CONCLUDE:

  • Decision: Because the P-value of 0.3253 is greater than our significance level of α = 0.05, we fail to reject the null hypothesis.

  • Conclusion in Context: We do not have convincing statistical evidence to conclude that the distribution of player class choices is different from what the company claimed.


Problem 2:

A school administrator wants to know if the distribution of after-school activity preferences (Sports, Arts, Clubs, None) is the same for middle school students and high school students. She takes a random sample of 150 middle schoolers and a separate random sample of 200 high schoolers and records their preferences. The results are in the table below. Does this data provide convincing evidence of a difference in preference distributions between the two school levels?

PreferenceMiddle SchoolHigh School
Sports6070
Arts3540
Clubs3060
None2530

Solution:

STATE:

  • Test: We will perform a Chi-Square Test for Homogeneity.

  • Justification: We are comparing the distribution of a single categorical variable (activity preference) across two independent populations (middle schoolers and high schoolers).

  • Hypotheses:

    • H₀: The distribution of after-school activity preference is the same for middle school and high school students.

    • Hₐ: The distribution of after-school activity preference is not the same for middle school and high school students.

  • Significance Level: α = 0.05 (not stated, so we assume).

PLAN:

  • Random: The problem states that two separate random samples were taken.

  • 10%: It is reasonable to assume 150 is less than 10% of all middle schoolers and 200 is less than 10% of all high schoolers at this school district.

  • Large Counts: All expected counts must be \ge 5. The formula is . The grand total is 150 + 200 = 350.

    • Smallest Row Total (None): 25+30 = 55. Smallest Column Total (Middle School): 150.

    • Smallest Expected Count (None, Middle School): (55 * 150) / 350 = 23.57.

    • Since the smallest expected count is 23.57, all expected counts are \ge 5. The condition is met.

DO:

  • Formula: χ^2 = Σ [ (Observed - Expected)^2 / Expected ]

  • Calculated Values (from TI-84 using a 4x2 matrix):

    • Test Statistic: χ^2 = 6.795

    • Degrees of Freedom: df = (rows - 1)(cols - 1) = (4 - 1)(2 - 1) = 3

    • P-value: 0.0787

CONCLUDE:

  • Decision: Because the P-value of 0.0787 is greater than our significance level of α = 0.05, we fail to reject the null hypothesis.

  • Conclusion in Context: We do not have convincing statistical evidence to conclude that there is a difference in the distribution of after-school activity preferences between middle school and high school students.

Common Mistakes to Avoid

  • Confusing Homogeneity and Independence: This is the most common error. The tests are mechanically identical but conceptually different. Always ask: "How was the data collected?" If there are two or more separate samples, it's a test for Homogeneity. If there is one single sample with two variables measured, it's a test for Independence.

  • Stating Incorrect Hypotheses: The wording is crucial. For Homogeneity, you are comparing the distribution of one variable across groups. For Independence, you are looking for an association between two variables in one group. For GOF, you are comparing one sample's distribution to a claimed distribution. Do not mix them up.

  • Checking Conditions on Observed Counts: The "Large Counts" condition applies to expected counts, not observed counts. It is perfectly fine to have an observed count less than 5. You must calculate the expected counts (or use the calculator's matrix ) and verify that all of those values are at least 5.

  • Incorrect Degrees of Freedom: Memorize the two simple formulas. For GOF, it's . For both Homogeneity and Independence (two-way tables), it's . Using the wrong one will lead to an incorrect P-value.