Chi-Square Tests

Learn how to test claims about categorical data with chi-square tests. Compare observed counts with the counts a hypothesis predicts, test whether one variable fits a claimed distribution, and use two-way tables to test independence and homogeneity. Check the conditions behind each test, choose the right test for a study design, report the results with their size and limits, and use the chi-square distribution to test a claim about one population variance.

BeginnerLesson 11 of 12 in Introduction to Statistics Course

What you will learn

  1. Describe the family of chi-square distributions, find tail areas and critical values, and see how one statistic measures the distance between the counts you observe and the counts a hypothesis predicts.
    • Describe the chi-square distribution and find its tail areas
      Recognize the shape of chi-square curves, connect it to the degrees of freedom, and find right-tail areas and critical values with a table or technology.
    • Compare observed counts with expected counts
      Organize categorical data as counts, find the counts a hypothesis predicts, and combine the differences into the chi-square statistic.
  2. Carry out a chi-square goodness-of-fit test from the hypotheses and expected counts through to a conclusion in context, and explain which categories drive the result.
    • Set up the hypotheses and expected counts
      Turn a claim about category proportions into hypotheses, compute the counts the claim predicts for the sample, and find the degrees of freedom.
    • Carry out the goodness-of-fit test
      Check the conditions, compute the statistic, degrees of freedom and p-value, and state the conclusion in the context of the question.
    • Interpret the result and follow up
      Find the categories that contribute most, handle small expected counts and estimated parameters, and word the conclusion without claiming more than the test shows.
  3. Summarize two categorical variables in a contingency table, compute the counts expected under no association, and carry out and interpret the tests of independence and homogeneity.
    • Read a two-way table and describe association
      Organize two categorical variables in a contingency table and use conditional percentages to describe whether and how they are associated in the sample.
    • Find expected counts and degrees of freedom for a two-way table
      Compute the count each cell would have if the variables were not associated, use the table's totals to check them, and find the degrees of freedom.
    • Carry out and interpret the test of independence
      Test whether two categorical variables measured on one sample are associated in the population, and explain what the result does and does not show.
    • Carry out and interpret the test of homogeneity
      Compare the distribution of one categorical variable across several populations or treatment groups, and tell this design apart from the test of independence.
  4. Decide which chi-square procedure fits a question and a study design, judge whether its conditions hold and what to do when they fail, report results responsibly, and use the chi-square distribution to test a claim about one population variance.
    • Check the conditions and handle small expected counts
      Explain why the chi-square tests on counts need random, independent count data with large enough expected counts, and know what to do when a condition fails.
    • Choose the right test and report the results
      Match a question and a study design to the right test, connect chi-square tests with z tests, and report results with their size and limits.
    • Test a claim about one population variance
      Use the chi-square distribution to test a claim about the variance or standard deviation of a normal population, with right-, left- or two-tailed alternatives.

Chi-Square Test study guide

4 chapters

1

Understand the curve and the statistic

Counts rarely match a prediction exactly. A useful test needs a way to measure the gaps and a reference curve that shows how much variation to expect. Chi-square methods provide both. Start by reading the family of curves and their tail areas, then build the statistic from observed and expected counts. The degrees of freedom connect the calculation to the curve; the sample size explains why identical percentages can carry different amounts of evidence.

1.1 Read chi-square curves and tail areas

A chi-square curve describes how a nonnegative statistic varies from sample to sample. Its shape depends on the degrees of freedom, usually shortened to df. Read the symbol χ2 as “chi-square”; “chi-squared” means the same thing.

Where the curve comes from

Start with independent standard normal variables, each centered at 0 with standard deviation 1. Square each value and add the squares. With k variables, the sum Z12+⋯+Zk2 has a chi-square distribution with k df. Squares cannot be negative, so neither can their sum.

For 1 or 2 df, the curve is highest near the left edge and falls toward the right. For 3 or more df, it rises from 0 to a peak at df−2 and then falls with a long right tail. Increasing df moves the curve right, spreads it out, and makes it more symmetric. At large df it looks close to a normal curve.

The mean is df, the variance is 2 df, and the standard deviation is 2 df. At 4 df these are 4, 8, and about 2.83. The mean lies to the right of the peak because large values in the right tail pull it upward. A statistic of 8 is above the mean at 4 df but below the mean at 10 df: its size has meaning only alongside its df.

Turn a statistic into an area

The total area under the curve is 1. In tests of categorical counts, large statistics represent large gaps from the null model. The p-value is the area to the right of the observed statistic:

p=P(χdf2≥χobs2).

With 4 df and a statistic of 3, that area is about 0.558. A value at least this large is common under the null model. No doubling is needed: the right tail already represents all discrepancies at least this large, in either direction in the original counts.

A critical value marks the cutoff for a selected tail area. For a 0.05 right-tail area, the values are:

dfCritical value
13.841
25.991
37.815
49.488
511.070
1018.307

Find the df row first, then the tail-area column. With 3 df, 10.19 lies between 9.348, the cutoff for 0.025, and 11.345, the cutoff for 0.01. Thus 0.01<p<0.025. A larger cutoff leaves a smaller area to its right. Check whether a table labels left areas or right areas before reading it.

Use technology

In Excel or Google Sheets, CHISQ.DIST.RT(3, 4) returns about 0.558. CHISQ.INV.RT(0.05, 4) returns about 9.488. CHISQ.DIST(3, 4, TRUE) gives the left area, about 0.442. In R, use pchisq(3, 4, lower.tail = FALSE) for the right area. On a TI-84, use χ²cdf with lower limit 3, upper limit 1E99, and 4 df.

The 1-df case connects to a familiar normal cutoff: 1.962=3.8416. Squaring combines the two normal tails beyond −1.96 and +1.96 into the single chi-square right tail beyond about 3.84.

Key Takeaways

  • A chi-square value is nonnegative; df determines the curve used to interpret it.
  • The mean is df and the standard deviation is 2 df.
  • Count tests use the right-tail area as the full p-value.
  • A table brackets an area; technology can calculate it more precisely.
  • Check the df and the tail convention before using a critical value.

1.2 Measure gaps between counts

Categorical data sort individuals into groups, such as car, public transit, bike, and walk for a commuter’s main way to work. Categories must cover everyone and must not overlap. Each individual contributes one count to one category of each variable.

Observed and expected counts

An observed count, O, is what the sample contains. An expected count, E, is what the null hypothesis predicts on average for a sample of the same size. If a category has claimed proportion p in a sample of size n, then E=np. Both sets of counts must add to n. Expected counts describe an average over possible samples, so values such as 312.75 are valid. Keep them as decimals.

The chi-square statistic combines the gaps:

χ2=∑(O−E)2E.

For every category, subtract expected from observed, square the gap, divide by expected, and add. Squaring stops positive and negative gaps from canceling. Dividing by expected puts the gap on a scale that reflects the category’s size. A gap of 10 contributes 5 when 20 are expected, since 102/20=5. The same gap contributes only 0.1 when 1,000 are expected.

A coin example

A coin lands heads 58 times and tails 42 times in 100 independent tosses. Under a fair-coin hypothesis the expected counts are 50 and 50.

ResultObservedExpectedContribution
Heads5850(58−50)2/50=1.28
Tails4250(42−50)2/50=1.28

The sum is χ2=2.56. There are 1 df, and the right-tail area is about 0.11. At a 0.05 significance level, do not reject the fair-coin hypothesis: these tosses give no convincing evidence of unfairness.

The one-proportion z statistic is z=(0.58−0.50)/0.5(0.5)/100=1.6. Squaring gives z2=2.56. For two categories, the uncorrected chi-square test agrees with the two-sided one-proportion z test. Squaring removes the sign, which is why the chi-square result corresponds to a two-sided z test.

What the statistic and p-value mean

The statistic is 0 exactly when every observed count equals its expected count. Large values indicate disagreement with the null model. With large enough expected counts, the statistic’s null distribution is approximately chi-square. The p-value asks how often a statistic at least this large would occur assuming the null hypothesis is true. It does not assign a probability to the truth of that hypothesis.

Use the chosen significance level α: reject when p≤α; otherwise, do not reject. The test needs actual counts. If the same 58% heads comes from 200 tosses, the observed counts are 116 and 84, the expectations are 100 each, and the statistic doubles to 5.12, with p about 0.024. Treating percentages as counts would lose this sample-size information.

Include every category, even an observed zero. Use expected counts in the denominators. Goodness of fit compares one variable to a claimed distribution; independence examines two variables in one sample; homogeneity compares one variable across groups. All three use this same sum of contributions.

Key Takeaways

  • Observed counts come from the data; expected counts come from the null model.
  • Add (O−E)2/E over every category or cell, including observed zeros.
  • Keep decimal expected counts and calculate with counts, not percentages.
  • A p-value describes possible data under the null hypothesis.
  • The same percentages can produce different p-values at different sample sizes.
  • With two categories, the uncorrected statistic equals the squared two-sided z statistic.
