Tutorials › Survey Sampling › Confidence Intervals for Quantiles and Distribution Functions

Weighted Descriptive Analysis · Tutorial 719 of 998

Confidence Intervals for Quantiles and Distribution Functions

Learn to construct and interpret confidence intervals for weighted CDF values and quantiles using design-based standard errors.

Intermediate 10 min read

What You'll Learn

  • Construct a confidence interval for a weighted cumulative distribution estimate at a fixed threshold
  • Use a design-based standard error to form a large-sample interval on the probability scale
  • Derive the approximate standard error of a weighted quantile
  • State when a density-based quantile interval is appropriate
  • Invert CDF intervals to obtain an outcome-scale quantile interval
  • Distinguish uncertainty in a quantile from uncertainty in a CDF value

Two Different Scales of Uncertainty

A survey may estimate the proportion of a target population whose outcome is at or below a specified threshold, or it may estimate a population percentile such as the median. Both summaries come from the distribution of the outcome, but their uncertainty is expressed on different scales. A confidence interval for a cumulative distribution function (CDF) value is on the probability scale; a confidence interval for a quantile is on the outcome scale, with units such as years, dollars, or minutes.

The distinction matters in practice. A probability-scale interval answers how uncertain the estimated proportion below a fixed threshold is. An outcome-scale interval answers how uncertain the estimated threshold is at which a specified fraction of the population lies below it. The intervals require design-based uncertainty estimates: the variance calculation must reflect the survey design, rather than treating the weighted records as a simple random sample.

Definition: Let \(Y\) be an outcome for a member of the target population. Its population CDF is \(F(y)=P(Y\le y)\). For a fixed probability \(p\), the population \(p\)-quantile is \(Q(p)=\inf\{y:F(y)\ge p\}\). The weighted empirical CDF \(\hat F(y)\) estimates \(F(y)\), and the weighted sample quantile \(\hat Q(p)\) estimates \(Q(p)\). A confidence interval for \(F(y)\) is expressed in probabilities; a confidence interval for \(Q(p)\) is expressed in outcome units.

The earlier material on weighted empirical CDFs and weighted quantiles establishes how \(\hat F(y)\) and \(\hat Q(p)\) are calculated. Here the focus is how to quantify their uncertainty. Write \(SE\{\hat F(y)\}\) for the design-based standard error of the CDF estimate at a fixed \(y\). It should be obtained using a method appropriate to the survey design, such as linearization or valid replicate weights. The same principle applies to the quantile: its standard error must reflect the design.

Confidence Intervals for CDF Values

For a fixed threshold \(y\), suppose \(\hat F(y)\) is approximately normally distributed around \(F(y)\), with a design-based standard error that estimates its sampling standard deviation. A large-sample two-sided confidence interval is

$$ \hat F(y)\ \pm\ z_{1-\alpha/2}SE\{\hat F(y)\}. $$

Here \(1-\alpha\) is the nominal confidence level, and \(z_{1-\alpha/2}\) is the corresponding standard normal critical value. For a 95% interval, \(z_{0.975}\) is approximately 1.96. If the survey variance procedure specifies a \(t\) reference distribution with design degrees of freedom, use its appropriate critical value instead. Because a CDF value must lie between 0 and 1, a simple Wald interval extending outside that range should not be reported as if it were a valid probability interval; use an appropriate bounded procedure in that situation.

Worked Example: A CDF Interval at a Fixed Threshold

In a hypothetical complex survey, the estimated weighted CDF for annual out-of-pocket medication spending at \(y=\$500\) is \(\hat F(500)=0.62\). A design-based variance calculation gives \(SE\{\hat F(500)\}=0.035\). Assume the large-sample normal approximation is suitable and use a 95% interval.

The estimate is a proportion, so the interval is on the probability scale. Its margin of error is

$$ 1.96(0.035)=0.0686. $$

Thus the interval is

$$ 0.62\pm0.0686=(0.5514,\ 0.6886). $$

The estimated population proportion with annual spending at or below $500 is 62%. Under repeated sampling with this design and the stated interval procedure, 95% of intervals constructed in this way would cover the population proportion. The result is about a population proportion at the fixed $500 threshold; it is not an interval for a spending percentile.

