AP Statistics • Inference for Categorical Data: Chi-Square

Carrying Out a Chi-Square Test for Goodness of Fit

Determine whether observed categorical data match a hypothesized distribution using the chi-square statistic and its p-value.

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

SECTION 1

Historical Context & Motivation

Long before modern computing made statistical tests routine, scientists needed a principled way to decide whether observed frequencies in categorical data were consistent with a theoretical model. Gregor Mendel, for instance, reported ratios of plant traits that were suspiciously close to his predicted 3:1 ratios—so close, in fact, that later statisticians questioned whether the data had been selectively reported. The fundamental question is deceptively simple: when observed counts deviate from expected counts, is the discrepancy large enough to reject the proposed model, or could random sampling variability alone explain the difference? The chi-square goodness-of-fit test was developed precisely to answer this question, providing a single numerical summary—the chi-square statistic—that quantifies the overall departure of observed data from a hypothesized distribution.

1900 • Karl Pearson Introduces the Chi-Square Test

Karl Pearson publishes 'On the Criterion that a Given System of Deviations from the Probable in the Case of a Correlated System of Variables Is Such that It Can Be Reasonably Supposed to Have Arisen from Random Sampling,' establishing the chi-square statistic as a formal inferential tool.

1922 • Fisher Refines Degrees of Freedom

R. A. Fisher demonstrates that the correct degrees of freedom for the chi-square goodness-of-fit test equal the number of categories minus one, correcting Pearson's original formulation and sparking a famous debate between the two statisticians.

1936 • R. A. Fisher and Mendel's Data

Fisher applies the chi-square test to Mendel's pea data and concludes the results are 'too good to be true,' illustrating how the test can detect both excess deviation and suspiciously small deviation from expected values.

2000s • Modern Calculator and Software Era

Graphing calculators (TI-83/84) and software such as R and Python make chi-square p-value computation instantaneous, shifting pedagogical emphasis from table lookup to conceptual understanding and interpretation of results.

The chi-square goodness-of-fit test remains one of the most widely used procedures in statistics because it addresses a question that arises constantly in practice: does an observed categorical distribution match a specific theoretical or claimed model? Whether you are testing whether a die is fair, whether genetics ratios conform to Mendelian predictions, or whether market share proportions have changed, the mechanics of the test are the same. In this lesson, we focus on carrying out the test—computing the test statistic, finding the p-value, and drawing a conclusion in context—after the hypotheses have been stated and conditions verified.

SECTION 2

Core Principles & Definitions

Before computing anything, it helps to have a clear mental model of what the chi-square goodness-of-fit test is doing. You begin with a single categorical variable whose possible outcomes define k categories. You have a sample of n observations, and you count how many fall in each category—these are the observed counts. Under the null hypothesis, you claim that the population follows a specific probability distribution; multiplying each hypothesized proportion by n yields the expected counts. The test statistic aggregates the squared deviations between observed and expected counts, each standardized by the expected count, producing a single nonnegative number that measures total discrepancy.

1

Observed Counts (O)

The actual tallied frequencies from your sample data for each category. These are empirical—straight from the data you collected.
2

Expected Counts (E)

The counts you would expect if the null hypothesis were true: E = n × p₀, where p₀ is the hypothesized proportion for each category.
3

Chi-Square Statistic (χ²)

Sum of (O − E)² / E across all categories. Measures total standardized discrepancy between observed and expected counts.
4

Degrees of Freedom (df)

For a goodness-of-fit test, df = k − 1, where k is the number of categories. This determines which chi-square distribution to use for the p-value.
5

P-Value

The probability of obtaining a χ² value at least as large as the observed one, assuming H₀ is true. Computed from the right tail of the χ² distribution with df = k − 1.
✦

KEY TAKEAWAY

Think of the chi-square statistic as a quality-control inspector examining a shipment. The inspector checks each item category (color, size, type) against the purchase order (expected counts). Small deviations are normal—random variation is inevitable. But if the cumulative discrepancy across all categories exceeds a threshold, the inspector rejects the shipment. The χ² statistic is that cumulative discrepancy measure, and the p-value tells you how surprising that level of discrepancy would be if the shipment truly matched the order.

SECTION 3

Visual Explanation: Anatomy of the Chi-Square Calculation