2

Test a claimed category distribution

A claim about category shares predicts a complete set of counts for a random sample. Goodness of fit compares those predictions with the sample and turns the overall gap into evidence. The work starts with clear population hypotheses and ends with a conclusion in context. Contributions and percentages then help explain the result, while sparse categories and parameters estimated from the data require changes to the setup.

2.1 Build a claimed distribution

A goodness-of-fit test asks whether one categorical variable follows a particular distribution in a population. You take one random sample and compare its category counts with the counts the claim predicts. The comparison begins with population proportions, before any test statistic is calculated.

State the population claim

Suppose city records give commuting proportions of 60% car, 25% public transit, 10% bike, and 5% walk. The null hypothesis says these are the current population proportions:

H0:(pcar,ptransit,pbike,pwalk)=(0.60,0.25,0.10,0.05).

The alternative says at least one population proportion differs. It does not require every category to differ. There is no single direction such as “greater”: increasing one share forces another share to decrease because all shares add to 1.

Hypotheses concern the population. A sample will rarely reproduce every claimed percentage exactly, even when the population claim is right. The test assesses whether the sample’s overall disagreement is too large to explain comfortably through sampling variation.

Claims may come from equal shares, a scientific theory, past records, or a probability model. Equal weekday shares give five proportions of 0.20. A genetic ratio of 9 : 3 : 3 : 1 gives four proportions after conversion. A binomial model can predict the proportions of families with 0, 1, 2, or 3 girls.

Convert the claim into expected counts

First check that the proportions add to 1. For a ratio, divide each part by the sum of the parts. The ratio 9 : 3 : 3 : 1 has 16 parts, giving proportions 9/16,3/16,3/16,1/16, or 0.5625, 0.1875, 0.1875, and 0.0625.

Then calculate each expectation:

Ei=npi,0.

In a sample of 400 commuters, the city claim gives expectations of 240 car, 100 public transit, 40 bike, and 20 walk. Their sum is 400. For 556 seeds and the genetic ratio, expectations are 312.75, 104.25, 104.25, and 34.75. Their decimal parts are meaningful; rounding them to whole seeds changes the calculation.

Check the sum before continuing. A mismatch can reveal an omitted category, a percentage entered as 25 instead of 0.25, or a set of claimed shares that was never a complete distribution. Do not estimate these claimed shares from the sample’s observed percentages when testing an outside claim. That would make every expectation equal its observed count and force the statistic to 0.

Find the degrees of freedom

With k categories whose proportions are fully specified in advance,

df=k−1.

The subtraction accounts for the fixed sample total: after k−1 counts are known, the remaining count is determined by subtraction. Both the four-category commuter test and the four-category seed test have 3 df. Increasing the sample from 400 to 800 changes expected counts but leaves those 3 df unchanged.

The formula uses the number of categories, not the sample size. The expression n−1 belongs to the single-variance test, where the data are measurements. When a model parameter is estimated from the count data, the goodness-of-fit df also need an adjustment.

Key Takeaways

  • Goodness of fit compares one categorical variable with specified population proportions.
  • The alternative says that at least one proportion differs.
  • Convert ratios to proportions and check that the proportions sum to 1.
  • Expected counts equal sample size times claimed proportion and sum to the sample size.
  • With fully specified proportions, df equals the number of categories minus 1.

2.2 Complete a goodness-of-fit test

A goodness-of-fit calculation is useful only when its reference curve fits the data collection and expected counts. Set the hypotheses and significance level first, then check the conditions before interpreting the p-value.

Check the data

The data should come from a random sample or a process that behaves like one. Observations must be independent: each individual is counted once, and one outcome does not determine another. When sampling without replacement, keep the sample below about 10% of the population. Use a count for each category.

The standard expected-count rule is every expected count at least 5. Check expectations, not observations. Some textbooks use the looser guideline that all expectations are at least 1 and no more than 20% are below 5. The rule used in the calculations here is the all-at-least-5 rule.

Work through the commuter test

A random sample of 400 commuters gives 210 car, 122 public transit, 48 bike, and 20 walk. Test the recorded 60%, 25%, 10%, and 5% distribution at α=0.05. The null states those population proportions; the alternative says at least one differs. Assume the sample is less than 10% of the city’s commuters and each person reports one main method.

The expected counts are 240, 100, 40, and 20. All are at least 5. Compute the contributions:

MethodCalculationContribution
Car(210−240)2/2403.75
Public transit(122−100)2/1004.84
Bike(48−40)2/401.60
Walk(20−20)2/200

Their sum is χ2=10.19. Four categories give df=4−1=3. The right-tail probability is about 0.017. Since 0.017<0.05, reject the null hypothesis. There is convincing evidence that the city’s current commuting distribution differs from its recorded proportions. This result identifies an overall difference; it does not establish a difference in every category.

The critical-value approach agrees: at 3 df the 5% right-tail cutoff is 7.815, below 10.19. Use either the p-value comparison or the critical value comparison, with the same significance level.

A result that does not reject

A gym records 150 sampled weekday check-ins: 36, 30, 27, 24, and 33 from Monday through Friday. Under equal shares, every expected count is 30. The squared gaps are 36, 0, 9, 36, and 9. Dividing their sum by 30 gives χ2=3.0 with 4 df and p about 0.558. At 0.05, do not reject equal shares. The data give no convincing evidence of unequal weekday shares; they do not establish exact equality. Repeated check-ins by the same member would need attention to independence before using this calculation for inference.

Get the result from software

On a TI-84 Plus, enter observed counts in L1 and expected counts in L2, then run χ²GOF-Test with the df. Excel or Google Sheets uses CHISQ.TEST(observed_range, expected_range) for a single row or column. In R, use chisq.test(c(210,122,48,20), p=c(0.60,0.25,0.10,0.05)).

Keep full precision until the final statistic. Read the right tail and compare p with the chosen level. Finish with a population conclusion that names the distribution being tested.

Key Takeaways

  • Check randomness, independent observations, and every expected count before testing.
  • Calculate all contributions, add them, and use the correct category-based df.
  • Reject when the right-tail p-value is at most the chosen significance level.
  • State the result about the population distribution in the context of the question.
  • Not rejecting leaves the claim consistent with the data; it does not establish exact equality.
  • An overall rejection does not identify every category as different.

2.3 Find the pattern behind the result

An overall rejection tells you that the claimed distribution misses some aspect of the population. To describe that gap, examine the category contributions, the direction of each gap, and the observed percentages. These answer different questions from the p-value.

Contributions and residuals

In the commuter test, public transit contributes 4.84 and car contributes 3.75 to the total statistic of 10.19. Bike contributes 1.60 and walk contributes 0. The biggest contributions show which categories drive the overall disagreement. Their signs were lost during squaring, so also inspect O−E: transit is above expectation, 122 against 100, and car is below expectation, 210 against 240.

A Pearson residual measures the signed gap on a standardized scale:

O−EE.

Its square is the category’s chi-square contribution. For the commuters the residuals are approximately −1.94, +2.20, +1.26, and 0. A residual beyond about ±2 draws attention to a category. Use this as a descriptive clue, not a separate significance test for that category. Statistical software may use “standardized residual” for a further adjusted quantity, so check the formula in its output.

Percentages put the pattern in familiar units: 30.5% took transit against the claimed 25%, while 52.5% drove against 60%. These differences help judge practical importance. A huge sample can produce a small p-value for a difference that has little practical effect.

Recognize close agreement

For 556 pea seeds, observed counts of 315, 108, 101, and 32 are close to the 9 : 3 : 3 : 1 expectations of 312.75, 104.25, 104.25, and 34.75. The statistic is about 0.47 with 3 df and p about 0.93. The ratio fits these data well, but nearby ratios could fit too.

Very close agreement can sometimes deserve scrutiny. A statistic far into the left tail means the counts fit unusually closely under the null model. The seed example’s left area, about 0.075, is not remarkable by itself. Fisher’s 1936 criticism concerned the combined agreement across many of Mendel’s experiments.

Handle sparse categories before testing

Suppose revised commuter claims are 59% car, 25% transit, 10% bike, 5% walk, and 1% other. For 400 people, expected counts are 236, 100, 40, 20, and 4. The last expectation fails the rule. Combining walk and other produces an expected count of 24, leaving four categories and 3 df. Combine the corresponding observed counts too.

Choose a grouping that makes sense from the category meanings and expectations. Do not search through groupings for a desired p-value. Larger samples or exact or simulation-based methods are alternatives; discarding a rare category loses data and changes the question.

Allow for fitted parameters

If the planned model estimates m parameters from the same category counts, use df=k−1−m with an appropriate fitting method. For numbers of girls in three-child families, four categories give 3 df when the binomial probability 0.5 is fixed in advance. Estimating that probability from the sample uses one more df, leaving 2. Plan the model, categories, and fitting procedure before examining the pattern. Choosing a claim just because it fits the observed counts invalidates the usual reference calculation.