The threshold must be treated as fixed for this interpretation. If the threshold is selected after inspecting the same survey estimates, the pointwise interval at that threshold does not automatically provide simultaneous coverage across all possible thresholds. Likewise, a collection of pointwise CDF intervals is not, without an additional procedure, a simultaneous confidence band for the whole CDF.

Confidence Intervals for Quantiles

A quantile interval is more demanding because it translates uncertainty in probabilities into uncertainty in outcome values. When the population distribution is continuous near the target quantile and has a positive, reasonably smooth density there, a local linear approximation gives a useful standard error. Let \(q=Q(p)\), and write \(f(q)\) for the population density at \(q\). The design-based variance of \(\hat F(q)\) measures uncertainty in the estimated CDF at the true quantile. A plug-in approximation to the quantile standard error is

$$ SE\{\hat Q(p)\}\ \approx\ \frac{SE\{\hat F(\hat Q(p))\}}{\hat f(\hat Q(p))}, $$

where \(\hat f(\hat Q(p))\) estimates the density near the estimated quantile. The numerator is measured on the probability scale and the density has units of probability per outcome unit. Their ratio therefore has outcome units, as a quantile standard error must.

Condition for the density-based interval: The target quantile should be in the interior of a continuous part of the population distribution, with positive density in a neighborhood of the quantile. The design-based CDF estimate should have a suitable large-sample approximation, and the density estimate should be sufficiently stable. If the distribution has a jump, a flat region, or very little local density, this approximation can be unreliable.

Under these conditions, a large-sample interval is \(\hat Q(p)\pm z_{1-\alpha/2}SE\{\hat Q(p)\}\). This is an approximation, not a universal formula for every outcome distribution. In particular, ties and discrete outcomes can make the relationship between CDF uncertainty and quantile uncertainty non-smooth. The density-based calculation should not be applied mechanically in those settings.

Why the Quantile Standard Error Has This Form

The approximation follows by expanding the CDF near the true quantile. For a continuous distribution with positive density at \(q\), \(F(q)=p\), and for a small change \(h\),

$$ F(q+h)\ \approx\ F(q)+f(q)h. $$

The estimated quantile is approximately the value at which the estimated CDF reaches \(p\). Replacing the population CDF by the estimated CDF and applying the local expansion gives

$$ p\ \approx\ \hat F(\hat Q(p)) \ \approx\ \hat F(q)+f(q)\{\hat Q(p)-q\}. $$

Since \(F(q)=p\), rearrangement yields

$$ \hat Q(p)-q\ \approx\ -\frac{\hat F(q)-F(q)}{f(q)}. $$

Multiplying a random error by a constant divides its variance by the square of that constant. Therefore, to first order,

$$ \operatorname{Var}\{\hat Q(p)\}\ \approx\ \frac{\operatorname{Var}\{\hat F(q)\}}{f(q)^2}, \qquad SE\{\hat Q(p)\}\ \approx\ \frac{SE\{\hat F(q)\}}{f(q)}. $$

In practice, \(q\), the CDF standard error at \(q\), and the density are unknown, so they are replaced by estimates. The approximation explains why quantiles are especially uncertain where the distribution is relatively flat: a small change in probability then corresponds to a larger change in the outcome value.

Worked Example: A Density-Based Interval for a Median

In a hypothetical survey of adults, the estimated weighted median time spent commuting is \(\hat Q(0.5)=18.4\) minutes. The design-based standard error of the CDF estimate near this median is 0.024. A local density estimate is \(\hat f(18.4)=0.040\) per minute. Assume the distribution is continuous with positive, stable density near the median, the design-based normal approximation is suitable, and use a 95% interval.

The estimated quantile standard error is

$$ SE\{\hat Q(0.5)\}\ \approx\ \frac{0.024}{0.040}=0.600\text{ minutes}. $$

The 95% margin of error is \(1.96(0.600)=1.176\) minutes, giving

$$ 18.4\pm1.176=(17.224,\ 19.576)\text{ minutes}. $$

Rounded to one decimal place, the interval is 17.2 to 19.6 minutes. It is an outcome-scale interval for the population median commute time. Its validity depends not only on the estimated CDF uncertainty but also on the local density approximation; the stated continuity and positive-density conditions are therefore important.

Quantile Intervals by Inverting CDF Intervals

