Tutorials › Survey Sampling › Weighted Cross-Tabulations and Conditional Percentages

Weighted Descriptive Analysis · Tutorial 703 of 998

Weighted Cross-Tabulations and Conditional Percentages

Learn to read weighted cross-tabulations by matching the percentage denominator to the population comparison you want to describe.

Intermediate 10 min read

What You'll Learn

  • Define weighted cell totals and the row, column, and grand totals of a two-way table
  • Calculate row percentages, column percentages, and overall percentages from weighted totals
  • Interpret each percentage using its denominator and the categories being compared
  • Check that percentages sum to 100% along the appropriate table margins
  • Identify when a percentage is undefined because its denominator is zero

Why the Denominator Matters

A two-way table describes how two categorical variables occur together. In survey data, the table is often built from weights rather than by simply counting respondents. The weighted cell totals show how much population representation is assigned to each combination of categories; percentages then express a cell relative to a chosen total.

The denominator determines the question answered. Dividing a cell by its row total describes the distribution across column categories within a row category. Dividing by its column total describes the distribution across row categories within a column category. Dividing by the grand total describes the cell's share of the entire weighted total. These percentages are not interchangeable, even when they use the same cell total.

This tutorial treats the table as a descriptive summary. Its percentages describe the weighted records included in the table; they do not by themselves quantify sampling uncertainty or establish a causal relationship.

Weighted Cell Totals and Margins

Let \(s\) be the set of records included in an analysis, and let \(w_i\) be the weight for record \(i\). Each included record must belong to exactly one category of a row variable \(A\) and exactly one category of a column variable \(B\). Assume the weights are finite and nonnegative. A record with weight zero contributes nothing to the weighted totals.

Definition: For row category \(a\) and column category \(b\), the weighted cell total is $$ \hat T_{ab}=\sum_{i\in s}w_i I(A_i=a,\ B_i=b), $$ where \(I(\cdot)\) equals 1 when the condition is true and 0 otherwise. The weighted row total, weighted column total, and grand total are $$ \hat T_{a+}=\sum_b\hat T_{ab},\qquad \hat T_{+b}=\sum_a\hat T_{ab},\qquad \hat T_{++}=\sum_a\sum_b\hat T_{ab}. $$

The plus sign marks a margin: \(\hat T_{a+}\) sums across every column category for row \(a\), and \(\hat T_{+b}\) sums across every row category for column \(b\). Provided the categories form a complete, non-overlapping classification of the included records, summing all cells gives the grand total. The earlier material on weighted frequency tables uses the same principle of adding record weights within categories.

A weighted total need not be a whole number, and it is not necessarily the literal number of respondents. Its interpretation depends on the weights. The percentages below are ratios of these weighted totals.

Three Percentages, Three Questions

Definition: For cell \((a,b)\), the row percentage is \(100\hat T_{ab}/\hat T_{a+}\), defined only when \(\hat T_{a+}>0\). The column percentage is \(100\hat T_{ab}/\hat T_{+b}\), defined only when \(\hat T_{+b}>0\). The overall percentage is \(100\hat T_{ab}/\hat T_{++}\), defined only when \(\hat T_{++}>0\). If the corresponding denominator is zero, that percentage is undefined.

A row percentage answers: Among the weighted total in row category \(a\), what percentage is in column category \(b\)? A column percentage answers: Among the weighted total in column category \(b\), what percentage is in row category \(a\)? An overall percentage answers: What percentage of the entire weighted total is in cell \((a,b)\)?

Because weights are nonnegative, each cell total is nonnegative and cannot exceed its row, column, or grand total. Whenever the denominator is positive, the corresponding percentage is therefore between 0% and 100%. Row percentages sum to 100% across the columns of each positive-total row; column percentages sum to 100% down each positive-total column; overall percentages sum to 100% across all cells when the grand total is positive. A margin with total zero has no defined percentage distribution.

Worked Example: A Two-by-Two Table With All Three Percentages

Suppose a hypothetical survey records clinic location (urban or rural) and whether a scheduled follow-up was attended. The table below gives weighted cell totals, in represented people. Assume every included record has a nonnegative weight and is classified in exactly one cell.

Clinic locationAttendedDid not attendRow total
Urban538
Rural358
Column total8816