Key Takeaways

  • Contributions locate large gaps; the sign of O−E gives their direction.
  • A Pearson residual is (O−E)/E; its square is the cell contribution.
  • Residuals near or beyond ±2 are descriptive flags, not individual category tests.
  • Compare observed percentages with claimed percentages to judge the size of a difference.
  • Combine related sparse categories on a defensible plan and recalculate df.
  • For a suitably fitted model, subtract one additional df per estimated parameter.
  • Choose the procedure before inspecting the data for a preferred result.
3

Analyze categorical groups

Two-way tables show how categorical variables occur together. Reading them well means choosing a denominator that matches the question and comparing percentages within groups. The same count calculation can test association in one population or compare distributions across populations. Expected tables describe what no difference would look like; the study design determines which hypotheses and conclusions belong with the calculation.

3.1 Read percentages within groups

A contingency table, or two-way table, counts combinations of two categorical variables. Each individual belongs in one cell. The margins hold row totals, column totals, and the grand total. These totals give several possible denominators, each answering a different question.

Read the counts and margins

A random sample of 300 adults reports exercise frequency and good or poor sleep:

Sleep qualityNo exercise1–2 days3 or more daysTotal
Good407090200
Poor403525100
Total80105115300

This is a 2×3 table: two sleep categories and three exercise categories. Totals summarize categories; they are not additional categories. Adding all six inner cells gives 300, just as adding the row totals or the column totals does.

Choose the denominator from the question

A joint percentage describes a combination out of everyone. The 40 adults with no exercise and good sleep are 40/300≈13.3% of the whole sample.

A marginal percentage describes one variable without separating the other. Good sleep occurs for 200/300≈66.7% of all adults. The marginal exercise distribution uses the column totals 80, 105, and 115 divided by 300.

A conditional percentage describes one variable within a specified group. Among the 80 adults with no exercise, 40/80=50% sleep well. The phrase “among those with no exercise” identifies the denominator. Among the 200 good sleepers, 90/200=45% exercise 3 or more days. That is a different question from the percentage of frequent exercisers who sleep well, 90/115≈78.3%.

A useful habit is to finish the sentence “Out of all the …” before dividing. “Out of all good sleepers” uses 200; “out of all frequent exercisers” uses 115. A single cell can support both percentages, but their meanings are different.

Describe association in the sample

Treat exercise group as the explanatory grouping and compare the sleep distribution within each exercise group. Good sleep is reported by 50%, about 66.7%, and about 78.3% across the three groups. Since these conditional distributions differ, exercise and sleep are associated in this sample.

The raw good-sleep counts, 40, 70, and 90, are insufficient for that comparison because the groups contain different numbers of people. Conditional percentages remove the difference in group size. Under no association, each group would have the same good-sleep percentage, even if the group counts were very different.

A segmented bar chart makes this visible: draw one equal-height bar per exercise group, split into good and poor sleep percentages. Similar splits suggest no association; different splits suggest a pattern. A side-by-side chart of conditional percentages can show the same comparison.

Sample percentages vary even when population variables are independent. The test of independence asks whether a discrepancy as large as the observed one would be unusual under population independence. A descriptive pattern is the starting point for that test; the survey design also matters when deciding which population the result can describe.

Key Takeaways

  • A two-way table counts combinations; its totals are margins, not extra categories.
  • Joint percentages use the grand total, and marginal percentages use one variable’s totals.
  • A conditional percentage uses the total of the group named in the question.
  • Compare conditional distributions across groups to describe sample association.

3.2 Calculate expectations in a two-way table

Under independence, the distribution of one variable is the same within every category of the other. Expected counts apply the table’s overall proportions to each group. They keep the observed group sizes while removing the association.

Build an expected count from the margins

For a cell with row total R, column total C, and grand total n,

E=RCn.

To see why, estimate the row probability by R/n and the column probability by C/n. Independence multiplies these probabilities for their joint occurrence. Multiplying by n converts that joint probability back into a count: n(R/n)(C/n)=RC/n.

In the exercise-and-sleep table, 200 of 300 adults sleep well, or two thirds. If sleep and exercise are independent, two thirds of each exercise group should sleep well on average. The no-exercise group has 80 people, so its expected good-sleep count is 80(200/300)=53.333….

Complete and check the expected table
Sleep qualityNo exercise1–2 days3 or more daysTotal
Good53.3370.0076.67200
Poor26.6735.0038.33100
Total80105115300

The displayed values use two decimals; keep unrounded values in calculations. For poor sleep and 3 or more exercise days, E=100(115)/300=38.333…. The observed count of 25 in that cell is not an input to this formula. Its row and column totals are the inputs.

The expected table has the same margins as the observed table. Check a row and a column before using it: the good-sleep row sums to 200, and the no-exercise column sums to 80. Small rounding differences in displayed totals can occur; substantial differences signal an arithmetic or copying error.

Every expected exercise column also has the same good-to-poor ratio, 2 : 1. That is the practical meaning of independence in this table. Unequal expected counts across columns come from unequal group sizes, not from an expected association.

Count the freely varying cells

For r rows and c columns of categories,

df=(r−1)(c−1).

The margins restrict the cell counts. In the 2×3 example, choose two entries in the first row; its row total determines the third. Each column total then determines the entry beneath it. There are only two freely chosen entries, so df=(2−1)(3−1)=2.

The same reasoning gives 1 df for a 2×2 table, 4 for a 3×3 table, and 12 for a 4×5 table. Swapping rows and columns leaves the product unchanged. Counting a totals row would incorrectly increase df, while using the number of inner cells minus 1 would ignore the separate row and column constraints.

Use counts to construct this table. Percentages can help explain independence, but applying the expected-count formula to a percentage table removes the original sample size. After calculating the full expected table, check its smallest entry against 5 before computing the test statistic.

Key Takeaways

  • Under independence, E=(row total)(column total)/n.
  • Expected counts keep the observed margins and remove differences in conditional distributions.
  • Calculate from the margins, keeping decimal precision.
  • Use (r−1)(c−1) df, excluding the totals row and column.

3.3 Test whether two variables are associated

Use a test of independence for one random sample whose members are classified on two categorical variables. The question is whether the variables are associated in the population. The null model removes that association while keeping the table’s observed margins.

State hypotheses and check conditions

For the exercise-and-sleep survey, the null hypothesis says exercise frequency and sleep quality are independent among adults in the population. The alternative says they are associated. These statements describe population relationships, not whether two sample percentages happen to match.

Check that the survey is a random sample, adults are counted once, and the sample is less than about 10% of the population when sampling without replacement. Every expected count must be at least 5. Here the smallest expectation is about 26.67, so the expected-count condition holds. A survey allowing multiple exercise selections for the same person would not produce the required one-cell-per-person count table.

Calculate the statistic and p-value

The observed good-sleep counts are 40, 70, and 90. Their expectations are approximately 53.33, 70, and 76.67. Poor-sleep counts are 40, 35, and 25, with expectations 26.67, 35, and 38.33. Using full precision gives contributions of approximately:

Sleep qualityNo exercise1–2 days3 or more days
Good3.3302.32
Poor6.6704.64

Add all six contributions to obtain χ2≈16.96. With df=(2−1)(3−1)=2, the right-tail p-value is about 0.0002. This is below 0.05, so reject independence. There is convincing evidence that exercise frequency and sleep quality are associated in the population. The statistic also exceeds the 2-df critical value of 5.991.

The largest contributions identify more poor sleepers than expected among non-exercisers and fewer among frequent exercisers. The middle exercise group matches its expected counts. Explain the pattern using within-group percentages: about 50%, 67%, and 78% report good sleep across the exercise groups.

Keep the conclusion tied to the design

This is an observational survey. Age, health, or work schedules could help explain the relationship; the test establishes evidence of association, not that exercise causes better sleep. The calculation is symmetric: exchanging rows and columns gives the same statistic and p-value. It supplies no causal direction.

The p-value also does not measure association strength. It reflects both the pattern and the sample size. Describe the pattern and its size with conditional percentages alongside the test result.

Use software with matching settings

A TI-84 χ²-Test uses the observed matrix [A] and can store expectations in [B]. A spreadsheet’s CHISQ.TEST takes corresponding observed and expected cell ranges, with margins excluded. In R, chisq.test(tab) computes the test from a count matrix named tab.

For a 2×2 table, R applies Yates’s continuity correction by default. Python’s scipy.stats.chi2_contingency also defaults to a correction when df is 1. To match the uncorrected hand formula, use correct = FALSE in R or correction=False in Python. For 60 successes in 100 versus 45 in 100, the uncorrected statistic is about 4.51; the corrected value is about 3.93.