The following diagram illustrates the complete flow of a chi-square goodness-of-fit test, from raw data to conclusion. Each category contributes its own component to the overall χ² statistic, and these components are summed to produce the test statistic. Notice how categories with large deviations between observed and expected counts contribute disproportionately to the total—this is by design, since the squaring in the numerator penalizes large discrepancies more heavily.

Chi-Square Goodness-of-Fit: Calculation FlowSample Data → Count observations in each categoryn = total sample size, k = number of categoriesCategory 1O₁ = 35E₁ = 40Category 2O₂ = 50E₂ = 40Category 3O₃ = 42E₃ = 40Category 4O₄ = 33E₄ = 40(35−40)²/40= 0.625(50−40)²/40= 2.500(42−40)²/40= 0.100(33−40)²/40= 1.225Σ componentsχ² = 4.450Compare to χ² distribution with df = 4 − 1 = 3p-value = P(χ² ≥ 4.450) → Draw conclusion
Each category contributes a component (O − E)²/E to the overall χ² statistic. Category 2 contributes the most (2.500) because its observed count (50) deviates most from the expected count (40). The components sum to χ² = 4.450 with df = 3.

In the diagram above, notice that every category contributes to the total χ² statistic, but categories where the observed count diverges substantially from the expected count drive the statistic upward. Category 2, with an observed count of 50 versus an expected count of 40, contributes 2.500—more than half the total χ² of 4.450. This characteristic makes the chi-square statistic sensitive to individual categories that are far from their expected values. When interpreting your results, examining which categories contribute the most to χ² provides valuable insight into where the model breaks down if H₀ is ultimately rejected.

SECTION 4

Mathematical Framework

The mathematical machinery of the chi-square goodness-of-fit test centers on three formulas. The first defines the expected counts under H₀, the second computes the test statistic, and the third identifies the reference distribution used to obtain the p-value. Together, these three components form the complete computational pipeline for carrying out the test.

EXPECTED COUNTS

Ei=n×p0iEᵢ = n × p₀ᵢ

Where n is the total sample size and p₀ᵢ is the hypothesized proportion for category i under H₀. Each expected count represents how many observations you would anticipate in category i if the null model were true.

CHI-SQUARE TEST STATISTIC

χ2=Σ(Oi−Ei)2/Eiχ² = Σ (Oᵢ − Eᵢ)² / Eᵢ

Sum over all k categories. Oᵢ is the observed count and Eᵢ is the expected count for category i. Squaring ensures all deviations are nonnegative; dividing by Eᵢ standardizes each component so that categories with large expected counts do not automatically dominate the sum.

DEGREES OF FREEDOM

df=k−1df = k − 1

Where k is the number of categories. One degree of freedom is lost because the observed counts must sum to n, creating a linear constraint. The p-value is then P(χ² ≥ observed χ²) using a chi-square distribution with df = k − 1.

A few important details about the test statistic deserve emphasis. First, the chi-square statistic is always nonnegative because every component involves a squared difference divided by a positive expected count. Second, the test is always one-sided (right-tailed): large values of χ² provide evidence against H₀, while small values suggest the data are consistent with the null model. There is no concept of a 'left-tailed' chi-square goodness-of-fit test. Third, the chi-square distribution with df = k − 1 serves as the reference distribution only when the conditions are met—specifically, the sample is random and all expected counts are at least 5. When you use a TI-83/84 calculator, the χ²-Test or χ² GOF-Test function computes both the test statistic and the p-value directly.

💡

Calculator Tip: TI-83/84

Enter observed counts in L1 and expected counts in L2. Then navigate to STAT → TESTS → χ² GOF-Test (or D:χ²GOF-Test on newer models). Input L1 for Observed, L2 for Expected, and the correct df. The calculator returns the χ² statistic and the p-value. On the AP Exam, you must still show the formula and the value of the test statistic—do not rely solely on the calculator output.

SECTION 5

The Chi-Square Distribution and P-Value

The chi-square distribution is a family of right-skewed distributions, each characterized by its degrees of freedom. As df increases, the distribution becomes more symmetric and shifts to the right—its mean equals df and its standard deviation equals √(2 × df). For a goodness-of-fit test with k categories, the reference distribution has df = k − 1. The p-value corresponds to the area under this curve to the right of the computed χ² statistic. A small p-value indicates that the observed data would be very unlikely if H₀ were true, providing evidence for rejecting the null hypothesis.

