Tutorials › Survey Sampling › Weighted Empirical Cumulative Distribution Functions

Weighted Descriptive Analysis · Tutorial 705 of 998

Weighted Empirical Cumulative Distribution Functions

Build and interpret a weighted empirical distribution, and calculate threshold proportions with careful attention to boundary values.

Intermediate 10 min read

What You'll Learn

  • Define the weighted empirical cumulative distribution function from observed outcomes and survey weights
  • Interpret its value at a threshold as an estimated weighted proportion at or below that threshold
  • Calculate proportions strictly below or above a threshold, distinguishing them from inclusive versions
  • Estimate proportions within an interval using the correct endpoint conventions
  • Recognize how ties create jumps in the weighted empirical distribution
  • Check the eligible records and denominator before calculating a weighted proportion

Why Use a Weighted Empirical Distribution?

A cumulative distribution function describes how much of a population lies at or below each possible outcome value. In a survey, the observed sample may represent different numbers of population members from record to record. An unweighted cumulative proportion treats every record equally; a weighted empirical cumulative distribution function instead lets each record contribute according to its survey weight.

This function is useful for describing the distribution of a measured outcome and for answering threshold questions. For example, a survey analyst may need to estimate the population proportion with a score at or below a cutoff, above a clinical threshold, or between two limits. These are all evaluations of the same weighted distribution, provided the endpoint conventions are handled correctly.

Definition: Suppose \(n\) eligible sampled units have observed outcomes \(y_1,\ldots,y_n\) and nonnegative survey weights \(w_1,\ldots,w_n\), with \(\sum_{i=1}^{n}w_i>0\). The weighted empirical cumulative distribution function is $$ \hat{F}_w(t)=\frac{\sum_{i=1}^{n} w_i I(y_i\leq t)}{\sum_{i=1}^{n}w_i}, $$ where \(I(y_i\leq t)\) equals 1 when \(y_i\leq t\) and 0 otherwise. It is the weighted proportion of eligible sampled units whose outcome is at or below \(t\).

The denominator is the sum of weights for the records included in the calculation. The numerator is the sum of weights for those included records whose outcomes meet the stated condition. The weight may be an expansion weight or another survey weight intended to make a sampled unit represent a different number of population members. The function is an estimate of the target population distribution, not a count of sampled records.

The calculation requires an observed outcome and a usable weight for each included record, nonnegative weights, and a positive total weight. If the target is a particular eligible group, include only records in that group in both numerator and denominator. A weighted distribution for all sampled units does not automatically describe a subgroup.

How the Function Behaves

For any threshold \(t\), \(\hat{F}_w(t)\) is between 0 and 1. As \(t\) increases, the function cannot decrease, because units already counted at a lower threshold remain counted at a higher one. It is a step function: it changes only at observed outcome values. When several units have the same value, their weights contribute together to the jump at that value.

These properties follow directly from the indicator in the definition. If \(a\leq b\), then \(I(y_i\leq a)\leq I(y_i\leq b)\) for every unit. Multiplying by nonnegative \(w_i\), summing, and dividing by the same positive denominator gives \(\hat{F}_w(a)\leq\hat{F}_w(b)\). At an observed value \(t\), the jump includes all units with outcome exactly \(t\):

$$ \hat{F}_w(t)-\hat{F}_w(t^-) = \frac{\sum_{i=1}^{n}w_i I(y_i=t)}{\sum_{i=1}^{n}w_i}, $$

where \(\hat{F}_w(t^-)\) denotes the value immediately to the left of \(t\). Thus, ties are not discarded or split: their combined weight determines the jump.

Worked Example: Evaluating the Function at a Tied Value

In a hypothetical survey, five eligible respondents report weekly hours of exercise. Their outcomes and survey weights are shown below. Estimate the weighted proportion reporting at most 4 hours.

Outcome \(y_i\) (hours)Weight \(w_i\)
22
41
43
62
82