Key Takeaways

  • One sample classified on two variables calls for an independence test.
  • The null hypothesis states population independence; the alternative states association.
  • Add contributions over every inner cell and use (r−1)(c−1) df.
  • Report the overall result together with conditional percentages.
  • An observational association does not establish a cause.
  • Check continuity-correction settings when matching a 2 × 2 software test to hand calculations.

3.4 Compare distributions across populations

A test of homogeneity compares the distribution of one categorical variable across populations or treatment groups. You may take separate independent random samples from several populations, or randomly assign participants to groups in an experiment. The design determines the hypotheses, even though the arithmetic matches an independence test.

Ask whether the distributions are the same

Suppose separate random samples of 100 customers from each of three stores report their main payment method. The null hypothesis says that the population proportions using card, mobile payment, and cash are the same at all three stores. It does not say that these three methods are equally popular. The alternative says that at least one store’s distribution differs.

StoreCardMobileCashTotal
A503020100
B454015100
C402535100
Total1359570300

The pooled proportions are 135/300, 95/300, and 70/300. Under the null, each store shares that common distribution. Because each sample contains 100 customers, each expected row is 45, 31.666…, and 23.333…. If the store samples had different sizes, their expected counts would differ while their expected proportions stayed the same.

Perform the comparison

Check independent random samples, one payment classification per customer, the sampling fraction within each population, and all expected counts at least 5. Then calculate E=(row total)(column total)/n and add (O−E)2/E over all nine cells.

The contributions are about 0.556, 0.088, and 0.476 for A; 0, 2.193, and 2.976 for B; and 0.556, 1.404, and 5.833 for C. With unrounded intermediate values, χ2≈14.08. The df are (3−1)(3−1)=4 and the right-tail p-value is about 0.007. At 0.05, reject the null: there is convincing evidence that payment-method distributions are not the same across the stores.

Cash use gives a useful description: 20% at A, 15% at B, and 35% at C. Store C’s cash cell has the largest contribution, 5.833, because 35 customers used cash against an expectation of about 23.33. The rejection does not say that every pair of stores differs or that every payment method differs.

Separate the design from the calculation
DesignTestPopulation question
One sample, two variables measured on each memberIndependenceAre the variables associated?
Separate samples, one outcome compared across populationsHomogeneityAre the outcome distributions the same?

A table’s shape alone cannot choose between these tests. Both use the same expectations, statistic, df, and right tail. Read how the sample or groups were created before naming the test.

A randomized treatment study supports a different interpretation from the store survey. For example, random assignment of 210 patients to two drugs and a placebo can support a causal conclusion about treatment effects if the outcome distributions differ. Separate samples of existing store customers establish differences between those populations without identifying their cause.

With two groups and a binary outcome, the uncorrected homogeneity test matches the two-sided two-proportion z test using the pooled proportion. The chi-square approach also extends directly to more groups or more outcome categories.

Key Takeaways

  • Homogeneity compares one categorical distribution across independent samples or treatment groups.
  • The null states equal distributions across populations, not equal shares across categories.
  • Its expectations, statistic, df, and right-tail calculation match the independence test.
  • The sampling design determines the test’s name and the conclusion.
  • Use within-population percentages to explain an overall difference.
  • Random assignment supports causal conclusions about treatments; existing-group comparisons do not.
4

Choose, check, and report a test

A test’s name is only part of a sound analysis. The data collection, expected counts, and kind of variable determine whether its p-value answers the question. Learn to spot conditions that fail, choose a defensible remedy, and report evidence alongside the size of the pattern. A final use of the chi-square curve tests the spread of measurements, with a different statistic and a tail chosen from the alternative hypothesis.

4.1 Check whether the count test applies

A precise calculation can still give an unreliable answer when the data do not fit the test. Chi-square tests on counts rely on random data collection, independent observations, actual frequencies, and sufficiently large expected counts. Each condition protects a different part of the reasoning.

Randomness and independence

Random sampling supports inference to the population sampled. Separate random samples support comparisons of their populations. Random assignment supports treatment comparisons. A voluntary online poll can overrepresent people with strong opinions; a small p-value does not remove that selection problem or justify extending the result to a wider population.

Each individual must appear in exactly one cell. Independent observations also mean that one person’s response does not determine another’s. A multiple-answer survey can count one person several times, and a before-and-after survey records two responses from the same person. Ordinary independence or homogeneity tests do not account for those dependencies. Paired binary responses call for a paired method such as McNemar’s test.

For sampling without replacement, a sample less than about 10% of its population keeps dependence from depletion small. Check this within each sampled population. The rule does not repair repeated measurements or clustered responses from the same household.

Use actual frequencies

Cells must contain counts of individuals, not means, rates, or measurements. Percentages need their underlying sample sizes: 30.5% of 400 corresponds to 122 individuals. A rounded percentage may not recover an exact count; use the original counts when available. Replacing every cell by a percentage changes the sample size used by the statistic.

Keep observed zeros. They can be informative disagreements with the null model. The denominator is the expected count, so a zero observed count does not make that denominator zero.

Inspect the expected counts

The usual rule is that every expected count is at least 5. These are predictions under the null, not the counts seen in the sample. Some texts allow all expectations at least 1 with at most 20% below 5. State which guideline is being applied and do not switch rules after seeing whether the test rejects.

A large grand total is insufficient. In 1,000 observations, a category with claimed proportion 0.003 has expectation 3. In a two-way table of 120 people, a cell with row total 30 and column total 12 has expectation 30(12)/120=3. Both fail the all-at-least-5 rule.

The chi-square reference distribution is an approximation for count tests. Small expectations make the distribution of possible contributions too irregular for that approximation to work well. Checking observed counts instead can approve a test whose reference p-value is unreliable.

Choose a remedy that fits the problem

Combine related categories when their meanings support a common group, updating observed counts, expected counts, and df. For a table, merge complete rows or columns, not an isolated cell. A larger random sample can increase expected counts. An exact or simulation-based test can address sparse counts without forcing a poor approximation; Fisher’s exact test is a common choice for a sparse 2×2 table.

Dropping a rare category changes both the distribution and the sample. Trying many mergers until one gives a desired p-value also changes the procedure being tested. Remedies for small counts do not correct a biased sample or dependence between observations; those problems require a suitable design or a method that accounts for them.

Key Takeaways

  • Random data collection, independent observations, actual counts, and adequate expectations serve distinct purposes.
  • Each individual must appear in exactly one cell; paired responses need a paired method.
  • Check the sampling fraction when sampling without replacement.
  • Apply the expected-count rule to expectations, even when observed counts are zero.
  • A large total sample does not guarantee adequate counts in rare categories.
  • Use meaningful pooling, more data, or an exact or simulation-based method for sparse counts.
  • In two-way tables, pooling merges whole rows or columns.

4.2 Choose a test and explain its result

Choose a test by the question, the kind of variable, and the way the data were collected. A table may look identical under two different designs, while two tests with different names may produce the same arithmetic.

Match the procedure to the question
Question and designProcedure
One categorical variable in one sample, compared with stated proportionsGoodness of fit
Two categorical variables measured on one sampleIndependence
One categorical outcome compared across separate samples or treatment groupsHomogeneity
Spread of one quantitative variable from a normal populationSingle variance

Comparing donor blood types with national proportions is goodness of fit. Measuring party affiliation and policy opinion in one random sample of 500 voters calls for independence. Comparing travel methods in separate samples of 200 students at each of four colleges calls for homogeneity. Asking whether fill weights have standard deviation above 2 grams calls for a variance test.

Questions about means require a different family of tests, such as t tests. Paired yes/no observations require a paired method. Prediction of a binary outcome using several explanatory variables leads to logistic regression; joint modeling of several categorical variables can lead to loglinear models.

Connect chi-square and z tests

For two categories, the uncorrected goodness-of-fit statistic is the square of the one-proportion z statistic. For a 2×2 table, the uncorrected statistic is the square of the pooled two-proportion z statistic. The p-value matches the two-sided z test because squaring loses the sign.

With 60 successes out of 100 in one group and 45 out of 100 in another, the pooled proportion is 105/200=0.525. The pooled standard error is 0.525(0.475)(1/100+1/100), giving z≈2.12. Thus χ2=z2≈4.51 and p is about 0.034. A one-sided z test answers a directional question and has a different p-value.

Report evidence and its size

Include the test name, statistic, df, sample size, and p-value. For example, the exercise survey can be reported as “A chi-square test of independence gave χ2(2,N=300)=16.96, p < 0.001. Good sleep was reported by about 50%, 67%, and 78% of adults across increasing exercise groups.” Follow with the conclusion about association in the sampled population.

Percentages show the size and pattern that a p-value leaves out. Keeping the same 60% versus 45% success rates while changing group sizes gives very different evidence: 20 per group gives a statistic about 0.90 and p about 0.34; 100 per group gives 4.51 and p about 0.034; 1,000 per group gives about 45.1 and p far below 0.001. The percentage-point gap stays 15 throughout.