For example, the urban-attended weighted total could have come from four hypothetical records with weights 2, 1, 3, and 2: the attended records have weights 2 and 3, totaling 5, while the non-attended records have weights 1 and 2, totaling 3. The other entries are already supplied as weighted totals.

Row percentages. Within the urban row, the attended percentage is $$ 100\left(\frac{5}{8}\right)=62.5\%, $$ and the did-not-attend percentage is \(100(3/8)=37.5\%\). Within the rural row, the corresponding percentages are \(100(3/8)=37.5\%\) and \(100(5/8)=62.5\%\). Each row sums to 100%. These figures describe attendance status within each clinic-location category.

Column percentages. Among the weighted total who attended, the urban percentage is \(100(5/8)=62.5\%\), and the rural percentage is \(100(3/8)=37.5\%\). Among those who did not attend, the urban percentage is \(100(3/8)=37.5\%\), and the rural percentage is \(100(5/8)=62.5\%\). Each column sums to 100%. These figures describe clinic location within each attendance category.

Overall percentages. The urban-attended cell is \(100(5/16)=31.25\%\) of the grand total. The urban-did-not-attend, rural-attended, and rural-did-not-attend cells are respectively \(100(3/16)=18.75\%\), \(100(3/16)=18.75\%\), and \(100(5/16)=31.25\%\). The four cell percentages sum to 100%.

The numerical equality between some row and column percentages here is a consequence of the table's equal margins, not a general rule. For instance, the 62.5% in the urban-attended cell means “attended among urban” as a row percentage, but “urban among attendees” as a column percentage. The denominator supplies the interpretation.

How to Construct and Check the Table

A reliable calculation starts with the analysis records and the cells, not with a percentage formula chosen in isolation. First determine which records belong in the table and ensure that their row and column classifications are handled consistently. Then add each included record's weight to exactly one cell. Obtain the margins by summing cells, and only then calculate percentages using the denominator that matches the question.

1
Specify the analysis set and categories.
State which records are included and define the row and column categories. Every included record must map to one cell, unless a missing-value category is explicitly included.
2
Sum weights into cells.
For each category pair, add the weights of records in that cell to obtain \(\hat T_{ab}\).
3
Calculate margins.
Sum cells across rows and columns and verify that both sets of margins yield the same grand total.
4
Choose and label the denominator.
Use the row total for a within-row comparison, the column total for a within-column comparison, or the grand total for a share of the whole.
5
Check the results.
Confirm that percentages sum to 100% along the appropriate positive-total margins and that every percentage has a positive denominator.

Why the Percentages Sum as They Do

The margin checks follow directly from the definitions. For a row with \(\hat T_{a+}>0\), sum its row percentages across all column categories:

$$ \sum_b 100\frac{\hat T_{ab}}{\hat T_{a+}} =100\frac{\sum_b\hat T_{ab}}{\hat T_{a+}} =100\frac{\hat T_{a+}}{\hat T_{a+}} =100\%. $$

The middle equality uses the definition of the row total. Replacing the row total with a column total gives the corresponding result down a positive-total column. Summing overall percentages across every cell gives

$$ \sum_a\sum_b100\frac{\hat T_{ab}}{\hat T_{++}} =100\frac{\sum_a\sum_b\hat T_{ab}}{\hat T_{++}} =100\frac{\hat T_{++}}{\hat T_{++}} =100\%, \qquad \hat T_{++}>0. $$

The positive-denominator conditions matter: the final division in each calculation is valid only when its total is greater than zero. If the grand total is zero, the overall percentage is undefined, not 0%. With nonnegative weights, a zero grand total means every cell total is zero, so the data provide no weighted distribution to express as percentages.

Worked Example: Choosing a Column Denominator

Consider a hypothetical weighted table of reported service satisfaction by region. The entries are weighted totals, in represented customers.

RegionSatisfiedNot satisfiedRow total
North401050
South302050
West104050
Column total8070150

To answer “Among satisfied customers, what percentage are from the North?”, use the satisfied column total, 80, rather than the North row total, 50: $$ 100\left(\frac{40}{80}\right)=50.0\%. $$ Thus 50.0% of the weighted satisfied total is from the North. The corresponding South and West shares are \(100(30/80)=37.5\%\) and \(100(10/80)=12.5\%\), which sum to 100%.

