Aimathic
Login | English | Deutsch

Free math worksheets

Build your own math worksheets from 30,000+ problems for grades 3 to 12, from fractions to AP Calculus. Every problem comes with step-by-step solutions.

Chi-square test for two-way tables

Click problems to add them to your worksheet.

55041412
A random sample of students is classified by class year and by preferred study location. The goal is to test whether the two categorical variables are associated. Which chi-square procedure is appropriate?

Hints

- Count how many categorical variables are recorded for each individual. - Decide whether the question concerns association between those variables or fit to one claimed distribution. - Match the structure of the data to the chi-square procedure.

Solution

1. The data contain two categorical variables measured on one random sample. 2. The question asks whether the variables are associated. 3. The appropriate procedure is a chi-square test of independence for a two-way table.

Answer

A chi-square test of independence for a two-way table.
55041512
A chi-square test uses a \(2 \times 3\) two-way table. What are the degrees of freedom for the test?

Hints

- Identify the number of rows and columns that contain categories, not totals. - Degrees of freedom depend on the table dimensions. - Reduce each dimension by one before multiplying.

Solution

1. For a two-way table, \(df=(r-1)(c-1)\). 2. Here \(r=2\) and \(c=3\), so \(df=(2-1)(3-1)=2\).

Answer

\(2\)
55041612
Separate random samples of customers from three stores are classified as satisfied, neutral, or dissatisfied. The company wants to test whether the distribution of satisfaction responses is the same at all three stores. State the null and alternative hypotheses for a chi-square test.

Hints

- Focus on distributions of the response categories across the groups being compared. - The null should describe equality of those categorical distributions. - The alternative does not need to claim that every store differs from every other store.

Solution

1. The null hypothesis states that the categorical response distribution is the same across the three stores. 2. The alternative states that the response distributions are not all the same across the stores.

Answer

\(H_0\): The satisfaction-response distribution is the same at all three stores. \(H_a\): The satisfaction-response distributions are not all the same at the three stores.
55041712
A school has more than \(1500\) students. A simple random sample of \(150\) students is classified by transportation method and lunch preference. For the planned chi-square test, the smallest expected cell count is \(6.2\). Check the random-sample, \(10\%\), and expected-count conditions.

Hints

- Check the sampling method separately from the numerical cell-count condition. - Compare the sample size with one tenth of the population size. - For the expected-count check, the smallest expectation is enough to decide whether all cells clear the threshold.

Solution

1. The random-sample condition is met because the problem states that a simple random sample was used. 2. The \(10\%\) condition is met because \(150\) is at most \(10\%\) of a population larger than \(1500\). 3. The expected-count condition is met because the smallest expected count is \(6.2\), so every expected count is at least \(5\).

Answer

All three stated conditions are met.
55041812
In one cell of a two-way table, the observed count is \(18\) and the expected count is \(12\). Find this cell's contribution to the chi-square statistic.

Hints

- A chi-square contribution uses both the size of the observed-minus-expected difference and the expected count. - The departure is squared before it is scaled. - Make sure the denominator is the expected count, not the observed count.

Solution

1. A cell contributes \(\frac{(O-E)^2}{E}\) to \(\chi^2\). 2. Here the contribution is \(\frac{(18-12)^2}{12}=\frac{36}{12}=3\).

Answer

\(3\)
55041912
Three cells in a two-way table have observed and expected counts \((22,20)\), \((12,8)\), and \((30,25)\), where each pair is \((O,E)\). Which cell contributes the most to the chi-square statistic?

Hints

- A larger raw difference does not automatically mean a larger chi-square contribution. - Scale each squared departure by its own expected count. - Compare the resulting contributions, not just \(|O-E|\).

Solution

1. The contributions are \(\frac{(22-20)^2}{20}=0.2\), \(\frac{(12-8)^2}{8}=2\), and \(\frac{(30-25)^2}{25}=1\). 2. The second cell has the largest contribution.

Answer

The cell with \((O,E)=(12,8)\), with contribution \(2\).
55042012
A chi-square test for a two-way table has \(3\) row categories and \(6\) degrees of freedom. How many column categories does the table have?

Hints