Statistical significance means the observed discrepancy is unusual under the null model at the chosen level. Practical importance depends on the size and consequences of the difference. A nonsignificant result can reflect limited power to detect a real difference. Say “no convincing evidence” after not rejecting, and reserve causal language for a design with random assignment. A survey can support a population association without establishing why it occurs.

Key Takeaways

  • Identify the variable types and sampling design before naming a test.
  • Two-category chi-square tests match two-sided z tests when the correction settings agree.
  • Report the test name, statistic, df, sample size, p-value, and relevant percentages.
  • A p-value measures evidence against the null model, not the size of the relationship.
  • Statistical significance and practical importance are different judgments.
  • Keep population and causal conclusions within what the study design supports.

4.3 Test a population’s spread

A single-variance test asks whether the spread of a quantitative measurement matches a claim. Examples include consistency of fill volumes or precision of repeated measurements. This procedure uses the chi-square distribution but does not compare category counts.

Set up the variance claim

Write hypotheses about the population variance σ2. The null is H0:σ2=σ02. Choose the alternative to match the question: greater than, less than, or different from the claimed variance. A standard-deviation claim must be squared: σ0=0.5 mm becomes σ02=0.25 mm².

For a random, independent sample from a normal population, use

χ2=(n−1)s2σ02,df=n−1.

Here s2 is the sample variance. Both the numerator’s sample spread and the denominator’s claimed spread are variances. A large statistic indicates more spread than claimed; a small statistic indicates less. The normal-population condition is essential: skewness, heavy tails, and outliers can badly distort this test’s p-value. A large sample does not remove that sensitivity. Inspect a histogram or normal probability plot before using the test.

Match the tail to the alternative
Alternativep-value
σ2>σ02Right-tail area
σ2<σ02Left-tail area
σ2≠σ02Twice the smaller tail area

For a two-sided 5% test, put 2.5% in each tail. The cutoffs are not equally far from the center because the curve is asymmetric. With 24 df they are 12.401 and 39.364.

Work through three directions

Too much spread: a random sample of 20 bolts has s=0.65 mm against a claimed standard deviation of 0.5 mm. For a normal length population, test the greater-than alternative. The statistic is 19(0.652)/(0.52)=32.11 with 19 df. The right-tail p-value is about 0.030. At 0.05, reject: there is convincing evidence that the population standard deviation exceeds 0.5 mm.

Less spread: a new filler gives s=1.4 mL in 15 independent fills against an old standard deviation of 2.0 mL. Under normality, the statistic is 14(1.42)/(22)=6.86 with 14 df. The left-tail area is about 0.060. At 0.05, there is no convincing evidence of reduced spread. The same result would reject at a level of 0.10 if that level had been chosen beforehand.

Changed spread: 25 independent weighings have s=0.9 g against a claimed 1.2 g. The statistic is 24(0.92)/(1.22)=13.5 with 24 df. The left area is about 0.043; double it for the two-sided p-value, about 0.086. Do not reject at 0.05.

Use CHISQ.DIST.RT(x, df) for a right area and CHISQ.DIST(x, df, TRUE) for a left area. In R, pchisq(x, df) gives the left area; add lower.tail = FALSE for the right. On a TI-84 use χ²cdf with bounds 0 to the statistic for a left tail, or the statistic to 1E99 for a right tail. A conclusion about spread says nothing about the population mean.

Key Takeaways

  • The single-variance test uses quantitative measurements from a normal population.
  • Square standard deviations before using χ2=(n−1)s2/σ02.
  • Use n−1 df for this test.
  • The alternative determines the tail; a two-sided test doubles the smaller tail area.
  • Large samples do not remove the test’s sensitivity to nonnormal data.
  • The conclusion concerns population spread, not the population mean.

Chi-Square Test examples

4 Walkthroughs

1

Build a count statistic and read its curve

10 steps
Follow a spinner example from expected counts to a right-tail probability, with challenges about df and sample size.
  1. 1
    IntroductionFrom count gaps to evidence

    A model predicts how counts should be distributed, but a random sample will usually miss those predictions by some amount. The test needs to measure that gap and judge it on the right probability curve.

    Follow a three-sector spinner through these two jobs: build an overall discrepancy from its counts, then interpret the result using a chi-square curve with the appropriate degrees of freedom.

  2. 2
    ExplanationChoose a curve by its df

    The chi-square family contains a different curve for each degrees of freedom, or df. All values are nonnegative. Small df gives a strongly right-skewed curve; larger df moves it right, spreads it out, and makes it more symmetric.

    At 4 df the mean is 4 and standard deviation is about 2.83. At 10 df the mean is 10. The same statistic therefore occupies a different place on the two curves.

  3. 3
    ConnectionSee why squares appear

    If independent standard normal values are squared and added, their sum follows a chi-square distribution. The number of values is the df.

    For one value, 1.962=3.8416. The two normal tails beyond −1.96 and +1.96 become one chi-square right tail beyond about 3.84. This connects a familiar two-sided normal cutoff with the nonnegative chi-square scale.

  4. 4
    ChallengeCan a statistic be large by itself?

    Two tests both produce a statistic of 8. One has 2 df and the other has 10 df. Must they have the same p-value? Explain without calculating either area.

    ---reveal---

    No. Their reference curves differ because df sets the shape and location. Eight is well above the mean of the 2-df curve but below the mean of the 10-df curve. Its right-tail areas differ, so the statistic alone does not give the evidence.

  5. 5
    ExampleWrite observed and expected counts

    An equally likely three-sector spinner is spun independently 120 times. Sectors red, blue, and green occur 48, 32, and 40 times. Under equal shares, each expected count is 120/3=40.

    The observed and expected lists both sum to 120. Red is 8 above expectation, blue is 8 below, and green matches. Adding signed gaps would hide the discrepancy because 8−8+0=0.

  6. 6
    ExampleCompute one contribution at a time

    Use the squared gap divided by expected for each sector.

    • Red: (48−40)2/40=1.6.
    • Blue: (32−40)2/40=1.6.
    • Green: (40−40)2/40=0.

    Add the three contributions: χ2=3.2. Red and blue both contribute positively even though their gaps have opposite signs. The green cell still belongs in the calculation; its contribution happens to be zero.

  7. 7
    Key InsightA gap needs a scale

    Why divide by expected? A gap of 8 is a different discrepancy when 40 are expected than when 400 are expected. Its contribution is 64/40=1.6 in the first case and 64/400=0.16 in the second.

    The count statistic measures the mismatch relative to the null prediction’s size. A large raw gap is not necessarily the cell that contributes most to the overall test.

  8. 8
    ExampleRead the spinner’s right tail

    Three fully specified sectors give 2 df. For χ2=3.2, the right-tail area is about 0.202. In a spreadsheet, CHISQ.DIST.RT(3.2, 2) calculates that area.

    It is the probability of a statistic at least 3.2 under equal shares. Because 0.202 exceeds 0.05, the spins give no convincing evidence against equal shares at that level. Do not double this area.

  9. 9
    ChallengeKeep the percentages, change the evidence

    A second spinner record has 240 independent spins with counts 96, 64, and 80. Its category percentages match the first record. How do its statistic and df compare?

    ---reveal---

    Expectations double to 80 each. Every squared gap grows fourfold while each denominator doubles, so the total doubles from 3.2 to 6.4. The three categories still give 2 df. Keeping the same percentages does not keep the same evidence.

  10. 10
    RecapKeep calculation and interpretation connected

    Expected counts express the null prediction; the sum of squared, scaled gaps measures disagreement. Use the df to choose the reference curve before finding its tail area.

    For categorical-count tests, the entire p-value is the right-tail area. The spinner example also shows why actual sample size matters: the same percentage gaps create a larger statistic when supported by more independent observations.

2

Test and interpret a distribution claim

13 steps
Carry out the commuter test, interpret contributions, and work through decisions involving pooling and fitted parameters.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionTest a complete distribution claim
  2. 2
    ExplanationState the claim and its alternative
  3. 3
    ExampleTurn shares into count predictions
  4. 4
    ChallengeStart from a ratio
  5. 5
    TipCheck the conditions before the area
  6. 6
    ExampleCompute the four gaps
  7. 7
    ExampleMake the population decision
  8. 8
    ChallengeRead a result at its chosen level
  9. 9
    ExplanationLocate and describe the mismatch
  10. 10
    ConnectionShow the size with percentages
  11. 11
    ExamplePool a sparse category meaningfully
  12. 12
    ChallengeCombine a merger with a fitted model
  13. 13
    RecapFrom a claim to a defensible conclusion
3

Analyze a table and identify its design

