Tutorials › Quantitative Systems Pharmacology (QSP) › Diagnosing Source-Specific Residual Patterns

Calibrating to Multiple Data Sources · Tutorial 594 of 799

Diagnosing Source-Specific Residual Patterns

Learn how to construct scale-aware residual plots and recognize calibration failures that a pooled objective can hide.

Advanced 12 min read

What You'll Learn

  • Define raw and standardized residuals relative to a stated observation model.
  • Compare residual patterns across data sources without confusing measurement scales or objective weights.
  • Diagnose source-level offsets, assay-specific patterns, time drift, and response-dependent error.
  • Interpret residual plots while accounting for parameter fitting and correlated observations.
  • Distinguish a diagnostic signal from a definitive explanation of its cause.

Why Inspect Residuals by Group?

A calibration can have an acceptable pooled objective while fitting one data source systematically too high and another too low. Because the contributions can cancel, an overall score or pooled residual average may hide a pattern that matters for interpreting the model and its predictions. Residual plots make the direction, scale, and location of those discrepancies visible.

Here the diagnostic question is whether discrepancies organize by source, assay, time, or response level. A pattern is evidence that the current model-and-measurement description does not account for some structure in the observations. It does not, by itself, identify the cause. For example, a source-specific pattern could reflect a source-specific measurement issue or a model limitation that matters only under that source’s conditions.

Definition: For observation \(i\), let \(y_i\) be the measured response and \(\hat{y}_i\) the model-predicted response at the fitted parameter values and the corresponding experimental conditions. The raw residual is \(e_i=y_i-\hat{y}_i\). A positive residual means the observation exceeds the prediction; a negative residual means the prediction exceeds the observation. If the observation model gives a measurement standard deviation \(\sigma_i\), the standardized residual is \(r_i=e_i/\sigma_i\).

The notation \(\sigma_i\) here denotes the specified observation-level measurement scale, not a universal constant shared by every assay. It can depend on source, assay, response magnitude, or other features if that dependence is part of the stated observation model. For measurements analyzed on a transformed scale, define and inspect residuals on that scale as well. The scale and sign convention must be stated before interpreting a plot.

Constructing Comparable Diagnostic Plots

Begin with the measurement model and the calibration objective. If observations are modeled as having mean \(\hat{y}_i\) and standard deviation \(\sigma_i\), then \(r_i=e_i/\sigma_i\) expresses each discrepancy in measurement-standard-deviation units. When the same model is appropriate and the stated scales are correct, residuals from different measurement scales are more comparable after standardization than as raw differences. This comparison still depends on the observation model being appropriate.

A source weight in a joint calibration objective is a separate quantity from the measurement standard deviation. For example, an objective may sum \(w_i r_i^2\), where \(w_i\) is a chosen source or design weight. Do not multiply a residual by a weight and then call the result a standardized residual: it mixes a diagnostic scale with the calibration objective’s weighting choice. Plot \(r_i\) to inspect discrepancies relative to the measurement model, and report weighted contributions separately when they are relevant.

For each plot, preserve the identity of the observation. Useful displays include standardized residuals against source or assay, time, and predicted response; a zero reference line makes direction easy to see. Show individual observations when possible, and distinguish replicates or clusters when their dependence matters. Earlier material on handling replicates and within-study correlation established that correlated observations are not independent pieces of information. A collection of residuals from one correlated series should not be read as many independent confirmations of a pattern.

1
State the residual scale.
Specify whether residuals are raw, standardized by \(\sigma_i\), or calculated on a transformed response scale.
2
Label the grouping and conditions.
Retain source, assay, time, response level, and relevant protocol information so a visible pattern can be localized.
3
Look for structure, not just magnitude.
Check for offsets, trends, curvature, changing spread, and isolated observations, then compare the pattern with the assumed observation model.
4
Record the scope of the finding.
Describe which observations show the pattern and what it suggests, without treating a plot as proof of a particular cause.

What Residual Patterns Mean