- Use the degrees-of-freedom relationship as an equation rather than only as a forward formula. - Substitute the known number of row categories and leave the column count unknown. - Remember that the formula reduces each table dimension by one.

Solution

1. Let the number of column categories be \(c\). For a two-way table, \(df=(r-1)(c-1)\). 2. With \(r=3\), \(6=(3-1)(c-1)=2(c-1)\). 3. Therefore \(c-1=3\), so \(c=4\).

Answer

\(4\) column categories.
55045412
A chi-square test for a two-way table has \(df=2\). The graph shows the reference distribution. The shaded region is the rejection region for \(\alpha=0.05\); the line labeled \(T\) marks the observed test statistic. a) Read the critical value and the observed chi-square statistic from the graph. b) Should the null hypothesis be rejected at the \(5\%\) significance level? c) Explain what the shaded region represents.
Figure for problem 550454

Hints

- Compare the horizontal positions of the observed-statistic line and the critical-value line. - A test statistic inside the shaded rejection region leads to rejection of the null hypothesis. - Think about why unusually large chi-square values count as evidence against the null model.

Solution

1. The graph labels the critical value as \(c=5.99\) and the observed statistic as \(T=6.40\). 2. The observed statistic lies to the right of the critical value, inside the shaded rejection region. 3. Therefore, reject the null hypothesis at \(\alpha=0.05\). 4. The shaded region consists of chi-square values at least as extreme as the critical cutoff under the null model; its total area is \(0.05\).

Answer

a) Critical value: \(5.99\); observed statistic: \(6.40\). b) Reject the null hypothesis. c) The shaded right tail is the \(5\%\) rejection region under the null distribution.
55042112
The observed counts are: <table><tr><th></th><th>Choice A</th><th>Choice B</th></tr><tr><th>Group 1</th><td>\(30\)</td><td>\(20\)</td></tr><tr><th>Group 2</th><td>\(20\)</td><td>\(30\)</td></tr></table> Compute the chi-square test statistic and the degrees of freedom for testing independence.

Hints

- Start by adding the observed counts to obtain all margins. - The balanced margins make the expected table especially simple. - Add all four cell contributions, then determine degrees of freedom from the table dimensions.

Solution

1. Both row totals and both column totals are \(50\), with grand total \(100\), so every expected count is \(25\). 2. Each cell contributes \(\frac{(5)^2}{25}=1\) to \(\chi^2\). 3. Therefore \(\chi^2=1+1+1+1=4\). 4. The degrees of freedom are \((2-1)(2-1)=1\).

Answer

\(\chi^2=4\) and \(df=1\).
55042212
The observed counts in a \(2 \times 3\) table are <table><tr><th></th><th>Category 1</th><th>Category 2</th><th>Category 3</th></tr><tr><th>Group A</th><td>\(30\)</td><td>\(15\)</td><td>\(15\)</td></tr><tr><th>Group B</th><td>\(10\)</td><td>\(25\)</td><td>\(25\)</td></tr></table> Compute the chi-square statistic and degrees of freedom for a test of independence.

Hints

- Find the row and column totals before calculating expected counts. - Look for repeated expected counts or repeated departures to reduce unnecessary arithmetic. - The test statistic is the sum of all six cell contributions.

Solution

1. Each row total is \(60\), each column total is \(40\), and the grand total is \(120\), so every expected count is \(20\). 2. The first and fourth cells contribute \(\frac{10^2}{20}=5\) each. 3. Each of the other four cells differs from expectation by \(5\), so each contributes \(\frac{5^2}{20}=1.25\). 4. Thus \(\chi^2=5+1.25+1.25+5+1.25+1.25=15\). 5. The degrees of freedom are \((2-1)(3-1)=2\).

Answer

\(\chi^2=15\) and \(df=2\).
55042312
A chi-square test of independence between study setting and preferred note-taking method gives \(\chi^2=8.4\), \(df=2\), and \(p=0.015\). Using \(\alpha=0.05\), state the statistical decision and conclusion in context.

Hints

- The p-value measures how surprising a test statistic at least this large would be under the null model. - Compare the p-value with the stated significance level before writing the conclusion. - Phrase the conclusion as evidence about association, not as proof of causation.

Solution

