Tutorials › Population Pharmacokinetics › Visual Predictive Checks Across Continuous Covariates

Predictive Checks · Tutorial 379 of 599

Visual Predictive Checks Across Continuous Covariates

Learn to construct and interpret VPC summaries across continuous covariates, choosing between covariate ranges and smooth summaries while preserving the observed study design.

Intermediate 10 min read

What You'll Learn

  • Define VPC statistics across prespecified continuous-covariate ranges.
  • Construct smooth covariate-specific quantile summaries and apply them consistently to observed and simulated data.
  • Interpret pointwise simulation envelopes in the context of covariate support and sample size.
  • Diagnose patterns that pooled or arbitrarily stratified VPCs can conceal.
  • Compare range-based and smooth approaches and recognize their limitations.

Why Examine a Continuous Covariate in a VPC?

A population VPC asks whether concentrations observed under a study design are compatible with concentrations generated by the fitted population PK model. A covariate-focused VPC asks a more specific question: does that compatibility change across values of a continuous covariate? A pooled display can look adequate even when predictions are systematically high for people with low body weight and low for people with high body weight. Conversely, dividing a continuous covariate into categories can make a trend difficult to see and can leave too few observations in some categories.

The covariate might be body weight, age, or a continuous measure of renal function. The display does not estimate a causal effect of that covariate. It checks whether the model's predictive behavior is consistent with observed concentrations across its range, while accounting for the sampling and dosing design used to define the predictive-check target.

Definition: A continuous-covariate VPC compares concentration summaries from the observed data with the same summaries from simulated data, conditional on or organized by values of a continuous covariate. The covariate dimension can be represented by prespecified ranges or by a smooth, locally calculated summary. The observed and simulated summaries must use the same time definitions, covariate definitions, and calculation rules.

Define the Covariate-Conditional Summary

Let \(C\) denote a concentration observation, \(t\) its sampling time, and \(x\) the value of a continuous covariate for the subject who contributed that observation. A conventional VPC may divide time into bins \(B_j\) and calculate selected concentration quantiles in each bin. To examine covariate behavior, the statistic can also be indexed by covariate.

One transparent approach is to define covariate ranges \(I_g\) before inspecting the resulting discrepancies. For example, \(I_1=[40,60)\) kg and \(I_2=[60,80]\) kg. Within each time bin \(B_j\) and covariate range \(I_g\), calculate a concentration quantile. If \(C_{(1)}\le \cdots \le C_{(m)}\) are the ordered concentrations in a cell containing \(m\) records, the nearest-rank empirical quantile at probability \(q\) is \(C_{(\lceil mq\rceil)}\). The same quantile convention must be used for observed and simulated data.

$$ \widehat Q_{\mathrm{obs}}(q;j,g) = \text{quantile at }q\text{ of }\{C_i:t_i\in B_j,\ x_i\in I_g\} $$

For each simulated replicate \(b\), calculate \(\widehat Q_b(q;j,g)\) in exactly the same cell. The distribution of these replicate statistics supplies the model reference for that cell. Ordinarily, the covariate values and sampling design are held at their observed values while concentrations are regenerated according to the predictive-check target. The simulation scheme must also match whether the target is population-level or conditional; these targets are not interchangeable.

Ranges should be scientifically interpretable and sufficiently populated. They need not have equal widths or equal sample sizes. A range boundary chosen after viewing a striking discrepancy can exaggerate that pattern, so define boundaries in advance when possible and report them clearly. If both time and covariate are divided into many cells, the resulting joint cells may be sparse even when each dimension alone has ample data.

Worked Example: A Quantile in a Covariate Range

Suppose a hypothetical study has five observed concentrations, in mg/L, in one time bin for subjects with body weight from 40 kg up to, but not including, 60 kg. The ordered concentrations are 7.8, 9.1, 10.0, 11.4, and 14.2 mg/L. Use the nearest-rank convention to calculate the 10th, 50th, and 90th percentiles.

Here \(m=5\). For \(q=0.10\), the rank is \(\lceil 5(0.10)\rceil=1\), so the 10th percentile is 7.8 mg/L. For \(q=0.50\), the rank is \(\lceil 5(0.50)\rceil=3\), so the median is 10.0 mg/L. For \(q=0.90\), the rank is \(\lceil 5(0.90)\rceil=5\), so the 90th percentile is 14.2 mg/L.

Suppose that, across 500 simulated replicates, the median of the replicate medians is 10.2 mg/L and the central 90% pointwise reference envelope for the median runs from 9.3 to 11.5 mg/L. The observed median, 10.0 mg/L, lies within that envelope. This is compatible with the model for this particular summary and cell; it is not proof that the model is correct or that every part of the concentration distribution is adequate.

