Tutorials › Survey Sampling › Diagnosing Weighted and Unweighted Discrepancies

Weighted Descriptive Analysis · Tutorial 713 of 998

Diagnosing Weighted and Unweighted Discrepancies

Compare weighted and unweighted summaries systematically, and use weight-group patterns to explain where their differences come from.

Intermediate 10 min read

What You'll Learn

  • Explain why weighted and unweighted summaries can differ even when calculated from the same records
  • Use weight-group comparisons to examine outcome patterns and represented population shares
  • Decompose a mean discrepancy into composition and within-group components
  • Identify when weight variation is present but produces little change in a summary
  • Recognize why an aggregate comparison can conceal opposing differences across subgroups
  • State what a weighted–unweighted discrepancy can and cannot establish

Why Compare Weighted and Unweighted Summaries?

A weighted summary and an unweighted summary describe the same survey records using different contributions from each record. The unweighted mean gives every record equal contribution. A weighted mean gives more contribution to records with larger weights. A difference between the two is therefore a useful diagnostic: it shows that the outcome values and the weighting of records combine differently from equal weighting.

The comparison does not, by itself, show that either estimate is wrong or that weighting has removed bias. To interpret it, ask what records have larger weights, whether their outcomes differ, and how much of the weighted total is represented by each relevant group. Those questions help distinguish a change in group composition from a change in the weighting of outcomes within groups.

Definition: For records \(i=1,\ldots,n\), let \(y_i\) be the outcome and \(w_i>0\) its survey weight. The unweighted mean is \(\bar{x}=n^{-1}\sum_{i=1}^n y_i\), and the weighted mean is \(\hat{\mu}_w=\sum_{i=1}^n w_i y_i/\sum_{i=1}^n w_i\). The weighted mean is a ratio of a weighted outcome total to the sum of weights. It gives record \(i\) the normalized contribution \(w_i/\sum_j w_j\).

For this comparison to be informative, calculate both summaries for the same records and the same outcome definition. Keep the units and the records’ inclusion in the calculation consistent. A difference can arise because the weighted and unweighted calculations represent different mixtures of groups, because weights vary among records within groups, or both. Scaling all weights by the same positive constant does not change the weighted mean.

A Decomposition of the Difference

Suppose the records are divided into mutually exclusive groups \(g=1,\ldots,G\), such as age categories or regions. Write \(n_g\) for the number of sample records in group \(g\), \(W_g=\sum_{i\in g}w_i\) for its weight total, and \(W=\sum_g W_g\). Let \(\bar{y}_g\) be the unweighted mean in group \(g\), and let \(\bar{y}_{wg}=\sum_{i\in g}w_i y_i/W_g\) be its weighted mean. Define the unweighted sample share \(p_g=n_g/n\) and the weighted share \(P_g=W_g/W\). Then

$$ \bar{x}=\sum_g p_g\bar{y}_g,\qquad \hat{\mu}_w=\sum_g P_g\bar{y}_{wg}. $$

The first expression combines group means using the sample’s group shares. The second combines weighted group means using each group’s share of the total weight. Add and subtract \(\sum_g P_g\bar{y}_g\) to obtain an exact decomposition:

$$ \hat{\mu}_w-\bar{x} = \sum_g (P_g-p_g)\bar{y}_g + \sum_g P_g(\bar{y}_{wg}-\bar{y}_g). $$

The first term is a composition component: it reflects a difference between the weighted and unweighted group shares, applied to the unweighted group means. The second is a within-group component: it reflects differences between the weighted and unweighted means within groups, averaged using the weighted group shares. This is an accounting identity, not a causal explanation. The choice of groups matters: a useful grouping is one that helps explain how the weights and outcome values vary.

1
Check the overall summaries.
Calculate the weighted and unweighted estimates for the same records and outcome. Record the difference and its direction in the outcome’s units.
2
Inspect weight variation.
Compare weight ranges or summaries across meaningful groups. Ask which records receive relatively more weight; the overall difference alone cannot answer this.
3
Compare outcome patterns.
Examine outcome summaries across weight groups or other relevant groups. Larger weights matter more to the estimate when they are attached to records with different outcome values.
4
Compare represented shares and subgroup results.
Contrast unweighted sample shares with weighted shares, and examine group-specific summaries to see whether composition changes or within-group patterns account for the overall difference.

Worked Comparisons

Worked Example: A Difference Driven by Group Composition

Hypothetical data. Suppose a survey records weekly exercise hours for 10 respondents in two age groups. Six respondents are in Group A, with an unweighted mean of 10 hours and weight 1 each. Four are in Group B, with an unweighted mean of 20 hours and weight 3 each. Within each group, all records have the same weight.

The unweighted mean is

$$ \bar{x}=\frac{6(10)+4(20)}{10} =\frac{140}{10}=14.0\text{ hours}. $$

The weighted mean is

$$ \hat{\mu}_w =\frac{6(1)(10)+4(3)(20)}{6(1)+4(3)} =\frac{60+240}{18} =16.67\text{ hours}. $$

Group A accounts for \(6/10=60\%\) of the sample but \(6/18=33.3\%\) of the total weight. Group B accounts for \(40\%\) of the sample and \(12/18=66.7\%\) of the total weight. Because weights are constant within each group, the weighted and unweighted group means are identical; the within-group component is zero. The overall increase from 14.0 to 16.67 hours is due to the greater weighted representation of Group B, whose mean is higher.

Worked Example: Outcomes Differ Across Weight Groups

