From Paired Responses to a Table
When a data set records two categorical variables for each observational unit, each response gives a pair of category values. A two-way table organizes those pairs: one variable defines the rows, the other defines the columns, and each cell counts how many units fall into that particular combination. Building the table is a matter of careful classification and counting—not of estimating or modeling.
For example, a survey might record each student’s year in school and whether they usually bring lunch or buy it. A response such as “second year, buys lunch” belongs in the cell at the intersection of the second-year row and the buys-lunch column. The table is reliable only if the categories are clearly defined and every included response is counted once.
Suppose the row variable has categories \(R_1,\ldots,R_r\) and the column variable has categories \(C_1,\ldots,C_c\). Write \(n_{ij}\) for the number of included responses in row category \(R_i\) and column category \(C_j\). If \(N\) paired responses are included, a correctly constructed table satisfies:
This notation describes counts only. It does not express a percentage or probability. The meaning of a cell comes from both its row and column labels, so labels should be explicit enough that a reader can identify the combination being counted.
Set the Categories Before Tallying
Before counting, decide what each row and column category means. For the included responses, the categories for each variable should be mutually exclusive: a response for that variable fits one category, not two. They should also be collectively exhaustive: every included response has a category. For example, if a variable records a person’s usual lunch choice and the categories are “brings lunch” and “buys lunch,” the question or coding rule needs to make clear how to handle someone who reports both.
The categories need not be identical for the two variables. One variable might have two categories and the other three. The table simply needs one row for each chosen row category and one column for each chosen column category. State the unit being counted, too: usually each person, item, or other observational unit contributes one paired response.
A response with no determinate value for one of the variables cannot be assigned to an ordinary cell for that combination. The table’s inclusion rule must therefore be clear: count only paired responses for which both values can be classified, or use a clearly defined category if the data collection and coding rules specify one. Do not silently guess a category. Apply the same rule to every response.
A Reliable Tallying Process
A tally can be made directly from a response list. Work through the included responses one at a time, identify the category for each variable, and add one to the corresponding cell. A running tally mark or a software count can help, but the logic is the same: each included paired response contributes one count to one cell.
Confirm what each response represents and which two categorical characteristics are being tabulated.
Use clear labels and check that each variable’s categories are exclusive and cover the responses to be included.
For each included unit, find its row category and column category, then increase that cell’s count by one.
Add all interior cell counts and compare the result with the number of included paired responses. Investigate any discrepancy rather than altering a count merely to force agreement.
Worked Example: Two Categories for Each Variable
A hypothetical survey records year in school and usual lunch choice for 10 students. The row categories are “First year” and “Second year.” The column categories are “Brings lunch” and “Buys lunch.” The survey instructions ask students to choose one usual lunch choice, so each included response has one category for each variable.
The paired responses are: First year, brings; Second year, buys; First year, buys; Second year, brings; First year, brings; Second year, buys; Second year, brings; First year, buys; First year, brings; Second year, buys.
Count the responses by combination. “First year, brings” appears three times; “First year, buys” appears twice; “Second year, brings” appears twice; and “Second year, buys” appears three times. The resulting table is:
| Year in school | Brings lunch | Buys lunch |
|---|---|---|
| First year | 3 | 2 |
| Second year | 2 | 3 |
The grand total is the sum of the four cell counts:
This agrees with the 10 paired responses in the list. Each response was assigned to exactly one of the four possible combinations.
Tables with Different Numbers of Categories
A two-way table does not need to be square. If one variable has two categories and the other has three, the interior of the table has six cells. Some cells may have a count of zero: that means no included response had that combination. A zero is a meaningful count, not an invitation to leave the cell blank. A blank cell could instead suggest that no count was made or that information is unavailable.
Worked Example: Two Categories and Three Categories
In a hypothetical survey, 12 participants report whether they are in a beginner or experienced exercise group and their preferred exercise time: morning, afternoon, or evening. Each participant gives one answer for each variable. The response pairs are: beginner-morning; beginner-morning; beginner-afternoon; beginner-evening; experienced-morning; experienced-afternoon; experienced-afternoon; experienced-afternoon; experienced-evening; experienced-evening; experienced-evening; experienced-evening.
Tally each combination separately. The beginner responses give two morning, one afternoon, and one evening response. The experienced responses give one morning, three afternoon, and four evening responses. Place those counts at the intersections of the matching labels:
| Exercise group | Morning | Afternoon | Evening |
|---|---|---|---|
| Beginner | 2 | 1 | 1 |
| Experienced | 1 | 3 | 4 |
There are six cells, and their counts add to the number of paired responses:
The count of four in the experienced-evening cell means exactly four included participants were both in the experienced group and preferred evening exercise. It does not describe all experienced participants or all evening preferences by itself.
Why the Grand-Total Check Works
The grand-total check follows from the one-response, one-cell rule. For each included observational unit, the row categories assign it to one row, and the column categories assign it to one column. Their combination identifies one cell. Thus each unit contributes one, and only one, to the sum of the cell counts.
More formally, let \(I_{ijk}\) equal 1 if included response \(k\) belongs in cell \((i,j)\), and 0 otherwise. Because the categories assign response \(k\) to exactly one cell, the sum of \(I_{ijk}\) across all cells is 1 for every response \(k\). Summing over all \(N\) responses gives:
If the cell counts add to more than the number of included responses, at least one response may have been counted more than once. If they add to less, a response may have been skipped or assigned to no cell. Matching totals are an important check, although they do not by themselves prove that every individual response was classified correctly: one overcount and one omission could cancel.
Worked Example: Normalizing Responses and Checking a Zero Cell
A hypothetical survey of eight participants records their study format (solo or group) and how often they attend a study session. The coding rule places “once a month” and “about once a month” in the “Monthly” category. “Less than monthly” goes in “Less often,” and “weekly” goes in “Weekly.” This rule lets differently worded responses with the same intended category be tallied consistently.
The responses are: solo, weekly; group, once a month; solo, about once a month; group, weekly; solo, less than monthly; group, weekly; group, monthly; solo, weekly.
After applying the stated rule, the solo responses contribute two to Weekly, one to Monthly, and one to Less often. The group responses contribute two to Weekly and two to Monthly. None contributes to the group-and-less-often combination, so that cell has a count of zero.
| Study format | Weekly | Monthly | Less often |
|---|---|---|---|
| Solo | 2 | 1 | 1 |
| Group | 2 | 2 | 0 |
The grand total is:
The zero records an observed absence of that combination in these eight responses; it is not a missing count. Consistent category rules make the tally interpretable, and the grand-total check confirms that the listed responses have all been counted once.
Common Mistakes and Why the Table Matters
A two-way table is useful because it preserves the pairing between two categorical responses. If the two variables are tabulated separately, that pairing is lost: the separate category counts do not show how many units had each combination. The cell counts retain that basic structure for later description and display.
- Counting a response in multiple cells. It may seem reasonable to put a person in every category they mention. But if the table is meant to count one response per person for each variable, this makes the cell counts larger than the number of included paired responses. Define a single category or a suitable coding rule before tallying.
- Assuming matching totals prove every cell is correct. A matching grand total is a useful check, but an overcount in one cell can cancel an omission elsewhere. Compare the table with the raw responses when a cell looks unexpected.
- Leaving an observed zero blank. A blank does not communicate whether the count is zero, uncounted, or unavailable. Enter 0 when the combination was checked and no included responses belong there.
- Using unclear labels. Short labels can be convenient, but readers need to know what each category means. State the variables, category definitions, and unit being counted.
The central discipline is simple: define the categories, assign each included paired response to one cell, and verify that all cell counts together equal the number of included responses. That process turns a raw list into a table that can be checked and read without losing the relationship between the two variables.
Check Your Understanding
For each question, focus on how responses are assigned and counted.
- A survey records each person’s preferred drink (tea or coffee) and whether they usually drink it hot or cold. What information does a single interior cell represent?
- Why should the categories for each variable be mutually exclusive when constructing a table of counts?
- A table has six cell counts: 2, 0, 4, 1, 3, and 2. How do you check whether its grand total matches 12 included responses?
- What is the difference between a cell with a count of zero and a blank cell?
- Why can a table have the correct grand total even if one or more responses were assigned to the wrong cells?