Chi-Square Distributions by Degrees of Freedomχ² valueDensity03691215df = 2df = 4df = 6df = 10Key Properties• Always right-skewed• Always ≥ 0• Mean = df• SD = √(2 × df)P-value = area to the RIGHT of observed χ²
Chi-square distributions for df = 2, 4, 6, and 10. As degrees of freedom increase, the distribution shifts rightward, its peak flattens, and it becomes more symmetric. The p-value is always the right-tail area beyond the observed χ² value.

When interpreting the p-value, compare it to your predetermined significance level α (commonly 0.05 on the AP Exam). If the p-value is less than α, you reject H₀ and conclude that there is convincing evidence that the distribution of the categorical variable differs from the hypothesized distribution. If the p-value is greater than or equal to α, you fail to reject H₀, meaning the data do not provide sufficient evidence to conclude the distribution differs from the claimed model. Always state your conclusion in context of the problem—never simply say 'reject H₀' without explaining what that means for the specific situation.

⚠

AP Exam Scoring Note

On the AP Statistics exam, a complete conclusion requires four elements: (1) an explicit comparison of the p-value to α, (2) a decision to reject or fail to reject H₀, (3) a statement in context about the population, and (4) linkage using language of evidence ('convincing evidence' or 'sufficient evidence'). Omitting any of these elements typically costs scoring points.

SECTION 6

Worked Example: M&M Color Distribution

A statistics student suspects that the color distribution of M&M's in a large bag does not match the company's published percentages. The company claims the following distribution: 24% blue, 20% orange, 16% green, 14% yellow, 13% red, and 13% brown. The student takes a random sample of 200 M&M's and records the following observed counts: Blue = 53, Orange = 38, Green = 35, Yellow = 27, Red = 22, Brown = 25. Carry out a chi-square goodness-of-fit test at the α = 0.05 significance level. (Assume the hypotheses have been stated and conditions verified.)

Chi-Square Goodness-of-Fit Test: M&M Color Distribution

  1. 1

    Step 1 — Compute Expected Counts

    Multiply the total sample size n = 200 by each hypothesized proportion: E(Blue) = 200 × 0.24 = 48, E(Orange) = 200 × 0.20 = 40, E(Green) = 200 × 0.16 = 32, E(Yellow) = 200 × 0.14 = 28, E(Red) = 200 × 0.13 = 26, E(Brown) = 200 × 0.13 = 26. Verify: 48 + 40 + 32 + 28 + 26 + 26 = 200 ✓. All expected counts are ≥ 5, confirming the conditions are met.
    Expected counts: 48, 40, 32, 28, 26, 26
  2. 2

    Step 2 — Compute Each Component of χ²

    For each category, compute (O − E)²/E. Blue: (53 − 48)²/48 = 25/48 ≈ 0.5208. Orange: (38 − 40)²/40 = 4/40 = 0.1000. Green: (35 − 32)²/32 = 9/32 ≈ 0.2813. Yellow: (27 − 28)²/28 = 1/28 ≈ 0.0357. Red: (22 − 26)²/26 = 16/26 ≈ 0.6154. Brown: (25 − 26)²/26 = 1/26 ≈ 0.0385.
    Components: 0.521, 0.100, 0.281, 0.036, 0.615, 0.038
  3. 3

    Step 3 — Sum to Get the Test Statistic

    χ² = 0.5208 + 0.1000 + 0.2813 + 0.0357 + 0.6154 + 0.0385 = 1.5917. Rounding appropriately, χ² ≈ 1.592.
    χ² = 1.592
  4. 4

    Step 4 — Determine Degrees of Freedom and P-Value

    There are k = 6 categories, so df = 6 − 1 = 5. Using a TI-84 calculator: χ²cdf(1.592, 1E99, 5) ≈ 0.902. Alternatively, looking at a chi-square table, the critical value for α = 0.05 with df = 5 is 11.07; since 1.592 is far below 11.07, the p-value is clearly much larger than 0.05.
    p-value ≈ 0.902, df = 5
  5. 5

    Step 5 — State the Conclusion in Context

    Because the p-value (0.902) is greater than α = 0.05, we fail to reject H₀. There is not convincing evidence that the distribution of M&M colors in this bag differs from the company's published color distribution. The observed deviations from the claimed percentages are small enough to be plausibly attributed to random sampling variability.
    Fail to reject H₀. No convincing evidence of a difference.

