Tutorials › AP Statistics › Building the Full Expected Counts Table

Expected counts and chi-square conclusions · Tutorial 563 of 1000

Building the Full Expected Counts Table

Build a complete expected-count table from its margins, then use row and column sums to check every calculation.

Intermediate 9 min read

What You'll Learn

  • Organize a three-by-two table of expected counts using row and column categories
  • Calculate all six expected counts from the table margins
  • Use row proportions as an alternate way to check calculations
  • Verify that expected-count row totals, column totals, and the grand total match
  • Keep fractional expected counts unrounded while checking the table
  • Spot common errors caused by mismatched margins or premature rounding

From One Expected Count to a Complete Table

In “Expected Count Formula: Row Total Times Column Total Over Grand Total,” you learned how to calculate the expected count for one cell under the null model of independence. A complete table requires repeating that calculation for every cell, while keeping the row and column categories straight.

This tutorial focuses on a table with three row categories and two column categories. It has six cells, so a full expected-count table contains six calculated values. The key check is that its row totals, column totals, and grand total match the margins of the observed table. The expected counts describe the independence model; they are not replacements for the observed counts.

Formula: For each cell, multiply its row total by its column total and divide by the grand total. Repeat this calculation for all six cells, using the margins that meet at each cell.
$$ E_{ij}=\frac{(\text{row }i\text{ total})(\text{column }j\text{ total})}{\text{grand total}} $$

The subscripts \(i\) and \(j\) identify a cell’s row and column. For example, \(E_{21}\) means the expected count in the second row and first column. You do not need this notation to do the calculations, but it can help you keep track of which cell you are filling.

A useful working layout is to copy the category labels and margins from the observed table, then fill the interior cells of a separate expected-count table. Keep the margins visible as you work. Calculate one entire row at a time, and write down the row sum before moving on. This makes it easier to notice if you have accidentally used a neighboring row’s total.

Why the Expected Table Must Match the Margins

The margins are fixed by the observed table. The expected counts distribute those totals across the cells according to the independence model, but they do not change how many observations there are in each row or column. This gives you a powerful way to check the whole table rather than relying only on checking individual calculations.

For a particular row, its expected counts across the columns should add to that row’s total. In a three-by-two table, add the first and second expected counts in each row. For a particular column, add the three expected counts down that column; the result should equal that column’s total. Finally, all six expected counts should add to the grand total.

These checks follow from applying the same margins consistently. For instance, adding the expected counts across one row combines the column totals used in the numerator, and those column totals add to the grand total. The row total is therefore recovered. You do not need to prove this each time; use it as an arithmetic check.

Table check: In a complete expected-count table, each expected-count row sum equals the corresponding observed row total, each expected-count column sum equals the corresponding observed column total, and the sum of all expected counts equals the grand total.

A mismatch does not mean that the independence model has failed a statistical test. It means the expected-count table has not been calculated or added consistently. Recheck the margins, substitutions, and arithmetic before moving on.

Worked Example: A Community Composting Survey

Worked Example: A Community Composting Survey

Suppose a sample of 180 residents is classified by neighborhood type and whether the resident reports using a community composting service. The observed counts and margins are shown below. Find the complete expected-count table under independence.

Neighborhood typeUses serviceDoes not use serviceTotal
Apartment area242145
Mixed housing204060
Detached homes284775
Total72108180

The row totals are 45, 60, and 75. The column totals are 72 and 108, and the grand total is 180. For the first cell, use the Apartment area row total and the Uses service column total:

$$ E=\frac{(45)(72)}{180}=18 $$

Continue across that row, then calculate the next rows. Each substitution below identifies the row and column margins for that cell.

$$ \begin{aligned} E_{\text{Apartment, uses}}&=\frac{(45)(72)}{180}=18, & E_{\text{Apartment, does not use}}&=\frac{(45)(108)}{180}=27,\\ E_{\text{Mixed, uses}}&=\frac{(60)(72)}{180}=24, & E_{\text{Mixed, does not use}}&=\frac{(60)(108)}{180}=36,\\ E_{\text{Detached, uses}}&=\frac{(75)(72)}{180}=30, & E_{\text{Detached, does not use}}&=\frac{(75)(108)}{180}=45. \end{aligned} $$