A different question, “Among North-region customers, what percentage are satisfied?”, uses the North row total: $$ 100\left(\frac{40}{50}\right)=80.0\%. $$ These answers are not contradictory. They condition on different groups. The overall North-and-satisfied share is instead \(100(40/150)=26.67\%\) of the entire weighted total.

As a check, the overall percentages for the six cells are \(26.67\%\), \(6.67\%\), \(20.00\%\), \(13.33\%\), \(6.67\%\), and \(26.67\%\), in table order. Their sum is 100.01% when rounded to two decimal places; before rounding, the fractions sum exactly to 100%. Small discrepancies in displayed totals can therefore result from rounding.

Zero Totals and Undefined Percentages

An empty-looking margin requires attention. A row total of zero makes every row percentage in that row undefined because each would divide by zero. The analogous rule applies to a column with zero total. A zero cell within a positive-total row, column, or table has a defined percentage of 0%, because its numerator is zero and its denominator is positive.

The same logic applies to the grand total. The overall percentage is defined only if \(\hat T_{++}>0\). It is not sufficient to state that row and column percentages are undefined for zero margins while leaving the overall case unstated: an all-zero table has no defined overall percentages either.

Worked Example: A Zero-Weight Category and a Zero Grand Total

Suppose a hypothetical table has two regions and two response categories. All weighted records are in the East region; records classified in the West have zero weight. The weighted totals are:

RegionResponse AResponse BRow total
East6410
West000
Column total6410

The East-row percentages are defined: \(100(6/10)=60\%\) for Response A and \(100(4/10)=40\%\) for Response B. The West-row percentages are undefined because both would have denominator zero. The column percentages are defined: for Response A, the East share is \(100(6/6)=100\%\); for Response B, it is \(100(4/4)=100\%\). Overall, the two East cells are 60% and 40% of the grand total of 10, while the West cells are each 0%.

Now suppose every record in the hypothetical analysis has weight zero. Every cell total and every margin, including \(\hat T_{++}\), is zero. The overall percentage expression for any cell would divide by zero, so no overall percentages are defined. It would be incorrect to report each cell as 0%: the percentages cannot be calculated from a zero grand total.

Common Mistake: Reporting a Percentage Without Naming Its Base

A frequent error is to write “the percentage in this cell is 40%” without saying whether 40% is a row percentage, column percentage, or overall percentage. Another is to select a denominator merely because it appears nearby in the table. In the regional example, \(40/50=80\%\) is the North row percentage, while \(40/80=50\%\) is the North share among satisfied customers, and \(40/150=26.67\%\) is the overall cell share. Each calculation is arithmetically correct but answers a different question.

The correction is to state the comparison in words before calculating: identify the group being conditioned on, then use that group's weighted total as the denominator. In reporting, label the result explicitly, such as “80% of the North weighted total was satisfied,” rather than “80% were satisfied” if the population represented by “were” is ambiguous.

Also report the weighted basis and the units or population represented by the totals. Do not describe a weighted cell total as a literal respondent count unless it actually is one. If records with missing categories are excluded, state the analysis set; alternatively, a missing category can be represented explicitly. Whichever choice is made, the cell totals and denominators must refer to the same set of records.

Key takeaway: A weighted cross-tabulation begins with weighted cell totals and their margins. Row, column, and overall percentages differ only in the denominator, but that choice determines the descriptive question answered. Calculate a percentage only when its corresponding total is positive, including requiring a positive grand total for overall percentages.

Check Your Understanding

For each question, identify the appropriate denominator and explain what the resulting percentage would describe.

  1. A weighted cell total is 24, its row total is 60, its column total is 40, and the grand total is 120. Calculate the row, column, and overall percentages.
  2. In a table of region by insurance status, what denominator answers “Among insured people, what percentage live in the North?”
  3. Why do row percentages sum to 100% across a row with a positive total?
  4. A row total is zero but the grand total is positive. Are the row percentages defined? Are overall percentages for cells in that row defined?
  5. If every weighted cell total is zero, what is the overall percentage for any cell, and why?
Clinical Biostats