Tutorials › Pharmacokinetic-Pharmacodynamic (PK/PD) Modeling › A Worked Workflow for PD Model Diagnostics

Model Diagnostics Specific to PD · Tutorial 475 of 598

A Worked Workflow for PD Model Diagnostics

Learn to turn longitudinal PD residual plots into a structured diagnostic argument, while keeping residual signs, scaling, and follow-up checks tied to the model and data.

Advanced 12 min read

What You'll Learn

  • Define and scale residuals for longitudinal continuous PD observations
  • Choose time, exposure, and subgroup plots that address distinct diagnostic questions
  • Interpret residual signs and trends in the context of the response scale
  • Combine diagnostic evidence without treating plots as formal model-selection tests
  • Prioritize plausible misspecifications and specify targeted follow-up checks

From Residuals to a Diagnostic Argument

A collection of diagnostic plots is useful only when each plot addresses a question and its pattern is interpreted consistently with the residual definition. In a longitudinal pharmacodynamic (PD) analysis, one model may appear adequate overall while missing a time course, an exposure-response shape, or a subgroup difference. A practical workflow therefore constructs residuals on an appropriate scale, examines them against time and exposure, checks relevant subgroups, and then compares the evidence before deciding what to investigate next.

The workflow is diagnostic, not an automatic procedure for selecting a replacement model. A visible pattern is a clue about where the current model may be inadequate; it does not identify a unique cause. The interpretation must account for the response scale, the observation model, the sampling schedule, and repeated observations within subjects. The earlier material on residual autocorrelation, delayed effects, baseline and placebo structure, turnover, tolerance and rebound, and exposure-response shape provides specific pattern interpretations that can inform this synthesis.

Definition: For subject \(i\) at observation \(j\), let \(Y_{ij}\) be the observed PD response and let \(\hat{Y}_{ij}\) be the model-predicted response for the diagnostic target being assessed. The raw residual is \(e_{ij}=Y_{ij}-\hat{Y}_{ij}\). A positive residual means the observation is above the prediction; a negative residual means it is below. When the observation model specifies a conditional standard deviation \(\hat{\sigma}_{ij}\), a standardized residual may be defined as \(r_{ij}=e_{ij}/\hat{\sigma}_{ij}\). The prediction type and residual scaling must be stated because population-level and individual-conditional predictions answer different questions.

For continuous outcomes, residuals are most directly interpreted when the model describes the conditional mean and the variance model is appropriate. Raw residuals are in the response’s units, but their spread may change with the mean or other predictors. Standardized residuals put observations on a comparable scale only to the extent that the estimated \(\hat{\sigma}_{ij}\) is suitable. If the response is binary, ordinal, count, or time-to-event, use diagnostics appropriate to that observation model rather than treating raw differences as ordinary continuous residuals; the earlier material on those outcome types addresses their residual construction.

Before reading any pattern, record the residual definition, prediction target, response units, and variance scaling. For repeated data, also note whether the plotted residuals are conditional on subject-specific effects or use population predictions. A pattern in population residuals may reflect unexplained between-subject variation; a pattern remaining in conditional residuals points more directly toward within-subject structure or the observation model. Neither version is universally preferable: they answer different questions.

Worked Workflow: Build and Read the Diagnostics

1
Set the diagnostic target.
Specify whether the purpose is to assess population predictions, individual fits, or both. Use the same prediction target when comparing related plots, and keep subject identity available so repeated patterns are not hidden by pooling.
2
Construct residuals on the correct scale.
For continuous PD, calculate \(e_{ij}=Y_{ij}-\hat{Y}_{ij}\), and, when justified by the variance model, \(r_{ij}=e_{ij}/\hat{\sigma}_{ij}\). For other outcome types, use outcome-appropriate residuals or predictive diagnostics.
3
Plot against time.
Examine residuals against study time and, when relevant, time since dose or time since an event. Look for sustained runs, curvature, changing spread, or a pattern that recurs around dosing. Distinguish a time trend from serial dependence; a time plot alone does not establish the cause.
4
Plot against exposure.
Plot residuals against a clearly defined exposure metric, such as the model-relevant concentration at the observation time. Check whether the residual center or spread changes over the exposure range, and consider whether time or dose history could explain the same pattern.
5
Check scientifically relevant subgroups.
Use prespecified or scientifically motivated strata, such as dose group, baseline category, or a demographic group. Compare residual centers, spread, and shapes without mistaking differences in sampling or exposure distributions for subgroup-specific model failure.
6
Combine evidence and choose a follow-up.
Ask which pattern is reproducible, whether different plots tell a coherent story, and what targeted check could distinguish plausible explanations. Record competing explanations and uncertainty rather than treating one visual feature as proof.

Worked Example: Constructing and Interpreting a Standardized Residual

In a hypothetical continuous PD analysis, a subject has an observed response of \(12.4\) response units at one visit. The model predicts \(11.8\) response units, and the model’s conditional residual standard deviation at that observation is \(1.5\) response units. Calculate the raw and standardized residuals.