Hypothetical data. Consider four respondents’ daily screen time, in hours. Two have weight 1 and outcomes 2 and 4 hours; two have weight 4 and outcomes 8 and 10 hours. For this diagnostic, group records by these two weight values.

The unweighted mean is

$$ \bar{x}=\frac{2+4+8+10}{4} =\frac{24}{4}=6.00\text{ hours}. $$

The weighted mean is

$$ \hat{\mu}_w =\frac{1(2)+1(4)+4(8)+4(10)}{1+1+4+4} =\frac{78}{10}=7.80\text{ hours}. $$

The low-weight group has an unweighted mean of \((2+4)/2=3.00\) hours; the high-weight group has an unweighted mean of \((8+10)/2=9.00\) hours. The groups each contain half the respondents, but the high-weight group contributes \(8/10=80\%\) of the total weight. Within each group the weights are constant, so the group’s weighted mean equals its unweighted mean. The higher overall weighted mean follows from giving more representation to the group with the higher screen-time values.

This pattern is a diagnostic description of these hypothetical records. It does not establish why the weights differ, whether the weighted result is closer to a population value, or whether the observed difference is larger than would be expected from sampling variability.

Why the Decomposition Works

The identity separates two sources of change without requiring an approximation. Since the records form a partition, the unweighted mean is the sum of group means multiplied by sample shares: each group contributes the fraction \(n_g/n\) of the records. Likewise, the weighted mean is the sum of weighted group means multiplied by weight shares: each group contributes the fraction \(W_g/W\) of the total weight. Subtract the first sum from the second and insert \(\sum_g P_g\bar{y}_g\):

$$ \begin{aligned} \hat{\mu}_w-\bar{x} &=\sum_g P_g\bar{y}_{wg}-\sum_g p_g\bar{y}_g\\ &=\sum_g P_g\bar{y}_g-\sum_g p_g\bar{y}_g +\sum_g P_g\bar{y}_{wg}-\sum_g P_g\bar{y}_g\\ &=\sum_g(P_g-p_g)\bar{y}_g +\sum_gP_g(\bar{y}_{wg}-\bar{y}_g). \end{aligned} $$

In the first term, the group means are held at their unweighted values while the shares change from \(p_g\) to \(P_g\). In the second term, the weighted shares are held fixed while the within-group means change from \(\bar{y}_g\) to \(\bar{y}_{wg}\). This particular decomposition uses unweighted group means as the reference for the composition component. Another decomposition could use a different reference, so report the definition used when presenting components.

When the Overall Difference Conceals Subgroup Patterns

Worked Example: Opposing Within-Group Changes

Hypothetical data. Suppose a health score is recorded for four respondents in two regions. In Region A, scores are 8 and 12, with weights 1 and 3. In Region B, scores are 16 and 24, with weights 3 and 1. There are two respondents in each region.

The unweighted regional means are 10 for Region A and 20 for Region B, so the overall unweighted mean is

$$ \bar{x}=\frac{8+12+16+24}{4}=15.0\text{ points}. $$

The weighted mean is

$$ \hat{\mu}_w =\frac{1(8)+3(12)+3(16)+1(24)}{1+3+3+1} =\frac{116}{8}=14.50\text{ points}. $$

Within Region A, the weighted mean is \((1(8)+3(12))/4=11\) points, one point above its unweighted mean. Within Region B, it is \((3(16)+1(24))/4=18\) points, two points below its unweighted mean. Each region has half the total weight, as well as half the sample records. The weighted overall mean is only 0.50 point lower than the unweighted mean, despite these opposing regional changes. Looking only at the aggregate comparison would conceal both patterns.

A small overall difference does not show that weights have little effect in every subgroup: positive and negative changes can offset. Conversely, a large overall difference need not imply that every subgroup changes substantially; a composition shift between groups with different outcome levels can produce it. Subgroup comparisons and the decomposition help make these possibilities visible.

Common Mistakes and Interpretation

  • Calling a weighted–unweighted gap a bias estimate. The gap compares two summaries of the observed records. It does not measure the error of either estimate relative to an unknown population value.
  • Explaining a gap using weight variation alone. Weight variation is not enough: if high- and low-weight records have similar outcomes, reweighting may change the summary little. Examine how outcomes vary across the weight pattern.
  • Assuming the weighted share is a literal head count. A group’s weighted share is its share of the sum of weights, not its fraction of sampled respondents. Describe it as weighted representation, not as the number of people observed.
  • Interpreting a small aggregate gap as no subgroup effect. Differences in opposite directions can cancel. Compare group-specific summaries when subgroup patterns matter.
  • Treating the comparison as an uncertainty assessment. The difference alone does not provide a standard error, confidence interval, or significance test. Those require appropriate survey-design variance methods.
Key takeaway: Diagnose a weighted–unweighted discrepancy by examining both who is represented differently and how outcomes vary across the weighting pattern. The comparison describes how the summaries differ; interpretation requires the group shares, subgroup outcomes, and the context of the target population.

Check Your Understanding

Answer each question using the definitions and reasoning above.

  1. What does the unweighted mean give equal contribution to, and how does this differ from the weighted mean?
  2. In the decomposition, what does the composition component compare? What does the within-group component compare?
  3. If weights are constant within every group, which component of the displayed decomposition is zero? Explain why.
  4. Can an overall weighted–unweighted difference be small when subgroup differences are substantial? Describe how.
  5. Why does a discrepancy between the two summaries not, by itself, show that weighting has reduced bias?
Clinical Biostats