16 steps
Move from conditional percentages through expectations and inference, then compare independence with homogeneity.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionRead a table before testing it
  2. 2
    ExampleKeep one student in one cell
  3. 3
    ExplanationCondition on the named group
  4. 4
    ChallengeReverse the conditioning
  5. 5
    ExplanationBuild no association from the margins
  6. 6
    Key InsightUnderstand the one free count
  7. 7
    ChallengeUse unequal margins
  8. 8
    ExplanationName the survey hypotheses
  9. 9
    ExampleCombine all four contributions
  10. 10
    TipMatch the software formula
  11. 11
    ChallengeInterpret an association responsibly
  12. 12
    ConnectionChange the design, keep the numbers
  13. 13
    Key InsightEqual distributions mean equal shares
  14. 14
    ChallengeRecognize a different source of causal evidence
  15. 15
    ChallengeChoose the name before calculating
  16. 16
    RecapJoin design, counts, and percentages
4

Check an analysis and test a variance

14 steps
Diagnose unsuitable designs, distinguish evidence from size, and follow a variance claim through calculation and tail choice.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionDecide whether the calculation answers the question
  2. 2
    ExampleA large total can hide a sparse category
  3. 3
    TipMatch the remedy to the problem
  4. 4
    ChallengeCheck the design before the counts
  5. 5
    ExplanationSelect the question’s procedure
  6. 6
    ChallengeKeep evidence separate from size
  7. 7
    ConnectionReport enough to understand the result
  8. 8
    ExplanationChange from counts to measurement spread
  9. 9
    ExampleCompute the bolt statistic
  10. 10
    ExampleChoose the area that answers the question
  11. 11
    ChallengeChange the alternative
  12. 12
    TipKeep the population-shape check
  13. 13
    ChallengeGive an analysis a final review
  14. 14
    RecapCarry the question through the entire test

Chi-Square Test practice questions

40 Practice Questions in 4 sets

Set 1: Work with tables and sampling variation10 Practice Questions

Question 1 of 10

A count test has 2 df and a statistic of 7.2. Right-tail critical values are 5.991 for area 0.05 and 9.210 for area 0.01. What is the p-value range?
  1. 0.05<p<0.10
  2. 0.02<p<0.10
  3. 0.95<p<0.99
  4. 0.01<p<0.05
Show answerHide answer
Answer: D
The statistic lies above the 0.05 cutoff and below the 0.01 cutoff. Moving right along the curve leaves less area to the right, so the p-value lies between 0.01 and 0.05. The range 0.02 to 0.10 incorrectly doubles the area for a count test.

Question 2 of 10

A goodness-of-fit test compares seven categories with probabilities fixed before sampling. How many degrees of freedom does it use?
  1. 7
  2. 12
  3. 6
  4. 48
Show answerHide answer
Answer: C
With seven fully specified categories, the degrees of freedom are seven minus one, or 6. The fixed sample total determines the last category count once the other six are known. Using 7 ignores that constraint; using the sample size would confuse categories with observations.

Question 3 of 10

A count test has 6 df. What is the mean of its chi-square reference distribution?
  1. 6
  2. 3
  3. 12
  4. 36
Show answerHide answer
Answer: A
A chi-square distribution has a mean equal to its degrees of freedom, so the mean is 6. The value 12 is its variance, found by doubling df; it describes spread, not the location of the mean. A statistic must be interpreted using this particular reference distribution.

Question 4 of 10

A category has observed count 63 and expected count 49. What Pearson residual describes its signed discrepancy?
  1. −2
  2. +2
  3. +4
  4. +14
Show answerHide answer
Answer: B
The signed gap is 14 and the square root of 49 is 7. The Pearson residual is therefore 14/7=+2, showing an observed count above expectation. The value 4 is its square, the contribution to the chi-square sum; it loses the sign needed to describe direction.

Question 5 of 10

Two branches report satisfied customers: 54 of 60 at East and 108 of 180 at West. How do satisfaction rates compare in the sample?
  1. East is 33%; West is 67%.
  2. East is 30%; West is 60%.
  3. East is 60%; West is 90%.
  4. East is 90%; West is 60%.
Show answerHide answer
Answer: D
Compute satisfaction within each branch: 54/60 is 90%, and 108/180 is 60%. West has twice as many satisfied respondents but a much lower satisfaction rate because its sample is three times as large. Dividing 54 and 108 by all satisfied customers compares the branches’ shares of satisfied people instead.

Question 6 of 10

A contingency table has four outcome rows and three group columns, followed by a totals row and totals column. How many degrees of freedom does its chi-square test use?
  1. 6
  2. 11
  3. 12
  4. 7
Show answerHide answer
Answer: A
Only category rows and columns count, giving (4−1)(3−1)=6 df. The value 11 comes from treating all 12 inner cells as freely varying except for the grand total. The row and column margins impose additional constraints, which the product formula accounts for.

Question 7 of 10

A valid survey test finds p = 0.002 for an association between work shift and sleep category. Good sleep is reported by 75% of day workers and 55% of night workers. What conclusion fits the design and results?
  1. Night work causes poor sleep; the 20-point gap gives the causal effect.
  2. The association is strong; its strength is measured by p = 0.002.
  3. The variables are associated; the survey does not establish causation.
  4. The variables are independent; most people in both groups sleep well.
Show answerHide answer
Answer: C
The small p-value supports a population association, and the 20 percentage-point gap describes the observed pattern. The survey did not randomly assign shifts, so other differences between workers may explain the association. The p-value measures evidence against independence, not the strength or causal effect of shift work.

Question 8 of 10

Two clinics each supply an independent random sample of patients. Their main appointment method is phone, website, or in person. Group sizes differ. What procedure and comparison fit this design?
  1. Independence; compare whether the clinic sample sizes are equal.
  2. Homogeneity; compare appointment-method proportions across clinics.
  3. Goodness of fit; compare each clinic with three equal shares.
  4. Homogeneity; compare raw method counts without group totals.
Show answerHide answer
Answer: B
Separate samples are being compared on one categorical outcome, so use homogeneity. Compare distributions using proportions within clinics, because unequal sample sizes can produce unequal raw counts under identical distributions. Equal shares across methods would be a different claim that the question never makes.

Question 9 of 10

A study’s entire two-way count table is multiplied by 4, preserving every cell proportion. It originally had an uncorrected statistic of 5.8. What statistic and df does the enlarged table have?
  1. 5.8; df is unchanged.
  2. 23.2; df is unchanged.
  3. 23.2; df is multiplied by 4.
  4. 92.8; df is unchanged.
Show answerHide answer
Answer: B
Both observed and expected counts multiply by 4. Each squared gap multiplies by 16, then division by the fourfold expectation leaves each contribution four times larger, giving 23.2. The category counts do not change, so df stays fixed; preserving percentages does not preserve the statistic.

Question 10 of 10

A variance test asks whether a new process has a smaller population standard deviation than a known benchmark. What tail gives its one-sided p-value?
  1. The left tail.
  2. The right tail.
  3. Twice the left tail.
  4. Twice the right tail.
Show answerHide answer
Answer: A
Less sample spread makes the variance statistic smaller, so the less-than alternative uses the left-tail area. Automatically choosing the right tail confuses this measurement-based test with the categorical-count tests. Doubling a tail belongs to the two-sided variance procedure, not this directional question.
Set 2: Build and interpret the basic tests10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A random independent sample of 17 measurements comes from a normal population. The sample standard deviation is 3 and the claimed population standard deviation is 2. What statistic and df test the variance claim?
  1. 36 with 16 df
  2. 24 with 16 df
  3. 38.25 with 17 df
  4. 36 with 17 df
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A random sample from a large population gives counts 28, 22, and 50 for claimed shares 0.25, 0.25, and 0.50. Observations are independent. The 5% critical value for 2 df is 5.991. What statistic and decision follow?
  1. 1.44; do not reject.
  2. 0.72; do not reject.
  3. 0.72; reject the claim.
  4. 3.60; do not reject.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A category has observed count 18 and expected count 12. What is its contribution to the chi-square statistic?
  1. 0.5
  2. 2
  3. 6
  4. 3
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A model predicts three outcomes in the ratio 2 : 3 : 5. What are the expected counts for a sample of 180?
  1. 36, 54, 90
  2. 40, 60, 80
  3. 60, 60, 60
  4. 18, 27, 45
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A valid goodness-of-fit test has four fixed-probability categories, a statistic of 8.4, and p = 0.038. What decision and conclusion apply at a 0.05 level?
  1. Do not reject; the population distribution fits the claim.
  2. Reject; every population proportion differs from its claim.
  3. Reject; the population distribution differs from the claim.
  4. Do not reject; the population distribution differs from the claim.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A survey includes 72 evening students, of whom 27 take the bus. What percentage of evening students in the sample take the bus?
  1. 27.0%
  2. 37.5%
  3. 45.0%
  4. 62.5%
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

In a two-way count table, a cell has row total 90, column total 64, and grand total 240. What count is expected under independence?
  1. 24
  2. 37.5
  3. 26.7
  4. 40
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