Smooth Summaries Across Covariate Values

Instead of creating ranges, a smooth display can estimate a concentration quantile locally around each covariate value \(x_0\). A simple method uses a kernel weight \(w_i(x_0)\) that decreases as the distance between \(x_i\) and \(x_0\) increases. The weighted empirical quantile is the smallest concentration value for which the cumulative weight of observations at or below that value reaches at least the fraction \(q\) of the total weight.

$$ \widehat Q(q;x_0,j) = \inf\left\{c: \frac{\sum_{i:t_i\in B_j}w_i(x_0)\,\mathbf{1}(C_i\le c)} {\sum_{i:t_i\in B_j}w_i(x_0)} \ge q\right\} $$

Here \(\mathbf{1}(C_i\le c)\) equals 1 when \(C_i\le c\) and 0 otherwise. A common weight choice is a Gaussian kernel, \(w_i(x_0)=\exp[-(x_i-x_0)^2/(2h^2)]\), where \(h\) controls the width of the local neighborhood. A small \(h\) emphasizes nearby observations but can make the estimate unstable; a large \(h\) is smoother but can hide local changes. Choose and report the smoothing rule, and apply it identically to the observed data and every simulated replicate.

Worked Example: A Locally Weighted Median

Consider four hypothetical records in one time bin, with body weight \(x_i\) in kg and concentration \(C_i\) in mg/L: \((62,8)\), \((68,12)\), \((72,10)\), and \((80,18)\). Estimate the local median at \(x_0=70\) kg using the Gaussian weights with \(h=10\) kg.

The respective weights are \(\exp[-(62-70)^2/200]=0.7261\), \(\exp[-(68-70)^2/200]=0.9802\), \(\exp[-(72-70)^2/200]=0.9802\), and \(\exp[-(80-70)^2/200]=0.6065\). Their total is \(3.293\), so half the total weight is \(1.6465\).

Order the records by concentration: 8 mg/L has weight 0.7261; 10 mg/L has weight 0.9802; 12 mg/L has weight 0.9802; and 18 mg/L has weight 0.6065. Cumulative weight reaches 0.7261 at 8 mg/L and 1.7063 at 10 mg/L. Since \(1.7063\ge1.6465\), the weighted median is 10 mg/L.

This is a local estimate, not a concentration prediction for an individual weighing exactly 70 kg. In a VPC, the same weighted-median calculation is repeated for each simulated replicate at the same covariate value, with the same bandwidth and time-bin definition.

Reference Envelopes and Their Interpretation

At each time and covariate location, a reference envelope summarizes the distribution of a statistic across simulated replicates. For example, the 5th and 95th percentiles of the 500 simulated medians form a central 90% pointwise envelope for the median. The observed median can then be compared with this envelope. Apply the comparison separately to each plotted quantile: the median and the upper concentration quantile assess different features of the predictive distribution.

A pointwise envelope is not a simultaneous band for the whole curve. Even when the model is adequate, some observed points may fall outside pointwise 90% envelopes simply by chance, especially when many time-covariate locations are examined. The simulations must preserve the relevant subject-level design, including repeated observations within subjects, rather than treating correlated concentration records as independent simulated subjects.

The justification for the comparison is direct. If the model and simulation target are appropriate and model parameters are treated as fixed, the observed dataset and a dataset simulated under the same design have the same predictive distribution under the model. Applying the same statistic to each gives comparable values. The simulated distribution therefore provides a reference for the observed statistic. In practice, parameters are estimated from data, so a plug-in simulation does not make the observed and simulated statistics exactly exchangeable; the envelope is a model-based diagnostic, not a formal guarantee of calibration.

$$ \widehat Q_{\mathrm{obs}}(q;x_0,j) \quad\text{compared with}\quad \{\widehat Q_b(q;x_0,j):b=1,\ldots,B\} $$

Worked Example: A Pooled VPC Can Hide Opposing Trends

Suppose that, in a single time bin, a hypothetical low-weight range has observed concentrations 7, 8, and 9 mg/L, while a high-weight range has 15, 16, and 17 mg/L. The observed group medians are 8 and 16 mg/L. The corresponding simulated reference medians are 10 mg/L for the low-weight range and 14 mg/L for the high-weight range.

The observed median is 2 mg/L below its reference in the low-weight range: \(8-10=-2\) mg/L. In the high-weight range it is 2 mg/L above its reference: \(16-14=2\) mg/L. Thus the discrepancies point in opposite directions across the covariate.