DisplayPattern to look forDiagnostic implication
Residuals by sourceOne group is mostly above or below zeroPossible source-specific offset or calibration mismatch
Residuals by assayOne assay has a distinct offset, trend, or spreadPossible assay-specific measurement or observation-model issue
Residuals against timeOrdered drift, curvature, or a change in spreadTime-dependent structure is not represented adequately by the fitted description
Residuals against predicted responseTrend, curvature, or spread increasing with responsePossible response-dependent bias, missing response structure, or misspecified error scale

A flat cloud around zero is a useful diagnostic target, not a guarantee that the model is correct. A plot can have little visible structure while important errors remain undetected, particularly with few observations or a narrow range of conditions. Conversely, one unusual residual need not imply a systematic failure. Interpret the plot alongside the experimental design, the measurement scale, and the number and dependence of observations.

Worked Example: Opposing Source Patterns Hidden by Pooling

Suppose a hypothetical calibration has four observations from each of two sources. Residuals are in response units; the measurement standard deviation is 2 units for Source A and 5 units for Source B.

Source A: raw residuals are \(+2,+1,+2,+1\) units. Their mean is \((2+1+2+1)/4=1.5\) units. Each standardized residual is the raw residual divided by 2, giving \(1,0.5,1,0.5\); their mean is \(0.75\).

Source B: raw residuals are \(-6,-4,-5,-5\) units. Their mean is \((-6-4-5-5)/4=-5\) units. Dividing by 5 gives standardized residuals \(-1.2,-0.8,-1,-1\), with mean \(-1\).

The pooled raw mean is \((6-20)/8=-1.75\) units. That summary does not show that every Source A residual is positive while every Source B residual is negative. The pooled standardized mean is \((3-4)/8=-0.125\), also near zero despite the clear opposing group patterns. A plot by source reveals the cancellation. This is a diagnostic signal of source-associated structure, not a determination of its cause.

Short Justification: Why Standardization Helps

Suppose the observation model is \(y_i=\mu_i+\epsilon_i\), where \(\mu_i\) is the modeled mean and the measurement error has mean zero and standard deviation \(\sigma_i\). If the model prediction equals \(\mu_i\) and the parameters are fixed, then \(e_i=y_i-\mu_i=\epsilon_i\). Therefore \(E(e_i)=0\), and the standard deviation of \(e_i\) is \(\sigma_i\). Dividing by that scale gives \(r_i=e_i/\sigma_i\), with mean zero and standard deviation one under this simple model.

This argument explains the scale comparison; it does not say fitted residuals are independent or exactly have standard deviation one. Fitting parameters to the same observations can constrain residuals and change their variation. Correlation between observations changes their joint behavior as well. Thus, use standardized residuals as a scale-aware diagnostic, not as independent test statistics with an automatic reference distribution.

Worked Example: Detecting Drift Across Time

A hypothetical longitudinal assay has six measurements taken at equally spaced times. The observation model specifies a standard deviation of 2 response units at each time. The residuals in time order are \(-2,-1,0,+1,+2,+3\) units.

The standardized residuals are \(-2/2=-1\), \(-1/2=-0.5\), \(0/2=0\), \(1/2=0.5\), \(2/2=1\), and \(3/2=1.5\). In order, they rise steadily from \(-1\) to \(1.5\), rather than fluctuating around zero.

The pattern indicates that predictions are initially above observations and later below them, relative to the stated measurement scale. A time-ordered residual plot would make the drift apparent. The residual mean is \(({-2-1+0+1+2+3})/6=0.5\) units, but that one average does not describe the change in sign and direction over time. The series is hypothetical and the pattern motivates investigation; it does not alone establish why the fitted predictions drift from the measurements.

Response Level, Assay, and Error Scale

A residual-versus-response plot can reveal more than one kind of structure. A trend in the residual center suggests that discrepancies vary with response level. A fan-shaped spread suggests that the variability may change with response, which is different from a changing mean. The relevant comparison depends on the observation model: a constant absolute error scale and a constant proportional error scale imply different expected patterns on the raw response scale.