1. Compare the p-value with the significance level: \(0.015<0.05\). 2. Reject the null hypothesis of independence. 3. The data provide statistically significant evidence of an association between study setting and preferred note-taking method.

Answer

Reject \(H_0\). There is statistically significant evidence at the \(0.05\) level that study setting and preferred note-taking method are associated.
55042412
A chi-square test of independence gives \(p=0.28\) at significance level \(\alpha=0.05\). A student writes, “Because the p-value is large, we proved the two variables are independent.” Evaluate the student's statement and give an appropriate conclusion.

Hints

- Distinguish “fail to reject” from “accept” or “prove.” - Compare the p-value with the significance level first. - State what the data fail to show rather than claiming certainty about the null model.

Solution

1. Since \(0.28>0.05\), fail to reject the null hypothesis of independence. 2. A large p-value does not prove the null hypothesis; it means the sample does not provide sufficiently strong evidence against it. 3. The appropriate conclusion is that the data do not provide statistically significant evidence of an association between the variables.

Answer

The statement is incorrect. Fail to reject \(H_0\); the data do not provide statistically significant evidence of an association, but independence has not been proved.
55042512
Researchers take separate random samples from three high schools and record each student's preferred after-school activity. They want to compare the activity distributions across the schools. a) Is this naturally framed as a chi-square test of independence or a chi-square test of homogeneity? b) Explain why the same two-way-table chi-square calculations still apply.

Hints

- Pay attention to whether the data come from one sample with two variables or from separate samples of several populations. - Focus on what the null hypothesis says about categorical distributions. - Separate the sampling interpretation from the mechanics of the two-way-table calculation.

Solution

1. Because separate samples are taken from three populations and their categorical distributions are being compared, the natural framing is a chi-square test of homogeneity. 2. The data are still arranged in a two-way table, and the null model says the activity distribution is the same across schools. 3. Expected counts, chi-square contributions, the test statistic, and degrees of freedom are computed with the same two-way-table formulas used for a test of independence.

Answer

a) Chi-square test of homogeneity. b) The null model still produces expected counts from the two-way table margins, so the same chi-square statistic and degrees-of-freedom calculations apply.
55042612
A random sample produces this table: <table><tr><th></th><th>Outcome A</th><th>Outcome B</th></tr><tr><th>Group 1</th><td>\(24\)</td><td>\(16\)</td></tr><tr><th>Group 2</th><td>\(12\)</td><td>\(28\)</td></tr></table> a) Find the expected counts under independence. b) Compute \(\chi^2\) and \(df\). c) Software reports \(p=0.0070\). At \(\alpha=0.05\), state the conclusion about association.

Hints

- Begin by finding all row totals, column totals, and the grand total. - Compute expected counts before any chi-square contributions. - Keep the test-statistic calculation separate from the p-value decision.

Solution

1. The row totals are \(40\) and \(40\), the column totals are \(36\) and \(44\), and the grand total is \(80\). 2. The expected counts are \((18,22)\) in each row. 3. The four contributions are \(\frac{36}{18}=2\), \(\frac{36}{22}\approx1.636\), \(2\), and \(\frac{36}{22}\approx1.636\). 4. Thus \(\chi^2\approx7.273\), with \(df=1\). 5. Since \(0.0070<0.05\), reject the null hypothesis. The data provide statistically significant evidence of an association between group and outcome.

Answer

a) Expected rows: \((18,22)\) and \((18,22)\). b) \(\chi^2\approx7.273\), \(df=1\). c) Reject \(H_0\); there is statistically significant evidence of an association.
55042712
The panels show observed counts for two groups across Categories 1, 2, and 3. Panel a) is Group A and panel b) is Group B. a) Find the expected counts under independence. b) For each category, add the two cell contributions to \(\chi^2\). Which category contributes the most? c) Find the total \(\chi^2\) statistic.
Figure for problem 550427

Hints

- Read the six counts from the bar heights and use them to build the table margins. - Because the two row totals are equal, compare what that implies for their expected counts. - Group the two cell contributions by category only after computing them with their matching expected counts.

Solution

