StatisticsInferential Statistics

Knowledge guide

How Marginal Totals Determine Expected Counts in a Contingency Table

Build expected counts from row and column totals, preserve the table margins, and understand chi-square degrees of freedom and sampling conditions.

Expected counts describe what a table would look like under a model of independence while retaining its row and column totals. They are model-based reference counts, not new observations.

Construct a table from its margins

Suppose a two-row, three-column table contains 100 observations. Row totals are 40 and 60; column totals are 30, 50, and 20. Under independence, each row has the same expected column proportions: 30%, 50%, and 20%.

RowCategory ACategory BCategory CRow total
First row1220840
Second row18301260
Column total305020100

For example, the first cell is 40(30)/100=1240(30)/100=12. The expected counts reproduce every margin. Dividing 100 equally among six cells would ignore the differing category frequencies.

Compare observed and expected counts

Given actual observed counts OijO_{ij}, Pearson's statistic is

χ2=i,j(OijEij)2Eij.\chi^2=\sum_{i,j}\frac{(O_{ij}-E_{ij})^2}{E_{ij}}.

For a standard independence test in an r×cr\times c table, the reference degrees of freedom are (r1)(c1)(r-1)(c-1). This example has two degrees of freedom. The margins alone do not supply the observed cell counts, so they do not determine a test statistic or p-value.

Check the sampling conditions

Use counts of observations in mutually exclusive categories and ensure the observations are independent. A common introductory adequacy rule requires every expected count to be at least five; all six expected counts here satisfy it. Sparse tables may require an exact or simulation-based method rather than an unexamined chi-square approximation.

Related question

Apply this knowledge

Use the concept guide to understand the reasoning, then return to the complete question and worked answer.

Select the Null Hypothesis for a Test of Independence: H₀ and H₁

Sources

These references support the core concepts and interpretation boundaries explained above.

How Marginal Totals Determine Expected Counts in a Contingency Table | Verla