Using \(e_{ij}=Y_{ij}-\hat{Y}_{ij}\),

$$ e_{ij}=12.4-11.8=0.6\text{ response units}. $$

The observation is \(0.6\) response units above the prediction. Standardizing by the stated conditional standard deviation gives

$$ r_{ij}=\frac{e_{ij}}{\hat{\sigma}_{ij}} =\frac{0.6\text{ response units}}{1.5\text{ response units}} =0.400. $$

The standardized residual is positive and equals \(0.400\) on the standardized scale. This calculation is meaningful only if \(1.5\) response units is the appropriate conditional standard deviation for this observation and the prediction corresponds to the intended diagnostic target. It does not, by itself, indicate a misspecification: the residual must be considered alongside other observations and diagnostic plots.

Reading Time and Exposure Patterns

Time-based plots ask whether discrepancies depend on when observations occur. Plotting against study time can reveal a persistent drift that may be consistent with a baseline, placebo, turnover, or disease-progression issue. Plotting against time since dose may instead reveal a repeated phase-specific discrepancy, such as predictions that are systematically high shortly after dosing and low later. A recurring pattern after each dose can be obscured if all observations are plotted only against study time. Sparse or irregular schedules also mean that some time regions may be supported by few observations, so apparent gaps or bends should be checked against the actual sampling distribution.

Exposure-based plots ask whether errors vary across the exposure range. The exposure variable should be scientifically and temporally appropriate: concentration at the observation time is not interchangeable with cumulative exposure or a lagged exposure metric. A trend may suggest that the fitted exposure-response relationship is not capturing the observed response contrast, but time, dose, baseline, and subject composition can be entangled with exposure. A plot is a diagnostic clue, not evidence that exposure itself causes the residual pattern.

Worked Example: Calculating an Exposure-Residual Trend

Consider four hypothetical observations from a continuous PD analysis. Exposure is concentration at the observation time, in mg/L, and residuals use \(e=Y-\hat{Y}\), in response units.

Concentration (mg/L)Residual (response units)
11.2
20.6
4-0.4
8-1.0

The residual mean is \(\bar{e}=(1.2+0.6-0.4-1.0)/4=0.100\) response units. The mean concentration is \(\bar{C}=(1+2+4+8)/4=3.75\) mg/L. As a compact numerical summary of the pattern, calculate the ordinary least-squares slope of residual on concentration:

$$ b=\frac{\sum_{k=1}^{4}(C_k-\bar{C})(e_k-\bar{e})} {\sum_{k=1}^{4}(C_k-\bar{C})^2} =\frac{-8.700}{28.75} =-0.3026\text{ response units per (mg/L)}. $$

For example, the numerator is \((-2.75)(1.1)+(-1.75)(0.5)+(0.25)(-0.5)+(4.25)(-1.1)=-8.700\). The denominator is \(7.5625+3.0625+0.0625+18.0625=28.75\). With \(e=Y-\hat{Y}\), positive residuals at low exposure mean predictions are below observations there, while negative residuals at high exposure mean predictions are above observations there. The pattern is consistent with an exposure-related prediction contrast that is too large on the observed response scale, subject to checking time, dose, and other covariates. Four points do not establish a trend or identify its cause; the slope summarizes this hypothetical pattern only.

The earlier material on exposure-response shape, saturation, delayed effects, and hysteresis offers distinct mechanisms that can yield exposure-related residual patterns. To prioritize among them, examine whether the residual pattern persists after accounting for timing and whether it appears across subjects and dose groups. For example, a trend that disappears when exposure is represented with a plausible lag motivates a different follow-up from a trend that remains at matched times but changes mainly at high concentrations.

Subgroups and Combined Evidence

Subgroup plots can reveal systematic underprediction or overprediction in particular parts of the population. Begin with a reason for the subgroup definition and check whether groups have comparable coverage of time and exposure. If one group is mostly observed at low exposure and another mostly at high exposure, a pooled exposure trend can look like a subgroup effect, or vice versa. Plot residuals by subgroup against time or exposure when data support it, and show the number and distribution of observations rather than relying on a summary alone.

Worked Example: Comparing Residual Centers by Subgroup

Suppose a hypothetical PD model is evaluated in two prespecified baseline strata. Their residuals, in response units, are:

Stratum A: \(0.4,\ 0.2,\ 0.6\). Its mean is \((0.4+0.2+0.6)/3=0.400\) response units.
Stratum B: \(-0.3,\ -0.6,\ -0.6\). Its mean is \((-0.3-0.6-0.6)/3=-0.500\) response units.

The difference in these descriptive means, A minus B, is \(0.400-(-0.500)=0.900\) response units. Under the stated residual definition, the model predictions are, on average, below observations in Stratum A and above observations in Stratum B. This pattern motivates checking whether baseline or a related covariate is represented adequately. Before attributing the difference to subgroup-specific model behavior, compare the strata’s time and exposure coverage and inspect individual residual patterns. With only three observations per stratum, these means are descriptive and imprecise, not a formal test of a subgroup effect.