Five observed versus expected candy counts for a 150-candy example. Expected counts include 45,30,30,22.5,22.5. Sampling from one bag does not establish company-wide inference.Observed color counts from one purchased bag can be compared with the stated model, but this design does not establish company-wide inference.

Five-category, 150-candy illustration. This does not replace the separate six-category, 200-candy worked example.

SECTION 7

Common Errors & Best Practices

Students frequently lose points on AP free-response questions not because they cannot calculate χ², but because they make procedural or interpretive mistakes. The table below contrasts common errors with the corresponding best practices. Internalizing these distinctions can make the difference between partial and full credit.

Common ErrorBest PracticeWhy It Matters
Using proportions instead of counts in the formulaAlways use raw counts (O and E) in the χ² formula, not percentages or proportionsThe formula requires counts; using proportions yields an incorrect (too small) χ² value
Using observed counts in the denominator: (O − E)²/OThe denominator is always the expected count E, not the observed count OStandardization by E is what connects the statistic to the χ² distribution
Saying 'accept H₀' instead of 'fail to reject H₀'Use 'fail to reject H₀'—a non-significant result does not prove H₀ is trueAccepting H₀ implies certainty that H₀ is true, which is logically unjustified
Failing to state the conclusion in contextAlways reference the specific categorical variable and population in your conclusionThe AP rubric requires contextual language—generic conclusions lose points
Computing a two-tailed p-valueThe chi-square GOF test is always right-tailed; large χ² values provide evidence against H₀The chi-square distribution is not symmetric, so 'two-tailed' has no meaning here

Common errors and best practices for chi-square goodness-of-fit tests

✦

KEY TAKEAWAY

The chi-square test is like a structured argument in a courtroom. The null hypothesis is 'innocent until proven guilty'—you assume the claimed distribution is correct. The χ² statistic is the strength of the evidence. The p-value tells the jury how likely it is that evidence this strong (or stronger) would appear if the defendant really were innocent. If the p-value is very small, the jury convicts (rejects H₀). If the p-value is large, the jury doesn't declare the defendant innocent—they simply say there isn't enough evidence to convict (fail to reject H₀).

SECTION 8

Connection to Other Chi-Square Tests

The chi-square goodness-of-fit test is one member of a family of chi-square procedures. All three share the same test statistic formula—Σ(O − E)²/E—but they differ in the research question, the data structure, and the degrees of freedom. Understanding these distinctions helps you select the correct test on the AP Exam and in practice.

FeatureGoodness of FitTest of IndependenceTest of Homogeneity
Number of variablesOne categorical variableTwo categorical variables, one sampleOne categorical variable across multiple populations
H₀Distribution matches a specified modelThe two variables are independentThe distribution is the same across populations
Data structureOne-way frequency tableTwo-way contingency tableTwo-way contingency table
Degrees of freedomk − 1(r − 1)(c − 1)(r − 1)(c − 1)
Expected counts fromn × p₀ᵢ (hypothesized proportions)(row total × column total) / n(row total × column total) / n

Comparison of the three chi-square tests in AP Statistics

As you progress through the chi-square unit, you will see that mastering the goodness-of-fit procedure gives you a strong foundation for the other two tests. The computational machinery is identical; only the source of expected counts and the interpretation of the hypotheses change. In more advanced coursework, you may encounter likelihood-ratio tests (G-tests), which use a different formula to measure discrepancy but follow the same logical framework. The Pearson chi-square statistic remains the standard approach in introductory statistics courses and on the AP Exam because it is intuitive, computationally accessible, and performs well under the conditions typically encountered in practice.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A chi-square goodness-of-fit test is performed with 5 categories and a sample of 200 observations. The computed test statistic is χ² = 2.10. Which of the following is the most accurate interpretation of this result?
  • A. The observed counts are exactly equal to the expected counts in all 5 categories.
  • B. There is convincing evidence that the distribution differs from the hypothesized model.
  • C. The observed counts differ only slightly from the expected counts, and the differences are consistent with random sampling variability.
  • D. The hypothesized distribution has been proven to be correct.
  • E. The test is invalid because χ² must be at least 5 to draw any conclusion.
Show answer (C)
C is correct. With df = 5 − 1 = 4, a χ² value of 2.10 is well below the mean of the distribution (which equals df = 4), indicating small deviations from expected counts. The p-value would be quite large (approximately 0.72), meaning the data are consistent with random sampling variability. A is wrong because χ² = 2.10 > 0, so the counts are not exactly equal. B is wrong because a small χ² yields a large p-value, providing no evidence against H₀. D is wrong because failing to reject H₀ does not prove it true—we cannot 'accept' or 'prove' H₀. E is wrong because there is no minimum threshold for the χ² statistic itself; the threshold applies to expected counts (all ≥ 5), not the test statistic.

