Why Inspect Model Fit Within Subgroups?
A population pharmacokinetic model can describe the overall concentration data reasonably well and still systematically overpredict one subgroup while underpredicting another. A pooled goodness-of-fit plot may hide this pattern: positive and negative errors can cancel when groups are combined. Subgroup diagnostics therefore ask a focused question: after the fitted covariate effects are applied, do observations from each relevant subgroup show similar, unsystematic agreement with predictions?
This question is useful for models containing sex, race or ethnicity categories, genotype, or co-medication covariates. It is not answered by checking whether a fitted coefficient has a particular estimate or uncertainty. Instead, the diagnostics examine how predictions compare with observations across the covariate groups and whether residuals retain structure. A discrepancy is a reason to investigate, not by itself proof that a covariate effect is missing or that the fitted effect is wrong.
In nonlinear mixed-effects models, population predictions and individual predictions answer different diagnostic questions. A population prediction, often denoted PRED, uses population-level parameters and covariates without using that individual's estimated random effects. An individual prediction, often denoted IPRED, also uses estimates of that individual's random effects. Population predictions are especially useful for noticing a group-level mismatch that individual estimates might partly absorb. Individual predictions help assess how well the model describes observed profiles after accounting for estimated individual variation, but they can look reassuring even when the population model has a systematic subgroup problem.
Residuals may be raw, weighted, or standardized according to the model and software. Weighted residuals account for the assumed observation-error variance; standardized residuals additionally express errors in units of their expected standard deviation. The exact construction depends on the model and estimation method. Interpret a residual against its stated definition rather than assuming all residual types have identical scales or distributions. Under a well-specified model, residuals should generally fluctuate around zero without a persistent pattern, but fitted residuals are not guaranteed to be independent or exactly normally distributed.
What a Subgroup Diagnostic Can Establish
Suppose \(g\) denotes a subgroup, and \(r_{ij}\) is a standardized residual. If the model gives the correct conditional mean for observations in that group, then the expected prediction error in the group is zero. If the residual standardization uses a positive scale \(s_{ij}\), then:
The second implication holds when the conditional mean error is zero observation by observation, because division by a known positive scale preserves a zero expectation. It motivates inspecting subgroup residual centers. It does not mean that every sample mean residual must equal zero, or that a nonzero sample mean proves a model defect. Finite samples vary, repeated observations from the same individual are correlated, and parameter estimates were obtained from the data. Small or sparse subgroups may therefore produce unstable patterns.
A practical diagnostic combines several views rather than relying on one summary:
- Plot observations against population predictions, using separate symbols or panels for subgroups and a reference line where observation equals prediction.
- Plot residuals against time after dose, predicted concentration, and other relevant design features, stratified by covariate group where sample sizes permit.
- Summarize subgroup prediction and residual distributions, including the number of individuals and observations contributing to each summary.
- Check whether a pattern is driven by a few individuals, a particular sampling window, or a narrow concentration range rather than appearing across the group.
A subgroup mean can be a useful compact summary, but it does not replace plots. For example, positive and negative residuals at different times can average to nearly zero while revealing a time-dependent misspecification. Conversely, a small nonzero mean can be compatible with ordinary sampling variation, especially when observations are clustered within a small number of individuals.
Worked Example: Comparing Residual Centers by Sex Group
In a hypothetical model evaluation, six standardized population residuals are available in each of two sex groups. Group A has residuals \(-0.2,\ 0.1,\ 0.3,\ -0.1,\ 0.2,\ -0.3\). Group B has residuals \(-0.8,\ -0.4,\ -0.5,\ -0.5,\ -0.6,\ -0.5\). Calculate and interpret the subgroup means.
For Group A, the sum is \(-0.2+0.1+0.3-0.1+0.2-0.3=0.0\). Thus:
For Group B, the sum is \(-0.8-0.4-0.5-0.5-0.6-0.5=-3.3\). Thus:
Group A's residuals are centered at zero in this small set, whereas Group B's average residual is 0.55 standardized-residual units below zero. With residual defined as observation minus prediction, the negative direction means the model predictions tend to exceed observations in Group B. This is a descriptive signal to inspect the group-specific plots, time windows, covariate coding, and data. It does not establish that the sex effect is incorrect: the six residuals could be correlated, and other design or model features could explain the pattern.
Look for Patterns Across Time and Prediction
Residuals should be examined against time after dose and predicted concentration because a subgroup mismatch may only occur in part of the profile. A group-specific trend across time can be consistent with an inadequately described absorption phase, distribution phase, or elimination pattern. A trend across predicted concentration can indicate that errors change with concentration, which may point toward an observation-error or structural-model issue rather than a simple group-wide shift. These are diagnostic possibilities, not unique explanations: several mechanisms can produce similar plots.
The following example illustrates why an overall subgroup average is not enough. Residuals are standardized and defined as observation minus prediction. The values are hypothetical; early and late refer to prespecified sampling windows.
Worked Example: A Subgroup Pattern That Changes Over Time
For Group A, the early-time residuals are \(-0.2,\ 0.0,\ 0.1,\ 0.1\), and the late-time residuals are \(-0.1,\ 0.1,\ 0.0,\ 0.0\). For Group B, the early-time residuals are \(-0.8,\ -0.4,\ -0.5,\ -0.5\), and the late-time residuals are \(0.3,\ 0.5,\ 0.7,\ 0.9\). Calculate the means in each group and window.
For Group A early, the sum is \(-0.2+0.0+0.1+0.1=0.0\), giving \(0.0/4=0.000\). For Group A late, the sum is \(-0.1+0.1+0.0+0.0=0.0\), also giving \(0.000\).
For Group B early, the sum is \(-0.8-0.4-0.5-0.5=-2.2\), giving \(-2.2/4=-0.550\). For Group B late, the sum is \(0.3+0.5+0.7+0.9=2.4\), giving \(2.4/4=0.600\).
For Group B, the early-time mean is 0.55 residual units below zero, while the late-time mean is 0.60 units above zero. The opposite signs suggest a time-dependent pattern rather than a single constant overprediction or underprediction across Group B. Combining all eight Group B residuals gives \((-2.2+2.4)/8=0.025\), close to zero, which would conceal the pattern if only the overall mean were reported. The next diagnostic step is to view the profiles and sampling distribution by individual and window, then check whether timing, dose history, covariate records, and model structure are comparable across groups.
Prediction Summaries and Plot Interpretation
A subgroup prediction summary can communicate the direction and approximate size of a discrepancy in concentration units. One simple summary, appropriate when observations are comparable across groups, is the relative difference between the subgroup mean observed concentration and subgroup mean population prediction:
This calculation is descriptive. It is most interpretable when the groups have observations at similar dose histories and sampling times, and when the compared means summarize comparable records. If one group is sampled earlier or has a different concentration range, a mean difference can reflect that imbalance rather than a covariate effect. Plotting paired or otherwise matched prediction summaries by time or concentration can help expose this problem.
Worked Example: Relative Prediction Differences by Genotype
In a hypothetical diagnostic summary, three comparable observations in each of two genotype groups have the following population predictions and observations, in mg/L. Group 1 has PRED values \(8,\ 10,\ 12\) and \(DV\) values \(8.4,\ 10.5,\ 12.3\). Group 2 has the same PRED values \(8,\ 10,\ 12\) and \(DV\) values \(6.4,\ 8.0,\ 9.6\). Calculate the subgroup relative differences.
In each group, the mean prediction is \((8+10+12)/3=10.0\) mg/L. For Group 1, the mean observation is \((8.4+10.5+12.3)/3=31.2/3=10.4\) mg/L. Therefore:
The Group 1 mean observation is 4.00% above its mean prediction. For Group 2, the mean observation is \((6.4+8.0+9.6)/3=24.0/3=8.00\) mg/L. Therefore:
The Group 2 mean observation is 20.0% below its mean prediction. Because the example uses the same prediction values in both groups, this contrast is not caused by a difference in the listed prediction range. It is still only a diagnostic summary of six observations. It does not demonstrate that genotype caused the discrepancy, nor does it account for uncertainty or dependence among observations. A plot by individual and sampling time is needed before deciding whether the difference is broad and systematic.
Diagnostics, Alternatives, and Limitations
Subgroup-stratified plots should be read alongside pooled plots. The pooled view is efficient for finding broad problems affecting all observations; stratification can reveal errors that cancel between groups. A plot of observed versus population-predicted concentrations emphasizes calibration and the direction of prediction error. A residual-versus-time or residual-versus-prediction plot emphasizes trends that may be difficult to see on the concentration scale. Individual-prediction plots provide a complementary view of profile fit, but they should not replace population-prediction diagnostics when the question is whether the covariate model predicts subgroups appropriately.
A visual pattern is not a formal test of a covariate effect and does not supply a confidence interval or a probability that the fitted model is correct. Parameter uncertainty and covariate-effect uncertainty should be interpreted using the relevant estimates and uncertainty summaries; diagnostics answer the complementary question of whether residual structure remains. Avoid selecting a more complicated covariate model solely because one of many subgroup plots looks unusual. The number of comparisons, subgroup sizes, and intended use of the model all matter.
When a pattern appears, first verify that the comparison is fair. Check subgroup counts at the individual level as well as the observation level; one participant with many samples must not be mistaken for many independent participants. Confirm category coding, genotype records, medication timing, dose histories, sample times, and concentration units. Then inspect whether groups differ in design features, co-medications, or concentration ranges. A residual pattern may be caused by an omitted structural feature, an error-model mismatch, sparse sampling, or data quality problems rather than the particular covariate being displayed.
Diagnostics also have limited power. A small subgroup may not reveal a real pattern, and a few unusual observations can dominate its mean. Conversely, many observations from a few individuals can make the plot appear dense without providing broad evidence across individuals. For this reason, report both the number of individuals and observations, show individual-level variation where feasible, and avoid treating residual observations as independent when they are clustered within individuals.
- Common mistake: “The pooled residual mean is near zero, so the covariate model fits every subgroup.” This is wrong because positive errors in one group can cancel negative errors in another, or early errors can cancel late errors. Inspect stratified plots and summaries.
- Common mistake: “A nonzero subgroup mean proves that the covariate effect is missing.” A nonzero mean can arise from chance, imbalance, data errors, or other model misspecification. Treat it as a diagnostic signal that requires investigation.
- Common mistake: “A good individual-prediction plot proves the population covariate model is adequate.” Individual random-effect estimates can absorb individual discrepancies. Check population predictions as well.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- If residuals are defined as observation minus prediction, what does a negative subgroup residual mean on average?
- Why can a pooled residual mean near zero conceal poor fit in a subgroup?
- A subgroup has four residuals of \(0.2,\ -0.1,\ -0.3,\ 0.0\). Calculate the mean and state what the result does and does not show.
- Why should population predictions be examined even when individual-prediction plots look satisfactory?
- Name two checks to make before interpreting a subgroup prediction difference as evidence of a model problem.
Solutions. 1. Negative residuals mean observations tend to be below predictions, so the model tends to overpredict in that subgroup. 2. Opposite-signed errors from different groups can cancel in the pooled average; stratification can expose them. 3. The sum is \(0.2-0.1-0.3+0.0=-0.2\), so the mean is \(-0.2/4=-0.050\). This small sample has a slightly negative mean, but it does not establish a systematic model defect. 4. Individual random-effect estimates can absorb discrepancies, whereas population predictions reveal whether the population model, including its covariates, fits subgroups appropriately. 5. Examples include checking subgroup counts and sampling times, verifying covariate coding and medication timing, checking dose histories and units, and examining whether one individual dominates the observations.