A second way to express quantile uncertainty is to invert CDF intervals. At each fixed outcome value \(y\), form a lower and upper confidence limit \(L(y)\) and \(U(y)\) for \(F(y)\). For a continuous distribution at the target quantile, \(F(Q(p))=p\). The quantile interval can then be obtained from the outcome values where the CDF limits cross \(p\): the lower endpoint is where the upper CDF limit reaches \(p\), and the upper endpoint is where the lower CDF limit reaches \(p\).

More precisely, when the limits are ordered monotonically in \(y\), the lower endpoint is the largest \(y\) for which \(U(y)<p\), and the upper endpoint is the smallest \(y\) for which \(L(y)\ge p\). The logic is that an upper limit below \(p\) supports that the quantile lies above \(y\), while a lower limit at or above \(p\) supports that it lies at or below \(y\). In continuous settings, inversion of appropriate pointwise intervals can give a confidence set for the quantile. With only a finite grid of outcome values, the crossing locations are approximate and may need interpolation.

Worked Example: Inverting CDF Limits for a Median

A hypothetical survey estimates the weighted median of a continuous health-measurement outcome. The table gives pointwise 95% CDF intervals at selected outcome values. For illustration, the intervals use the large-sample normal formula and the bounds are already calculated.

Outcome value \(y\)\(\hat F(y)\)\(SE\{\hat F(y)\}\)95% CDF interval
100.3600.040(0.282, 0.438)
120.4300.035(0.361, 0.499)
140.5100.030(0.451, 0.569)
160.5900.035(0.521, 0.659)

The target probability is \(p=0.5\). At \(y=12\), the upper limit is 0.499, which is below 0.5; thus the lower endpoint is at least 12 on this grid. At \(y=14\), the lower limit is 0.451, below 0.5, so this value does not establish that the median is at or below 14. At \(y=16\), the lower limit is 0.521, above 0.5, so the upper endpoint is reached by 16. With the available grid, the inverted interval is approximately

$$ [12,\ 16]\text{ outcome units}. $$

This is an outcome-scale interval for the population median, whereas each row of the table gives a probability-scale interval for a CDF value. The grid is coarse, so the endpoints are only as precise as the evaluated outcome values; finer evaluation or justified interpolation could refine them.

The inversion argument relies on the behavior of the CDF at the target quantile and on appropriately constructed limits. Pointwise CDF intervals do not constitute a simultaneous confidence band over all \(y\). If the distribution is discrete and \(F(Q(p))\) can exceed \(p\) because of a jump, the continuous-crossing argument does not directly give the same coverage guarantee. Discrete outcomes and ties require methods that account for that structure rather than an unexamined density approximation.

Common Mistake and Practical Checks

A common mistake is to confuse the units or targets of the two intervals. For example, an analyst might report a CDF interval of 0.55 to 0.69 as an interval for the median, or report an interval of 17 to 20 minutes as uncertainty in the proportion below a threshold. Neither is correct: the first describes a probability at a specified outcome value, and the second describes an outcome quantile.

A second pitfall is to treat weighted observations as independent, equally informative records when calculating uncertainty. The weighted estimate alone does not determine its standard error. The variance procedure must use the available design information, including the relevant stratification, clustering, and weights, or an appropriate replicate-weight method. A final check is to verify units: a CDF estimate and its standard error are dimensionless, while a quantile and its standard error carry the units of the measured outcome.

Key takeaway: For a fixed outcome threshold, report uncertainty for the weighted CDF on the probability scale. For a quantile, report uncertainty on the outcome scale, using a design-based quantile standard error or a justified inversion procedure. State the design-based method, the assumptions supporting the interval, and the outcome units where relevant.

Check Your Understanding

Use the definitions and conditions in this tutorial to answer the following questions.

  1. A weighted CDF estimate at a fixed threshold is 0.40 with design-based standard error 0.025. Using a large-sample normal approximation, calculate its 95% interval and state what population quantity it concerns.
  2. A quantile estimate is 30 units, the CDF standard error near it is 0.02, and the estimated local density is 0.01 per unit. Calculate the approximate quantile standard error and identify its units.
  3. Why can a small density near a quantile produce a wide outcome-scale confidence interval?
  4. In an inverted median interval, what does it indicate when the upper CDF limit at \(y\) is below 0.5?
  5. Why should the density-based quantile standard error not be used mechanically for an outcome with a large point mass at the target quantile?
Clinical Biostats