The complete expected-count table is:

Neighborhood typeUses serviceDoes not use serviceExpected row total
Apartment area182745
Mixed housing243660
Detached homes304575
Expected column total72108180

Check the rows: \(18+27=45\), \(24+36=60\), and \(30+45=75\). Check the columns: \(18+24+30=72\), and \(27+36+45=108\). The grand total is \(72+108=180\), which also agrees with \(45+60+75=180\).

Under independence, the expected count for Apartment area and Uses service is 18. The full table applies the same model to all six cells. Notice that the observed counts are not used in these calculations; they are displayed to show where the margins come from.

Use Proportions to Check a Row

The formula from the earlier expected-count tutorial can also be read as “row total times column proportion.” For a column with total 72 out of 180, its overall proportion is \(72/180=0.40\). Under independence, the model applies that proportion within each row. For the row total of 60, the expected count in that column is \(60(0.40)=24\), agreeing with the formula.

This alternate calculation is a useful check, especially when a table contains fractional expected counts. It is not a different expected-count rule: it is the same formula written in a way that emphasizes the column’s share of the whole table. You can check a cell using either form, but the result must agree.

Worked Example: Fractional Expected Counts

Worked Example: Fractional Expected Counts

Imagine that 140 students in an invented survey are classified by preferred study location and whether they usually study with background music. The row totals are 35, 49, and 56; the column totals are 63 for Usually studies with music and 77 for Usually studies without music. Calculate every expected count and check the margins.

Use the same grand total, 140, for all six cells. For example, the expected count in the first row and first column is:

$$ E=\frac{(35)(63)}{140}=\frac{2205}{140}=15.75 $$

The other five calculations are:

$$ \begin{aligned} E_{\text{row 1, music}}&=\frac{(35)(63)}{140}=15.75, & E_{\text{row 1, no music}}&=\frac{(35)(77)}{140}=19.25,\\ E_{\text{row 2, music}}&=\frac{(49)(63)}{140}=22.05, & E_{\text{row 2, no music}}&=\frac{(49)(77)}{140}=26.95,\\ E_{\text{row 3, music}}&=\frac{(56)(63)}{140}=25.20, & E_{\text{row 3, no music}}&=\frac{(56)(77)}{140}=30.80. \end{aligned} $$

The completed table and its checks are:

Study-location categoryUsually with musicUsually without musicExpected row total
Row 115.7519.2535
Row 222.0526.9549
Row 325.2030.8056
Expected column total63.0077.00140

Across the rows, \(15.75+19.25=35\), \(22.05+26.95=49\), and \(25.20+30.80=56\). Down the first column, \(15.75+22.05+25.20=63.00\); down the second, \(19.25+26.95+30.80=77.00\). Both column totals add to the grand total: \(63+77=140\).

The expected counts are decimals because they are model-based averages, not observed numbers of students. Keep the decimals as calculated when you build and check the expected table. Rounding individual cells to whole numbers could make the row or column sums fail to match their margins.

As a second check on the second-row music cell, the music proportion is \(63/140=0.45\), and \(49(0.45)=22.05\). This agrees with \(49(63)/140=22.05\).

A Repeatable Method for All Six Cells

A consistent order prevents you from skipping a cell or pairing it with the wrong margins. Use this routine whenever you build a three-by-two expected-count table:

1
Copy the margins.
Write down all three row totals, both column totals, and the grand total from the observed table.
2
Start at the top-left cell.
Use the first row total and first column total, then divide their product by the grand total.
3
Fill the table in order.
Move across the first row, then across the second and third rows. For each cell, use its own row and column totals.
4
Check all margins.
Add across each expected row, down each expected column, and then check the grand total.
5
Retain unrounded values.
Keep decimal results through the checks rather than rounding cells individually to whole numbers.