The total weight is \(2+1+3+2+2=10\). At most 4 hours includes the records at 2 and both records at 4, with combined weight \(2+1+3=6\). Therefore,

$$ \hat{F}_w(4)=\frac{2+1+3}{10}=\frac{6}{10}=0.600. $$

The estimate is a weighted population proportion of 60.0% at or below 4 hours. The two records tied at 4 contribute both of their weights; counting only one of them would incorrectly omit weight 3.

Proportions Below and Above a Threshold

The function as defined uses an inclusive threshold: \(\hat{F}_w(t)\) estimates the proportion with \(Y\leq t\). A strictly-below proportion uses \(Y<t\), so it must exclude any weight at exactly \(t\). A strictly-above proportion uses \(Y>t\), while an at-or-above proportion uses \(Y\geq t\). These distinctions matter whenever outcomes can equal the cutoff, especially for integer-valued scores, counts, or rounded measurements.

Threshold identities: For the same eligible records and denominator, $$ \widehat{P}_w(Y\leq t)=\hat{F}_w(t),\qquad \widehat{P}_w(Y>t)=1-\hat{F}_w(t). $$ For strict inequality below the threshold and inclusive inequality above it, $$ \widehat{P}_w(Y<t)=\hat{F}_w(t^-),\qquad \widehat{P}_w(Y\geq t)=1-\hat{F}_w(t^-). $$

Here the hat indicates an estimate formed from the weighted sample, not a known population probability. The complement identities hold because every included record satisfies exactly one of \(Y\leq t\) or \(Y>t\), and exactly one of \(Y<t\) or \(Y\geq t\). For instance, “above 4” is ambiguous in ordinary language: specify whether it means strictly greater than 4 or at least 4, then use the corresponding formula.

Worked Example: Strictly Above Versus At or Above

For a hypothetical survey of symptom scores, five eligible respondents have scores \(7,10,12,12,15\) and weights \(4,2,1,3,2\), respectively. Estimate the proportions with scores strictly above 10 and at least 10.

The total weight is \(4+2+1+3+2=12\). The weight at or below 10 is \(4+2=6\), so

$$ \hat{F}_w(10)=\frac{6}{12}=0.500,\qquad \widehat{P}_w(Y>10)=1-\hat{F}_w(10)=1-0.500=0.500. $$

The weight at scores strictly greater than 10 is \(1+3+2=6\), confirming the complement calculation. For scores at least 10, include the weight 2 at exactly 10 as well:

$$ \widehat{P}_w(Y\geq 10)=\frac{2+1+3+2}{12} =\frac{8}{12}=0.667. $$

Thus the estimated proportion strictly above 10 is 50.0%, whereas the estimated proportion at or above 10 is 66.7%. Their difference, \(2/12=0.167\), is the weighted share with a score exactly equal to 10.

Proportions Within an Interval

An interval proportion is a weighted sum over records whose outcomes fall within the specified limits, divided by the total eligible weight. It is often possible to express this calculation using the cumulative function, but the endpoint convention determines which version is correct. Subtracting two ordinary cumulative values gives a half-open interval:

$$ \hat{F}_w(b)-\hat{F}_w(a) = \widehat{P}_w(a<Y\leq b). $$

The reason is that the records with \(Y\leq a\) appear in both cumulative totals and cancel; what remains is the weight with \(a<Y\leq b\). For an interval including both endpoints, the lower endpoint must be excluded from the subtracted cumulative total. If the outcome has an observed value at \(a\), use the left limit \(\hat{F}_w(a^-)\). Alternatively, sum the weights for the interval condition directly.

Worked Example: Inclusive Interval With a Boundary Tie

A hypothetical survey records a laboratory score for six eligible respondents. The outcomes are \(1,2,3,3,5,7\), with corresponding weights \(1,2,1,3,2,1\). Estimate the proportion with scores from 2 through 5, inclusive.

The total weight is \(1+2+1+3+2+1=10\). Scores in the interval \([2,5]\) have weights \(2,1,3,2\), including both observations at 3 and the observation at the upper endpoint 5. Therefore,