Question 2: BASIC CALCULATION

A genetics student crosses plants and observes the following offspring phenotypes: Tall = 78, Short = 22 (n = 100). According to Mendelian theory, the expected ratio is 3:1 (75% Tall, 25% Short). What is the value of the chi-square test statistic?
  • A. χ² = 0.12
  • B. χ² = 0.48
  • C. χ² = 0.84
  • D. χ² = 1.20
  • E. χ² = 3.00
Show answer (B)
B is correct. Expected counts: E(Tall) = 100 × 0.75 = 75, E(Short) = 100 × 0.25 = 25. χ² = (78 − 75)²/75 + (22 − 25)²/25 = 9/75 + 9/25 = 0.12 + 0.36 = 0.48. A (0.12) only includes the first category's component, omitting the second. C (0.84) and D (1.20) result from arithmetic errors such as using the wrong expected counts. E (3.00) would come from forgetting to square the differences and then miscalculating, or from confusing the expected ratio values with the formula components.

Question 3: INTERMEDIATE

A researcher claims that customer complaints at a restaurant are equally distributed across Monday through Friday (5 days). Over a period of time, the following complaint counts are recorded: Mon = 18, Tue = 12, Wed = 8, Thu = 14, Fri = 28 (n = 80). The chi-square test statistic is χ² = 14.00 with df = 4. Using the chi-square distribution table, the critical value at α = 0.01 with 4 degrees of freedom is 13.28. What is the correct conclusion?
  • A. Because χ² = 14.00 > 13.28, the p-value < 0.01, so we reject H₀. There is convincing evidence that complaints are not equally distributed across weekdays.
  • B. Because χ² = 14.00 > 13.28, the p-value > 0.01, so we fail to reject H₀.
  • C. Because χ² = 14.00 < 16, we cannot reject H₀ at any significance level.
  • D. We accept H₀ and conclude the distribution is uniform because the difference is small.
  • E. The test is inconclusive because the expected count for each day is 16, which is close to several observed counts.
Show answer (A)
A is correct. When the test statistic (14.00) exceeds the critical value at α = 0.01 (13.28), the p-value falls below 0.01, leading us to reject H₀ at the 1% significance level. In context, there is convincing evidence that restaurant complaints are not equally distributed across weekdays. B reverses the relationship between the test statistic exceeding the critical value and the p-value—when χ² exceeds the critical value, the p-value is less than α, not greater. C introduces an arbitrary threshold of 16 that has no statistical basis. D incorrectly uses the phrase 'accept H₀,' which is never appropriate in hypothesis testing. E is incorrect because closeness of some observed counts to expected counts is irrelevant when the overall χ² statistic is significant—what matters is the aggregate discrepancy.

Question 4: APPLIED

4 pts
A city transportation department records the number of bus passengers at each of 4 major stops over a month. The department's budget model assumes passengers are distributed as follows: Stop A = 35%, Stop B = 25%, Stop C = 25%, Stop D = 15%. A random sample of n = 500 passengers yields: Stop A = 192, Stop B = 118, Stop C = 115, Stop D = 75. (a) State the null and alternative hypotheses. (b) Compute the expected counts and verify the conditions for the test. (c) Calculate the chi-square test statistic. (d) Find the p-value using a calculator or chi-square table, and state your conclusion at α = 0.05.
Show answer
Point 1 — Hypotheses (1 point): H₀: The distribution of bus passengers across the four stops is 35% at Stop A, 25% at Stop B, 25% at Stop C, and 15% at Stop D. Hₐ: The distribution of bus passengers differs from the budget model's assumed proportions. (Note: H₀ must specify all proportions; Hₐ states at least one proportion differs.) Point 2 — Expected counts and conditions (1 point): E(A) = 500 × 0.35 = 175, E(B) = 500 × 0.25 = 125, E(C) = 500 × 0.25 = 125, E(D) = 500 × 0.15 = 75. All expected counts are ≥ 5 ✓. The problem states the sample is random ✓. The individual observations are assumed to be independent (passengers are less than 10% of all passengers) ✓. Point 3 — Test statistic (1 point): χ² = (192 − 175)²/175 + (118 − 125)²/125 + (115 − 125)²/125 + (75 − 75)²/75 = 289/175 + 49/125 + 100/125 + 0/75 = 1.6514 + 0.3920 + 0.8000 + 0.0000 = 2.8434. So χ² ≈ 2.843 with df = 4 − 1 = 3. Point 4 — P-value and conclusion (1 point): Using χ²cdf(2.843, 1E99, 3) ≈ 0.416. Since the p-value (0.416) > α (0.05), we fail to reject H₀. There is not convincing evidence that the distribution of bus passengers across the four stops differs from the budget model's assumed distribution of 35%, 25%, 25%, 15%.