One random sample of 360 adults is classified by housing type and pet ownership. What null hypothesis belongs to an independence test?
  1. Housing type and pet ownership are associated in the population.
  2. All housing types have equal population proportions.
  3. The sample counts match the expected counts in every cell.
  4. Housing type and pet ownership are independent in the population.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Separate random samples from three campuses give a valid homogeneity-test p-value of 0.27 for lunch preferences. What conclusion applies at 0.05?
  1. The three population distributions are exactly equal.
  2. Every campus has equal shares in each lunch category.
  3. There is no convincing evidence that campus distributions differ.
  4. There is convincing evidence that at least one campus differs.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A goodness-of-fit sample has 600 observations and a claimed category proportion of 0.006. How does that category affect the every-expected-count-at-least-5 condition?
  1. It meets the condition because the sample exceeds 500.
  2. It meets the condition if its observed count is at least 5.
  3. It fails the condition because its expectation is 3.6.
  4. It fails the condition because its proportion is below 5%.
Show answerHide answer

Save this lesson to see this answer.

Set 3: Diagnose choices and combine testing steps10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A random sample of 160 independent choices gives 52, 44, 36, and 28 across four supposedly equally likely categories. The 5% cutoff at 3 df is 7.815. What statistic and decision follow?
  1. 8.0; reject equal shares.
  2. 4.0; retain equal shares.
  3. 8.0; retain equal shares.
  4. 12.0; reject equal shares.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A valid goodness-of-fit test gives p = 0.032. An analyst chose a 0.01 significance level before sampling. What decision follows?
  1. Reject at the chosen level.
  2. Reject after changing the level to 0.05.
  3. Do not reject at the chosen level.
  4. Accept the null as exactly correct.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A planned goodness-of-fit model has six categories. One parameter is fitted from their counts. Before testing, two related categories are pooled to meet the count condition. What df should the fitted-model test use?
  1. 4
  2. 5
  3. 2
  4. 3
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A table has columns “member” and “nonmember.” Its rows are “renewed” and “did not renew.” An analyst divides each renewed count by the total renewed count. What question do those percentages answer?
  1. How renewal is distributed within each membership group.
  2. How membership is distributed among those who renewed.
  3. How membership is distributed among all respondents.
  4. How renewal is distributed among all respondents.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Two independent samples contain 80 and 120 people. They report outcomes A, B, and C with pooled totals 50, 70, and 80. What expected count belongs to outcome B in the smaller sample, and what df apply?
  1. 35; 2 df
  2. 28; 2 df
  3. 28; 5 df
  4. 42; 2 df
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

An independence test on a valid 3 × 2 table gives a statistic of 7.4. The right-tail 5% critical value for 2 df is 5.991. What decision follows?
  1. Retain independence at 0.05.
  2. Retain, as 7.4 is below 11.070.
  3. Retain unless each cell exceeds 5.
  4. Reject independence at 0.05.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Two valid count tests each give a statistic of 8. The 5% right-tail cutoffs are 5.991 for 2 df and 12.592 for 6 df. What decisions apply, and why?
  1. Reject with 2 df only; the reference curve changes with df.
  2. Reject both; a statistic of 8 is above both reference means.
  3. Reject with 6 df only; additional df increase the evidence.
  4. Reject neither; matching statistics must give matching p-values.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A random sample of 40 people answers “yes” or “no” before and after training. All expected counts exceed 5. What analysis fits the response structure?
  1. Use a two-proportion z test because there are only two response categories.
  2. Use Fisher’s exact test because pairing makes the effective cell counts small.
  3. Use a paired binary method because both responses come from the same people.
  4. Use goodness of fit because the before-training shares supply fixed probabilities.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A question asks whether the population standard deviation of tablet weights exceeds 0.08 gram. What chi-square procedure matches the quantity being tested?
  1. A goodness-of-fit test.
  2. A test of independence.
  3. A test of homogeneity.
  4. A test of a single variance.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A valid two-sided variance test gives left-tail area 0.018 and right-tail area 0.982 at the observed statistic. What p-value and decision apply at 0.05?
  1. 0.036; reject the variance claim.
  2. 0.018; reject the variance claim.
  3. 0.982; do not reject the variance claim.
  4. 0.964; do not reject the variance claim.
Show answerHide answer

Save this lesson to see this answer.

Set 4: Evaluate complete analyses and difficult cases10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

An observed category count is 0 and its expected count is 9. What contribution belongs in the chi-square sum?
  1. 0
  2. 1
  3. 9
  4. 81
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A service claims category shares 0.5, 0.3, and 0.2. An analyst instead builds expectations from the sample shares 0.6, 0.25, and 0.15 and gets a statistic of 0. Why does that fail to test the service’s claim?
  1. The degrees of freedom should equal the sample size minus one.
  2. The expectations reproduce the data instead of the claimed shares.
  3. The chi-square sum should divide each gap by its observed count.
  4. The right-tail area should be doubled to detect either direction.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Two independent surveys have identical category proportions and the same claimed distribution, but the second has three times as many respondents. Both meet the test conditions. How do their goodness-of-fit statistics compare?
  1. The second statistic is three times the first.
  2. The second statistic is the same as the first.
  3. The second statistic is nine times the first.
  4. The second statistic is one third of the first.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A category has observed count 84 and expected count 64. What direction and chi-square contribution describe that cell?
  1. Below expectation; contribution 6.25.
  2. Above expectation; contribution 2.50.
  3. Above expectation; contribution 4.76.
  4. Above expectation; contribution 6.25.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A 2 × 2 table has row totals 60 and 90, column totals 45 and 105, and grand total 150. What expected counts belong in the first row?
  1. 22.5 and 52.5
  2. 18 and 42
  3. 30 and 30
  4. 27 and 63
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A valid 2 × 2 count table gives an uncorrected hand statistic of 6.2. R’s default test reports a smaller value. What setting would make the two calculations agree?
  1. Double the default p-value to match the hand formula.
  2. Add the margins as extra categories in the hand formula.
  3. Rerun with correct = FALSE to match the hand formula.
  4. Use the observed count as each denominator in the hand formula.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Samples of 50 customers from Store L and 150 from Store M report a binary preference. Pooled totals are 80 yes and 120 no. What null model and yes expectations fit a homogeneity test?
  1. Equal preference proportions; 20 yes at L and 60 at M.
  2. Equal preference counts; 40 yes at L and 40 at M.
  3. Equal yes/no shares; 25 yes at L and 75 at M.
  4. Equal preference proportions; 30 yes at L and 90 at M.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A 3 × 3 random-sample table has one expected count of 2.4. Two outcome columns describe related rare responses. How can pooling address the count problem while keeping a valid table structure?
  1. Merge only the small cell with the largest cell, then keep 4 df.
  2. Delete the small cell and retain its row and column margins.
  3. Replace 2.4 by 5 and keep the observed counts unchanged.
  4. Merge those entire columns, then recompute expectations and df.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Separate random samples of 90 residents from each of four towns give a valid homogeneity result: statistic 13.2, 6 df, p = 0.040. Town percentages differ by 2–4 points. What conclusion and report are appropriate at 0.05?
  1. Evidence of a large causal effect; report N = 90 and the p-value.
  2. Evidence of equal distributions; omit the percentages because p is small.
  3. Evidence that every town differs; report N = 360 without percentages.
  4. Evidence of differing distributions; report N = 360 and the percentages.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A process study has 31 random independent measurements, sample standard deviation 1.5, claimed population standard deviation 2, and strong right skew. An analyst computes 16.875 with 30 df, then uses a right-tail p-value to test reduced spread, arguing that sample size removes the need for normality. What needs correction?
  1. Keep the statistic and df; normality is required, and reduced spread uses the right tail.
  2. Keep the statistic but use 31 df; sample size removes normality, and reduced spread uses the left tail.
  3. Keep the statistic and df; normality is required, and reduced spread uses the left tail.
  4. Use a statistic of 22.5 with 30 df; normality is required, and reduced spread uses the left tail.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

51 Key Terms, each with its definition

A

Alternative hypothesis
An alternative hypothesis states the population departure being investigated, such as at least one category share differing from its claim.
A goodness-of-fit alternative can hold even when several of the claimed category proportions are correct.
Association
An association exists when the distribution of one variable differs across categories of another; its interpretation depends on study design.
Different conditional sleep percentages across exercise groups describe an association in the sample.

C