Combined evidence is strongest when separate views support a coherent explanation. A time pattern occurring at similar times across exposure levels differs from a pattern that appears only at high exposure. A subgroup offset at all times suggests a different diagnostic question from a subgroup difference that emerges only after dosing. Conversely, apparently conflicting plots may reflect confounding among time, exposure, and subgroup membership, or simply limited data in some regions. The next check should be designed to clarify the ambiguity rather than to confirm the first interpretation.

Observed patternPlausible concern to investigateTargeted follow-up
Residuals drift with study time across exposure levelsBaseline, placebo, turnover, or progression structureCompare residuals by treatment and time; inspect predicted and observed trajectories
Residuals recur by time since doseDelay, turnover, tolerance, or rebound dynamicsAlign residuals by dosing time and compare repeated dose cycles
Residuals change across exposure after accounting for timingExposure-response shape, saturation, or exposure metricCheck the range and coverage; compare residual patterns against alternative scientifically relevant exposure summaries
Residual centers differ by subgroupBaseline or covariate structure, or unequal predictor coverageCompare subgroup distributions of time and exposure and inspect within-stratum plots

Assumptions, Alternatives, and Failure Modes

Residual plots rely on a meaningful comparison between observations and predictions. The response and prediction must be on the same scale; the prediction must correspond to the intended population or individual target; and any standardized residual must use a defensible variance estimate. Plots also need enough observations across the predictor ranges being interpreted. If several observations come from each subject, they are not independent pieces of information. Subject-level clustering and serial dependence can make a dense plot look more persuasive than the number of independent subjects warrants.

Plots are complementary, not interchangeable. Observed-predicted plots summarize calibration across predictions; individual fits show subject-level trajectory agreement; predictive checks compare observed summaries with model-generated distributions; and residual plots emphasize conditional discrepancies against covariates or time. None alone gives a complete diagnostic assessment. In particular, a good overall predictive check can coexist with a subgroup pattern, and an unstructured residual scatter does not prove that the model is correct.

  • Using raw residuals despite changing variance. A widening cloud may arise from heteroscedasticity rather than a changing mean. Compare raw and appropriately standardized residuals and inspect the observation variance model.
  • Ignoring the residual sign convention. With \(e=Y-\hat{Y}\), positive means prediction below observation, and negative means prediction above observation. Interpret every directional statement using that definition.
  • Pooling away repeated structure. A pooled cloud can conceal recurring subject-specific or dose-cycle patterns. Retain subject identifiers and examine relevant within-subject displays.
  • Calling a pattern a mechanism. A trend against exposure does not uniquely diagnose Emax misspecification, delay, or any other mechanism. Check competing time and exposure explanations.
  • Over-interpreting sparse regions. A few points at extreme exposure or late time cannot support a stable conclusion. Show coverage and treat the pattern as a prompt for follow-up.
  • Searching many subgroups until one looks unusual. Unplanned slicing increases the chance of seeing chance patterns. Give priority to scientifically motivated strata and seek confirmation in a targeted analysis.

This workflow is limited by the information in the data and by the adequacy of the candidate prediction used to construct residuals. Diagnostics can prioritize plausible problems, but they cannot guarantee that all relevant misspecifications have been found or distinguish mechanisms that produce similar patterns. The disciplined conclusion is therefore conditional: describe what the plots show, state what that pattern is consistent with, and name the next check that could clarify it.

Check Your Understanding

Answer each question using the residual definition and diagnostic distinctions from this workflow. Brief solutions follow.

  1. If \(Y=7.8\) response units and \(\hat{Y}=8.3\) response units, what is \(e=Y-\hat{Y}\), and what does its sign mean?
  2. Why might a residual-versus-exposure trend be misleading if exposure increases with time since treatment began?
  3. What additional information is needed before interpreting a larger raw residual spread at high predicted responses as mean misspecification?
  4. If two subgroups have different residual means, name one coverage check and one targeted follow-up plot.
  5. Why does an unstructured residual plot not prove that a longitudinal PD model is correct?

Solutions. (1) \(e=7.8-8.3=-0.5\) response units; the observation is below the prediction. (2) Time and exposure are entangled, so a time-related discrepancy can appear associated with exposure; inspect residuals against time and compare observations with suitable time and exposure coverage. (3) Check whether residual variance changes with the mean and whether the model’s variance specification is appropriate; compare appropriately standardized residuals if justified. (4) Compare the groups’ time and exposure distributions; plot residuals against time or exposure within each subgroup, showing the observation coverage. (5) Limited power, sparse coverage, an unsuitable residual scale, or misspecifications not represented in the plotted dimensions can hide problems; diagnostics provide evidence, not proof of correctness.

Clinical Biostats