When a response is strictly positive and the measurement model is multiplicative, a log-scale residual can be informative. For prediction \(\hat{y}_i>0\), define \(e_i^{\log}=\log(y_i)-\log(\hat{y}_i)=\log(y_i/\hat{y}_i)\), provided \(y_i>0\) as well. This is a relative discrepancy on a log scale, not a raw difference in response units. The scale must match the measurement model and the scientific use of the response.

Worked Example: Recognizing Proportional Bias

Consider four hypothetical positive assay responses. Predictions are \(10,20,40,80\) units, and observed values are \(11,22,44,88\) units. The raw residuals are \(1,2,4,8\) units, respectively, so their magnitude increases with response.

For each point, the observed-to-predicted ratio is \(1.1\). The log-scale residual is therefore \(\log(1.1)=0.09531\) for all four observations. The same discrepancy can be described as a 10% excess over prediction at each response level, since \((y_i-\hat{y}_i)/\hat{y}_i=0.1\).

The raw residual plot would show increasing absolute differences, while the log-scale residuals show a constant proportional discrepancy. Neither view should be selected just because it looks flatter: the appropriate view depends on whether the assay error is reasonably described as additive or multiplicative. This example signals a consistent proportional offset; it does not establish whether the explanation lies in the assay or in the model.

Diagnostics, Limitations, and Common Mistakes

Inspect residuals separately for sources and assays before relying on a pooled display. Within a source, order longitudinal observations by time; across sources, compare standardized residuals only when their scales have defensible interpretations. Against response level, inspect both the center and the spread. If residuals are correlated, retain that structure in the display and interpretation rather than treating every point as independent evidence.

A residual plot is a descriptive diagnostic, not a formal hypothesis test and not a procedure for choosing a particular correction. A visible pattern may arise from several different mechanisms, and a pattern may be hard to see with sparse data. A near-zero pooled mean, a good aggregate fit score, or small residuals in the units of a high-variance assay cannot rule out systematic miscalibration in a subgroup.

  • Mistake: interpreting a pooled average near zero as evidence that every source is well calibrated. Opposing positive and negative source means can cancel. Plot and summarize residuals by source and assay.
  • Mistake: comparing raw residual sizes across assays with different measurement scales. A difference of 5 units can have very different significance relative to the measurement scale. Use the observation model’s standardization when appropriate and report raw units for context.
  • Mistake: treating objective weights as measurement standard deviations. Weights determine a source’s contribution to the calibration objective; they do not, by themselves, define a residual’s measurement scale.
  • Mistake: calling an increasing raw residual magnitude a changing mean bias without checking scale. It may reflect proportional error or changing variance. Compare the pattern with the assumed response scale and error model.

The main alternative to a grouped residual display is a single pooled summary or objective value. That summary is useful for describing aggregate fit, but discards the grouping and ordering needed to diagnose localized patterns. A residual table grouped by source or assay can supplement plots, particularly when there are few observations, but it also cannot show ordering or shape as clearly as a plot. Use the display that retains the structure relevant to the diagnostic question.

The next step after finding a pattern is to investigate it with the scientific and measurement context in view. A residual pattern alone cannot decide whether the issue is measurement conflict, model misfit, or another feature of the calibration. Avoid making that causal conclusion from the plot alone.

Check Your Understanding

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

  1. An observation is 18 units and its prediction is 21 units. What is the raw residual, and what does its sign mean?
  2. Two sources have mean raw residuals of \(+2\) and \(-2\) units. What could a pooled mean conceal?
  3. Residuals rise in time order, but the series contains correlated repeated measurements. What can you conclude, and what should you avoid concluding?
  4. For a positive response, observations are consistently 5% above predictions at low and high response levels. Which scale could help describe this pattern, and why?

Solutions. 1. \(e=18-21=-3\) units, so the prediction exceeds the observation by 3 units. 2. If the groups have equal size, the pooled mean is zero, concealing opposing source-specific offsets; inspect residuals by source. 3. The ordered pattern suggests time-associated structure relative to the predictions, but correlation means the points are not independent confirmations; do not infer the cause from the plot alone. 4. A log-scale residual can express a constant proportional discrepancy: for a ratio of \(1.05\), it is \(\log(1.05)\) at either response level, provided the positive-response measurement model supports that scale.

Clinical Biostats