Why a Product Rule Appears in a Two-Way Table
A two-way table describes two categorical variables on the same individuals. Its cell totals count individuals who fall into a particular category of each variable. The table’s row and column totals, in turn, describe the marginal distributions. If the two variables are independent, knowing an individual’s category for one variable does not change the distribution of the other. This has a precise consequence: each joint relative frequency is the product of the corresponding row and column marginal relative frequencies.
The product rule is useful because it translates independence into a cell-by-cell calculation. It tells us what a joint proportion must be under independence, and it lets us compare that value with the observed joint proportion. The rule concerns proportions first; multiplying by the table’s total number of individuals gives the corresponding cell count.
The notation \(i\) and \(j\) simply identifies a row and a column. A marginal relative frequency describes one variable without specifying the other. A joint relative frequency describes the combination of categories in one cell. Under independence, the proportion in a cell is found by multiplying the relevant row proportion by the relevant column proportion.
Deriving the Rule
The probability definition of independence gives the basic result. Let \(A_i\) be the event that an individual is in row category \(i\), and let \(B_j\) be the event that the individual is in column category \(j\). Independence means that the joint probability of these events is the product of their marginal probabilities:
In a table of relative frequencies, the corresponding quantities are the joint proportion \(n_{ij}/n\), the row proportion \(n_{i+}/n\), and the column proportion \(n_{+j}/n\). Replacing each probability by its table relative frequency gives the product rule. The same result can be reached through conditional probability: if the row and column variables are independent, the proportion in row \(i\) among individuals in column \(j\) is the overall row proportion. Multiplying that conditional proportion by the column proportion gives the joint proportion.
The first equality is the conditional-probability calculation: the proportion in cell \((i,j)\) equals the proportion in column \(j\) that belongs to row \(i\), multiplied by the proportion in column \(j\) overall. The second equality uses independence, which says that the conditional proportion \(n_{ij}/n_{+j}\) equals the marginal row proportion \(n_{i+}/n\). This conditional version requires \(n_{+j}>0\). The probability product rule itself does not require conditional probability to be defined.
This count calculation is a direct rearrangement of the product rule. It provides a useful check: if independence holds exactly in the table, each observed cell count equals its row total multiplied by its column total and divided by the grand total. When that calculation gives a non-integer value, it cannot equal an observed count exactly, since observed counts are whole numbers. In data from a random sample, small differences from the independence-model counts can occur even when the variables are independent in the population.
Worked Examples
Worked Example: Checking a Table That Follows the Rule
Suppose a hypothetical survey records whether 200 students use a campus study space (Yes or No) and which of three study times they prefer (Morning, Afternoon, or Evening). The table below is constructed so that every cell follows the product rule.
| Study-space use | Morning | Afternoon | Evening | Total |
|---|---|---|---|---|
| Yes | 30 | 42 | 48 | 120 |
| No | 20 | 28 | 32 | 80 |
| Total | 50 | 70 | 80 | 200 |
For the Yes–Morning cell, the row marginal relative frequency is \(120/200=0.60\), and the column marginal relative frequency is \(50/200=0.25\). Their product is \(0.60(0.25)=0.15\). The joint relative frequency in that cell is \(30/200=0.15\), so the product rule holds there. In count form, the independence-model count is
The same check works for each cell. For the Yes–Afternoon cell, the product is \((120/200)(70/200)=0.21\), and the observed joint relative frequency is \(42/200=0.21\). For Yes–Evening, the product is \((120/200)(80/200)=0.24\), matching \(48/200=0.24\). For No–Morning, the product is \((80/200)(50/200)=0.10\), matching \(20/200=0.10\). The remaining cells give \(0.14=28/200\) and \(0.16=32/200\). Thus all six cells satisfy the product rule. In this table, the two categorical variables are independent.
Worked Example: Finding a Cell Proportion and Count Under Independence
In a hypothetical table of 150 patients, suppose 60 are in Category A of one variable and 45 are in Category X of a second variable. Under independence, what proportion and count should be in the Category A–Category X cell?
The row marginal relative frequency for Category A is \(60/150=0.40\), and the column marginal relative frequency for Category X is \(45/150=0.30\). The product rule gives the joint relative frequency under independence:
The corresponding count is this joint proportion multiplied by the grand total:
So, under independence, 12% of the patients would be in both categories, corresponding to 18 of the 150 patients. This is the count predicted by the independence calculation. It is not a claim that the observed cell must contain 18 patients unless the table follows independence exactly.
Worked Example: Recognizing When the Rule Fails
A hypothetical table summarizes 100 customers by whether they use a mobile app and whether they make a purchase during a visit.
| App use | Purchase | No purchase | Total |
|---|---|---|---|
| Yes | 30 | 20 | 50 |
| No | 10 | 40 | 50 |
| Total | 40 | 60 | 100 |
Check the App use: Yes and Purchase cell. Its joint relative frequency is \(30/100=0.30\). The two marginal relative frequencies are \(50/100=0.50\) for app use and \(40/100=0.40\) for purchase. Their product is \(0.50(0.40)=0.20\), not 0.30. The count predicted by independence would be
but the observed count is 30. The cell therefore does not follow the product rule, and these two variables are not independent in this table. The discrepancy is also visible conditionally: \(30/50=0.60\) of app users made a purchase, whereas \(40/100=0.40\) of all customers made a purchase. The conditional and marginal proportions differ.
This comparison establishes that the table is not exactly independent. It does not, by itself, determine whether a difference in a sample is larger than would commonly occur by chance under a population-independence model. That is a separate inferential question.
What the Rule Does—and Does Not—Say
The rule is a precise description of independence: every joint proportion must match the product of the relevant marginals. Checking one cell that fails the equality is enough to show that the table is not exactly independent. To establish that a table follows the rule, all cells must satisfy it. Because the row and column proportions each sum to 1, the joint proportions implied by all these products also sum to 1:
This confirms that the products form a complete distribution across the cells. The calculation does not say that every table from a random sample of independent variables will match those products exactly. Sample counts vary; the products describe the proportions implied by independence and provide a standard point of comparison. Also, independence is not a statement about cause and effect. It describes a pattern in the joint and marginal distributions.
The rule matters because it makes the link between marginal distributions and joint distributions explicit. If the variables are independent, their separate distributions contain enough information to determine every joint cell proportion: multiply the appropriate row and column proportions. If the observed table differs, at least one combination occurs at a proportion different from the independence calculation.
Common Mistake: Multiplying Counts Instead of Proportions
A frequent error is to multiply the row total by the column total and call that the independence-model count. For example, with row total 60, column total 45, and grand total 150, the incorrect calculation would be \(60(45)=2700\). That value is not a count in the table. The correct calculation divides by the grand total: \(60(45)/150=18\). Equivalently, first convert both marginal counts to proportions, multiply those proportions, and then multiply by 150 to recover the count.
Another mistake is to treat any observed difference from the product as evidence that the variables are associated in a broader population. In a table describing a sample, the observed relative frequencies may differ from the independence products due to sampling variation. Keep the statements precise: exact equality describes independence in the table; conclusions about population patterns require appropriate inferential methods.
Check Your Understanding
Use the product rule and distinguish observed quantities from values calculated under independence.
- A table has \(n=120\), a row total of 48, and a column total of 30. Under independence, what joint relative frequency and cell count does the product rule give?
- A cell contains 24 of 100 individuals. Its row total is 40 and its column total is 50. Does this cell satisfy the product rule? Show the joint proportion and the product of the marginal proportions.
- Why is multiplying a row total by a column total, without dividing by the grand total, not the correct independence-model count?
- Does a sample table that differs from the product rule prove that the two variables are associated in the population? Explain the distinction.
- Why must all cells be checked to verify that a table follows the product rule, while one failing cell is enough to show that it does not?