1. The observed rows are \((30,20,10)\) and \((15,25,20)\). Both row totals are \(60\); the column totals are \((45,45,30)\); the grand total is \(120\). 2. The expected counts in each row are \((22.5,22.5,15)\). 3. Category 1 contributes \(2.5+2.5=5\). Category 2 contributes \(\frac{6.25}{22.5}+\frac{6.25}{22.5}\approx0.556\). Category 3 contributes \(\frac{25}{15}+\frac{25}{15}\approx3.333\). 4. Category 1 contributes the most, and \(\chi^2\approx8.889\).

Answer

a) Expected rows: \((22.5,22.5,15)\) and \((22.5,22.5,15)\). b) Category totals are approximately \(5\), \(0.556\), and \(3.333\); Category 1 contributes the most. c) \(\chi^2\approx8.889\).
55045512
The same observed chi-square statistic, \(T=7.50\), is evaluated in two different two-way-table tests. Panel a) has \(df=2\), and panel b) has \(df=6\). In each panel, the shaded region is the rejection region for \(\alpha=0.05\). a) For which test is the null hypothesis rejected? b) Explain why the same value of \(T\) can lead to different conclusions.
Figure for problem 550455

Hints

- Treat the two panels as separate hypothesis tests even though they have the same observed statistic. - In each panel, compare \(T\) with the labeled critical boundary. - The degrees of freedom determine which chi-square reference distribution is used.

Solution

1. In panel a), the critical value is \(5.99\). Since \(7.50>5.99\), the statistic is in the rejection region, so the null hypothesis is rejected. 2. In panel b), the critical value is \(12.59\). Since \(7.50<12.59\), the statistic is not in the rejection region, so the null hypothesis is not rejected. 3. The reference chi-square distribution depends on the degrees of freedom, so the cutoff for the same significance level changes with \(df\).

Answer

a) Reject in panel a) with \(df=2\); do not reject in panel b) with \(df=6\). b) Different degrees of freedom give different chi-square reference distributions and therefore different critical values.
55045812
The two panels show the same two-way-table chi-square test with \(df=4\) and the same observed statistic \(T=8.00\). Panel a) uses \(\alpha=0.10\), while panel b) uses \(\alpha=0.05\). The shaded region in each panel is the rejection region. a) State the decision at each significance level. b) Explain why changing \(\alpha\) changes the decision even though the data and test statistic are unchanged.
Figure for problem 550458

Hints

- Compare \(T\) with the critical line separately in each panel. - A larger significance level places more null-distribution area in the rejection region. - The observed statistic does not change when only the decision threshold changes.

Solution

1. In panel a), the critical value is \(7.78\). Since \(8.00>7.78\), reject the null hypothesis at \(\alpha=0.10\). 2. In panel b), the critical value is \(9.49\). Since \(8.00<9.49\), do not reject the null hypothesis at \(\alpha=0.05\). 3. A larger significance level creates a larger rejection region and a smaller critical value, so the same statistic can cross one cutoff but not the other.

Answer

a) At \(\alpha=0.10\), reject the null hypothesis. At \(\alpha=0.05\), do not reject it. b) The significance level determines the size of the rejection region and therefore the critical value.
55042812
In a planned chi-square test for a two-way table, every observed cell count is at least \(8\), but one expected cell count is \(3.8\). A student says the test is fine because “all the observed counts are bigger than \(5\).” Diagnose the reasoning.

Hints

- Identify exactly which counts the chi-square approximation condition refers to. - The observed table and the null-model expected table play different roles. - Check the smallest expected count against the threshold.

Solution

1. The student's check uses the wrong quantities. 2. The usual high-school chi-square condition is stated in terms of expected cell counts, not observed cell counts. 3. Because one expected count is \(3.8<5\), that condition is not met, even though all observed counts exceed \(5\). 4. The chi-square approximation should not be used as stated for this table.

Answer

The reasoning is incorrect. The relevant condition concerns expected counts, and the expected count \(3.8\) violates the stated minimum of \(5\).
55042912
A cell in a two-way table has expected count \(20\). Its contribution to the chi-square statistic is \(1.8\), and the observed count is greater than the expected count. Find the observed count.

Hints

- Treat the chi-square contribution formula as an equation with the observed count unknown. - Undo the division by the expected count before taking a square root. - Use the stated direction of the departure to choose between the two possible signs.

Solution