$$ \widehat{P}_w(2\leq Y\leq 5) =\frac{2+1+3+2}{10} =\frac{8}{10}=0.800. $$

The same answer follows from the cumulative function. The weight at scores at most 5 is \(1+2+1+3+2=9\), so \(\hat{F}_w(5)=9/10\). Immediately below 2, only the score-1 record is counted, giving \(\hat{F}_w(2^-)=1/10\). Hence,

$$ \widehat{P}_w(2\leq Y\leq 5) =\hat{F}_w(5)-\hat{F}_w(2^-) =\frac{9}{10}-\frac{1}{10}=0.800. $$

Using \(\hat{F}_w(5)-\hat{F}_w(2)\) instead would exclude the score-2 record, because \(\hat{F}_w(2)\) includes that boundary value. It would estimate \(2<Y\leq5\), not the requested inclusive interval.

A Practical Construction and Interpretation

A reliable calculation begins by defining the target group and the precise inequality, not by sorting and accumulating weights without a clear endpoint rule. For a desired threshold or interval, check which records qualify, add their weights, and divide by the weight total for the same eligible group. The function can also be displayed at each distinct observed outcome by accumulating tied weights in increasing outcome order.

1
Set the analysis group.
Identify the records with observed outcomes and valid weights that belong in the target population or subgroup.
2
Choose the endpoint rule.
Write the condition explicitly, such as \(Y\leq t\), \(Y>t\), or \(a\leq Y\leq b\).
3
Calculate the weighted share.
Sum weights satisfying the condition and divide by the total weight for the analysis group.
4
Report in context.
State the endpoint convention and interpret the result as an estimated population proportion for the specified group.

Multiplying every weight by the same positive constant leaves the function unchanged: both its numerator and denominator are multiplied by that constant, which cancels in the ratio. The important feature for this descriptive calculation is therefore the relative contribution of records, not the overall scale of the weights.

A weighted empirical distribution is a descriptive estimate. The weights must be appropriate for the intended target and analysis group, but this construction alone does not quantify sampling uncertainty. Survey-design-based standard errors and confidence intervals require additional variance calculations; a weighted proportion should not be presented as though the sample were a simple random sample merely because the formula is a ratio.

Common Mistakes

  • Using the number of records as the denominator. The weighted proportion denominator is the sum of eligible weights, not \(n\), unless all weights happen to be equal.
  • Forgetting equality at the cutoff. \(\hat{F}_w(t)\) includes outcomes equal to \(t\). Its complement estimates the proportion strictly greater than \(t\), not the proportion at least \(t\).
  • Subtracting the wrong cumulative values for an interval. \(\hat{F}_w(b)-\hat{F}_w(a)\) describes \(a<Y\leq b\). To include the lower endpoint, use \(\hat{F}_w(a^-)\) or sum the qualifying weights directly.
  • Changing the denominator between calculations. Numerator and denominator must refer to the same eligible group; otherwise the result is not the weighted proportion within that group.
Key takeaway: The weighted empirical CDF at \(t\) is the share of total eligible weight attached to outcomes \(Y\leq t\). Complements and differences give other threshold proportions, but ties and endpoint inclusion determine exactly which records belong in each calculation.

Check Your Understanding

For each question, state the appropriate endpoint rule before calculating or explaining the result.

  1. In a weighted sample, what does \(\hat{F}_w(8)\) estimate: the proportion below 8, at most 8, or above 8?
  2. Why does \(1-\hat{F}_w(8)\) estimate a strictly-above proportion rather than an at-or-above proportion?
  3. What interval is represented by \(\hat{F}_w(12)-\hat{F}_w(5)\)?
  4. How would you calculate the weighted proportion with outcomes from 5 through 12, inclusive, if some outcomes equal 5?
  5. A subgroup analysis includes only eligible adults. Which records belong in the denominator of its weighted CDF?
Clinical Biostats