Worked Example: Finding and Fixing a Table Error

Worked Example: Finding and Fixing a Table Error

Suppose an invented customer survey classifies 120 customers by how they received a service reminder and whether they booked an appointment. The row totals are 32, 48, and 40. The column totals are 54 for Booked and 66 for Did not book. Find the expected counts, and explain how the margins help catch an error.

The six calculations are:

$$ \begin{aligned} E_{\text{row 1, booked}}&=\frac{(32)(54)}{120}=14.4, & E_{\text{row 1, did not book}}&=\frac{(32)(66)}{120}=17.6,\\ E_{\text{row 2, booked}}&=\frac{(48)(54)}{120}=21.6, & E_{\text{row 2, did not book}}&=\frac{(48)(66)}{120}=26.4,\\ E_{\text{row 3, booked}}&=\frac{(40)(54)}{120}=18, & E_{\text{row 3, did not book}}&=\frac{(40)(66)}{120}=22. \end{aligned} $$

So the expected-count table is:

Reminder categoryBookedDid not bookExpected row total
Category 114.417.632
Category 221.626.448
Category 3182240
Expected column total5466120

The row checks are \(14.4+17.6=32\), \(21.6+26.4=48\), and \(18+22=40\). The column checks are \(14.4+21.6+18=54\) and \(17.6+26.4+22=66\). The grand total is \(54+66=120\), matching the sum of the row totals.

Now suppose someone mistakenly calculates the Category 2, Booked cell with a row total of 40 instead of 48. The resulting value would be \(40(54)/120=18\). If the other Category 2 value remains 26.4, that row would add to \(44.4\), not its required total of 48. The row check reveals that at least one calculation in that row is wrong. Comparing the substitution with the cell’s actual margins identifies the mismatched row total.

A matching row sum is a useful check, but it is not enough by itself to guarantee every cell is right: two errors might offset each other. Check the substitutions as well as the row and column sums.

Common Mistakes and AP Exam Communication

  • Using the wrong row total: Each cell uses the total for the row it is in. A neighboring row’s total may produce a plausible value but will not match the correct margins.
  • Using the wrong column total: In a two-column table, both columns share the same grand total, but each has its own column total. Match the column total to the cell’s category.
  • Changing the grand total from cell to cell: The denominator is the total number of observations in the entire table, not a row or column total.
  • Calculating only some cells: A complete three-by-two expected-count table needs all six cells. Use a fixed order and confirm that no cell is blank.
  • Rounding each value too early: Keep fractional expected counts unrounded while adding the rows and columns. Early rounding can cause totals not to match.
  • Mixing up observed and expected counts: The observed table supplies the margins. The expected table is calculated from those margins under independence; do not copy observed interior counts into it.
  • Treating a total check as the entire calculation: Matching margins supports the arithmetic, but each cell still needs a correct formula and the correct pair of margins.

For clear AP exam communication, label the expected-count table, show the formula with the relevant row total, column total, and grand total, and state that the values are expected under independence. Then show that the row and column sums reproduce the original margins. If a value is fractional, report it as calculated rather than rounding it to a whole count.

Key takeaway: Calculate every cell in a three-by-two expected-count table using its own row total, column total, and the same grand total. Check all three row sums, both column sums, and the grand total against the observed table’s margins.

Check Your Understanding

Use the margins below to calculate and check a complete expected-count table.

  1. A three-by-two table has row totals 30, 50, and 40; column totals 48 and 72; and grand total 120. Calculate all six expected counts.
  2. For the margins in question 1, verify that the expected counts add to each row total and each column total.
  3. A table has row totals 25, 45, and 50; column totals 60 and 60; and grand total 120. What are the two expected counts in the row with total 45?
  4. Why should fractional expected counts usually be retained while checking the table?
  5. A student’s six values add to the grand total, but one expected row total does not match its observed row total. What should the student check first?