1. Use \(\frac{(O-20)^2}{20}=1.8\). 2. Then \((O-20)^2=36\), so \(|O-20|=6\). 3. Because the observed count is greater than expected, \(O-20=6\), giving \(O=26\).

Answer

\(26\)
55043012
For a \(2 \times 2\) table, the observed counts are <table><tr><th></th><th>Category 1</th><th>Category 2</th></tr><tr><th>Group A</th><td>\(16\)</td><td>\(14\)</td></tr><tr><th>Group B</th><td>\(24\)</td><td>\(46\)</td></tr></table> A student notes that the raw residuals \(O-E\) add to \(0\) and concludes that \(\chi^2=0\). Explain the error and compute the correct chi-square statistic.

Hints

- First calculate the expected table from the margins. - Compare the formula for a raw residual with the formula for a chi-square contribution. - Consider what squaring does to positive and negative departures.

Solution

1. The row totals are \(30\) and \(70\), the column totals are \(40\) and \(60\), and the grand total is \(100\). The expected counts are \((12,18)\) and \((28,42)\). 2. The residuals are \((4,-4)\) and \((-4,4)\), so their signed sum is indeed \(0\). 3. A chi-square statistic does not add raw residuals. It adds \(\frac{(O-E)^2}{E}\), so opposite signs cannot cancel. 4. The contributions are \(\frac{16}{12}\), \(\frac{16}{18}\), \(\frac{16}{28}\), and \(\frac{16}{42}\), which sum to \(\chi^2\approx3.175\).

Answer

The raw residuals cancel because the margins are preserved, but chi-square uses squared, scaled residuals. The correct statistic is \(\chi^2\approx3.175\).
55043112
A large study compares two membership groups. In Group A, \(2500\) of \(5000\) members renew; in Group B, \(2700\) of \(5000\) renew. A chi-square test gives \(\chi^2\approx16.026\) and \(p<0.001\). Explain what the small p-value establishes and what it does not establish about the size or practical importance of the association.

Hints

- Compare the conditional renewal percentages, not only the p-value. - Separate evidence that a difference exists from the magnitude of that difference. - Large samples can make relatively small departures from a null model statistically detectable.

Solution

1. The renewal rates are \(\frac{2500}{5000}=50\%\) for Group A and \(\frac{2700}{5000}=54\%\) for Group B. 2. The small p-value provides strong statistical evidence that membership group and renewal status are associated in the population represented by the study. 3. Statistical significance does not by itself show that the association is large or practically important. 4. Here the observed difference in renewal rates is \(4\) percentage points, so practical importance should be judged using context in addition to the p-value.

Answer

The result gives strong evidence of an association, but the p-value does not measure the association's practical size. The observed renewal-rate difference is \(4\) percentage points, so practical importance requires contextual judgment.
55043212
The two panels show observed counts for Group A and Group B across Categories 1, 2, and 3. Panel a) is Group A and panel b) is Group B. a) Compute the expected counts under independence. b) Compute \(\chi^2\) and identify the category with the largest combined contribution. c) For \(df=2\), software gives \(p=0.0317\). At \(\alpha=0.05\), state the conclusion.
Figure for problem 550432

Hints

- Use the values printed on the bars to reconstruct the observed table and its margins. - Equal row totals simplify the expected-count calculations. - Keep track of contributions by category as you add them so you can identify which pattern drives the statistic.

Solution

1. The observed rows are \((48,32,20)\) and \((30,45,25)\). Each row total is \(100\); the column totals are \((78,77,45)\); the grand total is \(200\). 2. The expected counts in each row are \((39,38.5,22.5)\). 3. The six cell contributions sum to \(\chi^2\approx6.904\). By category, the combined contributions are approximately \(4.154\), \(2.195\), and \(0.556\), so Category 1 contributes the most. 4. Because \(0.0317<0.05\), reject the null hypothesis of independence. The data provide statistically significant evidence of an association between group and category.

Answer

a) Expected rows: \((39,38.5,22.5)\) and \((39,38.5,22.5)\). b) \(\chi^2\approx6.904\); Category 1 contributes the most. c) Reject \(H_0\); there is statistically significant evidence of an association.
55046112
Panels a) and b) show counts for the same three response categories in two groups. Panel a) is Group A and panel b) is Group B. a) Reconstruct the \(2\times3\) observed table and compute the expected counts under independence. b) Categories 1 and 3 have raw residuals of the same absolute size in each row. Compute the total chi-square contribution from each of those two categories. c) Explain why category 3 contributes more even though the raw residual magnitudes tie.
Figure for problem 550461