Cell contribution
A cell contribution is the nonnegative quantity (O−E)2/E that one category or table cell adds to the chi-square count statistic.
A gap of 8 with expected count 16 contributes 4, making it more notable than that gap in a large cell.
Chi-square distribution
A chi-square distribution is the continuous distribution of a sum of squared independent standard normal variables, with shape set by df.
A statistic of 8 can be unusual with few df but ordinary on a chi-square curve with many df.
Chi-square statistic
The chi-square statistic for counts is the sum of squared observed-minus-expected gaps divided by their respective expected counts.
A table cell that exactly matches its expectation contributes zero to the overall chi-square statistic.
Claimed proportion
A claimed proportion is a category’s population probability specified by the model being tested, used with sample size to predict its count.
A claimed 40% share gives an expected count of 80 in a sample of 200, regardless of the observed share.
Common distribution
A common distribution assigns the same outcome proportions to every group, although the groups can have different sizes and expected counts.
A common 40% yes rate predicts 20 yes responses in 50 people and 60 in a group of 150.
Conditional distribution
A conditional distribution gives the shares of one variable within a specified group, using that group’s total as the denominator.
Among 80 non-exercisers, 40 good sleepers give a conditional good-sleep percentage of 50%.
Confounding variable
A confounding variable is another factor related to the variables being studied that can help explain their observed association.
Differences in age or work schedules could contribute to a survey link between exercise and sleep.
Contingency table
A contingency table displays counts for combinations of two categorical variables, with row and column margins summarizing the totals.
A sleep-by-exercise table places each adult in the cell matching both reported categories.
Continuity correction
A continuity correction adjusts discrete-count discrepancies before using a continuous reference curve; Yates’s correction applies to 2 × 2 tests.
R’s default corrected 2 × 2 statistic can be smaller than the uncorrected value calculated by hand.
Critical value
A critical value is a reference-distribution cutoff separating a rejection region from values that do not trigger rejection at a chosen level.
For a right-tailed test with 2 df at the 5% level, the chi-square critical value is 5.991.

D

Data-dependent selection
Data-dependent selection means choosing an analysis after examining the observed pattern, potentially invalidating its usual reference p-value.
Trying several category mergers and keeping only the smallest p-value changes the procedure being assessed.
Degrees of freedom
The degrees of freedom count independent pieces of information available after constraints and fitted parameters are accounted for.
Four fixed-probability categories leave 3 df because the sample total determines the last count.

E

Estimated parameter
An estimated parameter is a model quantity fitted from the sample; suitable count-based fitting reduces goodness-of-fit df for each parameter.
Fitting one binomial probability in a four-category model changes its goodness-of-fit df from 3 to 2.
Exact test
An exact test calculates a null probability from the discrete sampling distribution without relying on the usual large-count chi-square approximation.
Fisher’s exact test is a possible alternative for a 2 × 2 table whose expected counts are small.
Expected count
An expected count is the average number predicted in a category or cell by the null model for a sample of the observed size.
A 15% claimed category share predicts 37.5 individuals on average in a sample of 250.
Expected table
An expected table contains the cell counts predicted under no association, calculated from row and column margins and the grand total.
An expected table can have unequal cell counts while preserving the same outcome proportions within groups.
Expected-count condition
The expected-count condition requires sufficiently large null-predicted frequencies for the chi-square approximation; the standard rule is all at least 5.
A category expecting only 3 observations fails the standard condition despite a grand total of 1,000.

G

Goodness-of-fit test
A goodness-of-fit test compares one categorical variable’s population distribution with specified shares, using counts from one sample.
A sample of purchases can test whether small, medium, and large sizes follow a claimed 2 : 3 : 5 ratio.

I

Independent observations
Independent observations provide outcomes that do not determine one another; repeated measurements on one person generally violate this condition.
Two responses from each of 40 participants cannot be treated as 80 independent people.
Independent samples
Independent samples are samples collected so that observations in one do not determine or pair with observations in another.
Separate random samples of different customers at two stores support a homogeneity comparison.

J

Joint distribution
A joint distribution gives the shares of the whole sample in the combinations of two variables, dividing each cell count by the grand total.
Forty adults with both no exercise and good sleep make up 13.3% of a sample of 300 adults.

M

Marginal constraint
A marginal constraint is a fixed row or column total that restricts the inner counts and reduces how many cells can vary freely.
In a 2 × 3 table with fixed margins, choosing two cells in one row determines every remaining cell.
Marginal distribution
A marginal distribution gives the distribution of one variable alone, using its row or column totals divided by the grand total.
If 200 of 300 sampled adults report good sleep, the sleep margins show that about 66.7% report good sleep.

N

Normality
Normality means the population follows a normal distribution, a condition required by the exact chi-square test for one variance.
A strongly skewed measurement plot undermines a single-variance p-value even with a large sample.
Null hypothesis
A null hypothesis specifies the population claim used to generate the test’s reference calculation, such as particular category proportions.
For equal weekday shares, the null assigns a population probability of 0.20 to each weekday.

O

Observed count
An observed count is the number of sampled individuals or outcomes actually recorded in a category or combination of categories.
If 42 sampled travelers mainly use a bicycle, the observed bike count is 42, even if 35 were expected.

P

P-value
A p-value is the probability, under the null model and test conditions, of a test statistic at least as extreme as the observed one.
A count-test p-value of 0.017 is compared with 0.05 to decide whether to reject at the 5% level.
Paired data
Paired data link measurements through the same individual or a deliberate match, so their dependence must be included in the analysis.
Before-and-after yes/no responses retain one pair per participant and call for a paired procedure.
Pearson residual
A Pearson residual is the signed observed-minus-expected gap divided by the square root of the expected count; its square is a contribution.
A residual of −2 means a count lies below expectation and contributes 4 to the chi-square sum.
Pooled proportion
A pooled proportion combines successes and sample sizes across groups to estimate their common success probability under an equal-proportion null.
For 60 successes out of 100 and 45 out of 100, the pooled success proportion is 105/200, or 0.525.
Pooling categories
Pooling categories means combining related categories and their counts into a broader category, often to increase sparse expected counts.
Merging a walk category with an other category combines both observed counts and both null probabilities before recalculating df.
Population independence
Population independence means the distribution of one variable is unchanged by knowing the category of the other variable.
Under independence, the overall good-sleep proportion applies within every exercise group.
Population variance
The population variance is the mean squared distance of measurements from their population mean, describing spread in squared measurement units.
A population standard deviation of 0.5 mm corresponds to a variance of 0.25 mm².
Power
The power of a test is its probability of detecting a specified population departure from the null model under a chosen decision rule.
A small sample may fail to detect a real difference, so nonrejection leaves some differences plausible.
Practical importance
Practical importance concerns the size and consequences of a difference in context, judged using quantities such as percentages alongside test evidence.
A manager considers the actual change in payment-method shares before changing checkout arrangements.

R

Random assignment
Random assignment allocates participants to treatments by chance, supporting causal comparisons by limiting systematic group differences.
Randomly assigning lesson formats permits a causal interpretation of a valid difference in pass rates.
Random sample
A random sample uses chance to select members from a defined population, supporting inference to that population under suitable conditions.
An open online poll is a volunteer sample, even if thousands of respondents choose to participate.
Rejection region
A rejection region contains the test-statistic values that lead to rejection of the null hypothesis under the chosen decision rule.
For categorical chi-square tests, the rejection region lies beyond a cutoff in the right tail.
Right skew
A distribution has right skew when its long tail extends toward larger values; chi-square curves become less skewed as df increases.
A low-df chi-square curve concentrates much of its area near small values but extends far to the right.
Right-tail area
A right-tail area is the probability that a continuous random variable is at least as large as a specified cutoff on its curve.
With 4 df, the area to the right of a chi-square statistic of 3 is approximately 0.558.

S

Sample variance
The sample variance adds squared deviations from the sample mean and divides by one less than the sample size to estimate population spread.
A sample standard deviation of 1.5 gives sample variance 2.25 in the corresponding squared units.
Sampling variation
Sampling variation is the natural change in sample counts or statistics across repeated random samples from the same population.
Even a population with equal category shares will rarely give exactly equal counts in each random sample.
Segmented bar chart
A segmented bar chart divides equal-height bars into category percentages, allowing conditional distributions to be compared across groups.
Exercise groups with different good-sleep shares show different splits despite bars of equal total height.
Significance level
A significance level is the decision threshold chosen before testing; reject the null when the p-value is no greater than that level.
A p-value of 0.032 rejects at a planned level of 0.05 but does not reject at a planned level of 0.01.
Single-variance test
A single-variance test compares a normal population’s spread with a specified variance, using a scaled sample variance and sample-size-based df.
Testing whether a filler’s standard deviation exceeds 2 mL concerns spread, not its average fill volume.
Statistical significance
Statistical significance means the test rejects the null model at the chosen level; it describes evidence, not the practical size of a difference.
A small percentage gap can become statistically significant when the sample is sufficiently large.

T

Test of homogeneity
A test of homogeneity compares one categorical outcome’s distribution across populations or assigned groups, using independent group counts.
Separate random customer samples from three stores can test whether payment-method distributions differ.
Test of independence
A test of independence assesses association between two categorical variables in one population, using one sample classified on both variables.
One random survey measuring housing type and pet ownership can support an independence test.
Two-sided variance test
A two-sided variance test looks for population spread above or below a claim and uses twice the smaller null tail area as its p-value.
A smaller tail area of 0.043 gives a two-sided p-value of 0.086, so a 5% test does not reject.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started