Question 5: CRITICAL THINKING

4 pts
A candy manufacturer claims that bags of jelly beans contain colors in the proportions: Red = 30%, Yellow = 25%, Green = 20%, Orange = 15%, Purple = 10%. A consumer advocacy group samples 400 jelly beans and obtains χ² = 11.67 with 4 degrees of freedom (p ≈ 0.020). (a) State the conclusion of the test at α = 0.05 in context. (b) The group discovers that the largest component of χ² is from the Purple category, where 58 purple jelly beans were observed. Calculate the expected count for Purple and this category's contribution to χ². Explain what this tells us about the manufacturer's claim. (c) If the consumer group had used α = 0.01 instead, would the conclusion change? Justify your answer. (d) A second sample of 400 jelly beans yields χ² = 3.42 with p ≈ 0.490. How should the group reconcile these conflicting results? Discuss what factors might explain the discrepancy.
Show answer
Point 1 — Conclusion at α = 0.05 (1 point): Since the p-value (0.020) < α (0.05), we reject H₀. There is convincing evidence that the distribution of jelly bean colors in the manufacturer's bags differs from the claimed proportions of 30% Red, 25% Yellow, 20% Green, 15% Orange, and 10% Purple. Point 2 — Purple category analysis (1 point): Expected count for Purple: E = 400 × 0.10 = 40. Contribution to χ² = (58 − 40)²/40 = 324/40 = 8.10. This single category accounts for 8.10/11.67 ≈ 69.4% of the total χ² statistic. This strongly suggests that the primary source of the discrepancy is that the bags contain substantially more purple jelly beans than the 10% claimed by the manufacturer, while the other colors are relatively consistent with the claimed distribution. Point 3 — Effect of changing α to 0.01 (1 point): Since the p-value (0.020) > 0.01, we would fail to reject H₀ at α = 0.01. The conclusion would change: at the 1% significance level, there is not convincing evidence that the color distribution differs from the manufacturer's claim. This illustrates how the choice of significance level directly affects the decision—the same data can lead to different conclusions depending on the standard of evidence required. Point 4 — Reconciling conflicting results (1 point): Possible explanations include natural batch-to-batch variability in the manufacturing process, sampling variability (even if the true distribution differs slightly from the claim, not every sample of 400 will detect the difference), or the first sample may have come from an unusual batch. The fact that one sample rejects and another does not is consistent with the true distribution being only slightly different from the claimed one—in such cases, a test with n = 400 has limited power, and some samples will detect the difference while others will not. The group should consider pooling data from multiple samples, increasing sample size for greater power, or conducting a formal power analysis to determine how large a sample is needed to reliably detect a meaningful departure from the claimed proportions.

SUMMARY

Summary

Summary

The chi-square goodness-of-fit test evaluates whether the distribution of a single categorical variable matches a hypothesized model. You compute expected counts as Eᵢ = n × p₀ᵢ, then calculate the test statistic χ² = Σ(Oᵢ − Eᵢ)²/Eᵢ, which measures the total standardized discrepancy between observed and expected counts across all k categories. The test uses df = k − 1 degrees of freedom, and the p-value is always computed from the right tail of the chi-square distribution.

A complete AP-level response includes: stating hypotheses, verifying that all expected counts are at least 5 and the sample is random, showing the formula and computed value of χ², reporting the p-value with df, comparing it to α, and stating a conclusion in context using appropriate language of evidence. Remember: you reject H₀ when the p-value < α, and you fail to reject (never 'accept') H₀ otherwise. Examining which categories contribute the most to χ² reveals where the hypothesized model fits poorly.

Varsity Tutors • AP Statistics • Carrying Out a Chi-Square Test for Goodness of Fit