Hints

- Read each panel as one row of the observed two-way table. - Compare raw residuals first, then remember that chi-square contributions divide squared residuals by expected counts. - Equal raw departures need not have equal chi-square contributions when their expected counts differ.

Solution

1. The observed rows are Group A \((30,15,5)\) and Group B \((50,30,20)\). The row totals are \(50\) and \(100\), the column totals are \(80,45,25\), and the grand total is \(150\). 2. The expected rows are Group A \((26.67,15,8.33)\) and Group B \((53.33,30,16.67)\), rounded to two decimals. 3. For category 1, the two contributions are approximately \(0.417\) and \(0.208\), totaling \(0.625\). 4. For category 3, the two contributions are approximately \(1.333\) and \(0.667\), totaling \(2.000\). 5. The raw residual magnitudes tie, but category 3 has smaller expected counts. Dividing the same squared residual by smaller expected counts produces larger chi-square contributions.

Answer

a) Observed rows: \((30,15,5)\) and \((50,30,20)\). Expected rows: approximately \((26.67,15,8.33)\) and \((53.33,30,16.67)\). b) Category 1 contributes \(0.625\); category 3 contributes \(2.000\). c) Category 3 has smaller expected counts, so the same raw residual size is more substantial after standardization.
55043312
A simple random sample of \(180\) students is classified by academic program and preferred campus resource: <table><tr><th></th><th>Resource 1</th><th>Resource 2</th><th>Resource 3</th></tr><tr><th>Program A</th><td>\(24\)</td><td>\(18\)</td><td>\(18\)</td></tr><tr><th>Program B</th><td>\(12\)</td><td>\(25\)</td><td>\(23\)</td></tr><tr><th>Program C</th><td>\(9\)</td><td>\(17\)</td><td>\(34\)</td></tr></table> All expected counts are at least \(15\). a) State the hypotheses for a chi-square test of independence. b) Compute the expected counts, \(\chi^2\), and \(df\). c) Software gives \(p\approx0.0035\). State the conclusion at \(\alpha=0.05\). d) Identify the cell with the largest chi-square contribution and explain what that cell shows. e) Does the result show that academic program causes resource preference? Explain.

Hints

- Build the margins first; the equal row totals create a useful expected-count pattern. - Keep a separate running list of cell contributions rather than jumping directly to the final statistic. - After the p-value decision, return to the table to interpret which observed-versus-expected departures matter most. - Distinguish the scope of a random-sample inference from the stronger requirements for a causal conclusion.

Solution

1. \(H_0\): academic program and preferred campus resource are independent. \(H_a\): they are associated. 2. Each row total is \(60\); the column totals are \(45\), \(60\), and \(75\). Therefore every row has expected counts \((15,20,25)\). 3. The cell contributions are \(5.4\), \(0.2\), \(1.96\), \(0.6\), \(1.25\), \(0.16\), \(2.4\), \(0.45\), and \(3.24\). Their sum is \(\chi^2=15.66\). 4. The degrees of freedom are \((3-1)(3-1)=4\). 5. Since \(0.0035<0.05\), reject \(H_0\). There is statistically significant evidence of an association between academic program and preferred resource. 6. The largest contribution is Program A–Resource 1: \(\frac{(24-15)^2}{15}=5.4\). That cell has more observations than expected under independence. 7. The result establishes association, not causation; no causal assignment is described.

Answer

a) \(H_0\): program and resource preference are independent. \(H_a\): they are associated. b) Each expected row is \((15,20,25)\); \(\chi^2=15.66\), \(df=4\). c) Reject \(H_0\); there is statistically significant evidence of an association. d) Program A–Resource 1 contributes the most, \(5.4\), because \(24\) were observed versus \(15\) expected. e) No. The test supports association, not causation.

All problems may be used, copied and printed free of charge for school and tutoring, including paid tutoring. Commercial adaptations as well as publication or redistribution on the internet are not permitted.