If the six observed concentrations are pooled, their ordered values are 7, 8, 9, 15, 16, and 17 mg/L; the pooled median is \((9+15)/2=12\) mg/L. If the corresponding simulated values are 9, 10, 11, 13, 14, and 15 mg/L, their pooled median is \((11+13)/2=12\) mg/L as well. The pooled medians agree, despite the range-specific pattern. A covariate-focused display can reveal this pattern, although the small example alone does not establish that the differences are meaningful; simulation variability and the amount of data in each range still matter.

Choosing a Display and Diagnosing Problems

Ranges and smooth summaries answer related but not identical practical needs. Ranges are easy to explain and reproduce, and their cell membership is explicit. Smooth summaries preserve more of the covariate ordering and can show gradual trends without a single boundary separating nearby subjects. Their appearance, however, depends on the smoothing method and bandwidth. Neither approach is automatically preferable: the choice should reflect the scientific question, covariate support, and available information.

ApproachUseful featureMain risk
Prespecified covariate rangesClear group definitions and straightforward summariesBoundary effects and sparse time-by-range cells
Smooth local summariesDisplays gradual changes across supported covariate valuesDependence on bandwidth and instability where local data are scarce
Pooled VPCConcise overall assessmentCan conceal opposing covariate-specific discrepancies

Several checks help determine whether a display is informative. Show where observed covariate values occur, or otherwise report their range and density; a smooth curve beyond well-supported values can suggest precision the data do not contain. Check the number of subjects and records contributing to each range or local neighborhood. Review time-bin definitions as well, because a covariate pattern can be confused by changes in sampling time or dosing across covariate values. If a discrepancy appears only under a very narrow bandwidth or only for one arbitrary range boundary, treat it cautiously and assess whether it is stable under reasonable, prespecified alternatives.

A useful comparison is to examine the pooled VPC alongside the covariate-focused VPC, not to replace one with the other. The pooled display assesses overall predictive behavior; the covariate display asks whether that behavior is consistent over a continuous predictor. The earlier material on stratified visual predictive checks provides the categorical-strata framework; continuous-covariate summaries retain ordered covariate information rather than treating each category as unrelated.

Common Mistakes and Limitations

  • Choosing ranges only after seeing the plot. This can make chance discrepancies look like planned findings. Define meaningful ranges before examining the comparison when feasible, and report any exploratory choices.
  • Using different calculations for observed and simulated data. Different time bins, covariate rules, quantile conventions, or smoothing parameters invalidate the direct comparison. Use one complete calculation procedure for both.
  • Interpreting a pointwise envelope as a guarantee for the whole curve. A point outside a pointwise envelope is a location-specific warning, not by itself a simultaneous test of the entire model.
  • Reading a smooth curve where data support is weak. Kernel weights can produce a number even when few observations are near \(x_0\). Report local support and avoid strong interpretation in poorly represented regions.
  • Treating a covariate pattern as causal. A VPC checks predictive behavior under the observed design. It does not establish that changing the covariate would cause a concentration change.

These displays remain summaries. They can depend on the chosen concentration quantiles, time bins, covariate ranges, or smoothing rule, and they may have limited resolution in sparse designs. An adequate display for a median does not ensure adequate predictions for the tails or for every individual. Interpret the plotted statistics together with the study design and other predictive diagnostics.

Key takeaway: A continuous-covariate VPC checks whether concentration summaries track the model's predictive distribution across supported covariate values. Use explicit ranges or a documented smooth summary, apply the same procedure to observed and simulated data, and interpret pointwise envelopes in light of sparse support and the full design.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. Why must the observed and simulated data use the same covariate ranges or smoothing rule?
  2. A smooth median matches the simulated reference around 60 kg but is above it near 90 kg, where very few subjects were observed. What limits the interpretation?
  3. For ordered concentrations 4, 6, 9, 12, and 20 mg/L, what are the nearest-rank 50th and 90th percentiles?
  4. Why can a pooled VPC miss a covariate-related prediction problem even if its overall median agrees with the simulated reference?

Solutions. (1) The VPC comparison is meaningful only when both datasets are summarized by the same statistic under the same definitions; otherwise a difference may result from the calculation rather than model predictions. (2) Sparse local support makes the estimate unstable and less informative at 90 kg; the smooth curve should not be read as strong evidence there. (3) With \(m=5\), the median rank is \(\lceil5(0.50)\rceil=3\), giving 9 mg/L. The 90th-percentile rank is \(\lceil5(0.90)\rceil=5\), giving 20 mg/L. (4) Opposing discrepancies at different covariate values can offset in the pooled summary, concealing conditional patterns that a covariate-focused display would show.

Clinical Biostats