Tutorials › Nonlinear Mixed-Effects Models (NLME) › Outliers, Leverage, And Influential Subjects

Goodness-of-Fit Diagnostics and Their Pitfalls · Tutorial 552 of 797

Outliers, Leverage, And Influential Subjects

Learn how residual size, leverage, and influence describe different features of NLME diagnostics, and how to assess whether a subject materially changes population estimates.

Intermediate 13 min read

What You'll Learn

  • Distinguish an unusual observation from an unusual subject-level residual pattern.
  • Explain why high leverage and a large residual are different diagnostic properties.
  • Interpret local linearized leverage in the context of nonlinear mixed-effects models.
  • Calculate and interpret parameter changes from leave-one-subject-out refits.
  • Recognize limitations of deletion diagnostics and avoid treating flags as proof of bad data.

Why Residual Size Is Not the Whole Story

A subject can have a large residual without materially affecting the population estimates. Conversely, a subject can have fairly modest residuals yet strongly affect an estimated parameter because that subject contributes information in a part of the design that few other subjects cover. These are different diagnostic questions: does the subject fit poorly, and does the fitted model depend heavily on that subject?

In an NLME analysis, observations from one subject are a cluster, and that subject can affect both the population parameters and the estimated between-subject variability. Thus, a useful review combines residual and individual-fit displays with subject-level influence checks. The results are prompts for investigation, not automatic rules for deleting data.

Definition: An outlying observation is an observation with a residual that is unusual relative to the residual scale assumed or estimated by the model. An outlying subject has an unusual pattern across that subject’s observations or individual fit. Leverage describes how strongly a subject’s design and model sensitivity can affect fitted values or parameter estimates. A subject is influential when removing that subject materially changes one or more fitted quantities, such as population parameters or predictions.

These descriptions are not interchangeable. A large residual indicates discrepancy between an observation and a prediction; leverage concerns how much information or sensitivity the subject contributes; influence concerns the actual change in a fit when the subject is removed. A subject may have any combination of these properties.

Residual Flags and Subject-Level Displays

The earlier material on raw, weighted, and conditional residuals and on standardizing residuals establishes why residual size must be judged on an appropriate scale. In a residual display, a residual far from the main cloud is a reason to inspect the observation and its context. When examining subjects, however, do not reduce a whole profile to its largest residual without looking at time, predictions, sampling density, and the subject’s individual-fit display.

A practical screening convention is to investigate standardized residuals with absolute values around 2 or larger, and especially those around 3 or larger. These are heuristics, not universal cutoffs or formal outlier tests. The reference distribution may be approximate, residuals within one subject are dependent, and many residuals are examined at once. A single large value can occur by chance, particularly in a large data set.

Worked Example: A Large Residual Within an Otherwise Adequate Profile

Suppose two hypothetical subjects have concentrations measured at three times. The individual predictions are shown with the observations. For this illustration, assume an additive residual standard deviation of 0.50 concentration units at every time, so the standardized residual is the raw residual divided by 0.50.

SubjectTimeObservationIndividual predictionRaw residualStandardized residual
A14.204.000.200.40
A22.903.00-0.10-0.20
A33.352.001.352.70
B13.804.00-0.20-0.40
B23.103.000.100.20
B32.152.000.150.30

For subject A at time 3, the residual is \(3.35-2.00=1.35\) concentration units, and the standardized residual is \(1.35/0.50=2.70\). This is a point worth checking. Subject B has no comparably large residual in these three observations. But the table alone does not establish that subject A is an influential subject: it says nothing about how the population fit changes if A is omitted. Nor does the large residual establish an error; the observation, timing, assay record, and model adequacy all need review.

Leverage in a Local Approximation

In a nonlinear model, fitted values depend nonlinearly on parameters. A common way to understand leverage is to approximate the model locally by a linear model around the fitted parameter vector. Let \(\boldsymbol{\theta}\) denote the population parameters and let \(\boldsymbol{\mu}(\boldsymbol{\theta})\) be the vector of model predictions. Near the fitted estimate \(\hat{\boldsymbol{\theta}}\), a first-order Taylor expansion gives

$$ \boldsymbol{\mu}(\boldsymbol{\theta}) \approx \boldsymbol{\mu}(\hat{\boldsymbol{\theta}}) + J(\boldsymbol{\theta}-\hat{\boldsymbol{\theta}}), \qquad J = \left.\frac{\partial \boldsymbol{\mu}}{\partial \boldsymbol{\theta}^\mathsf{T}}\right|_{\hat{\boldsymbol{\theta}}}. $$

Here \(J\) is the sensitivity matrix: its entries describe how predictions change locally as parameters change. If \(W\) is the working weight matrix (the inverse of the working residual covariance in a weighted least-squares approximation), the local projection matrix for the whitened predictions is

$$ H = W^{1/2}J(J^\mathsf{T}WJ)^{-1}J^\mathsf{T}W^{1/2}. $$

This expression assumes the local information matrix \(J^\mathsf{T}WJ\) is invertible. It is the weighted analogue of the familiar linear-regression projection matrix. Its diagonal elements in a single-observation setting describe how much each observation’s fitted value is locally tied to that observation. For a subject with several observations, the corresponding block \(H_{ii}\) can be summarized in various ways, such as by its trace. That is a local, model-dependent leverage measure, not a universal NLME subject-leverage statistic.

Important distinction: A large leverage value does not mean a large residual. Leverage is primarily about design and sensitivity; a residual describes the discrepancy that remains after fitting. The combination of leverage and residual can help explain potential influence, but a refit after subject deletion directly assesses the effect on the fitted model.

Subject Deletion and Influence

The most direct diagnostic is a leave-one-subject-out comparison. Fit the same model to all subjects, then refit it after removing subject \(i\), keeping the model specification, data handling, and estimation procedure otherwise consistent. Denote the full-data estimate by \(\hat{\boldsymbol{\theta}}\) and the estimate without subject \(i\) by \(\hat{\boldsymbol{\theta}}_{(-i)}\). The parameter change is

$$ \Delta_i = \hat{\boldsymbol{\theta}}-\hat{\boldsymbol{\theta}}_{(-i)}. $$

For parameters with different units, compare changes relative to their uncertainty or to a meaningful scale, rather than comparing raw differences. One possible scaled summary for \(q\) parameters with estimated covariance matrix \(\widehat{\mathrm{Cov}}(\hat{\boldsymbol{\theta}})\) is

$$ D_i = \frac{1}{q}\Delta_i^\mathsf{T} \widehat{\mathrm{Cov}}(\hat{\boldsymbol{\theta}})^{-1}\Delta_i. $$

This gives a dimensionless measure of the deletion change relative to parameter uncertainty. It is a diagnostic summary, not a test with a universal cutoff. In NLME models, deletion can affect fixed effects, variance components, and predictions differently; variance estimates near a boundary and convergence problems can make such summaries especially difficult to interpret.

Worked Example: Leverage and Influence in a Linearized Illustration

Consider three hypothetical subject-level summaries \(y\) related to a covariate \(x\) by a local straight-line approximation with equal weights: \((x,y)=(0,2),(1,3),(2,5)\). This small example illustrates the distinction between residual and leverage. It is not a substitute for fitting and checking a nonlinear mixed-effects model.

The least-squares slope is \( \hat{\beta}_1=\sum (x_i-\bar{x})(y_i-\bar{y})/\sum (x_i-\bar{x})^2 \). Here \(\bar{x}=1\), \(\bar{y}=10/3\), the numerator is \((-1)(2)+(0)(3)+(1)(5)=3\), and the denominator is \((-1)^2+0^2+1^2=2\). Therefore \(\hat{\beta}_1=3/2=1.5\), and \(\hat{\beta}_0=\bar{y}-\hat{\beta}_1\bar{x}=10/3-1.5=11/6\), or approximately 1.833.

The fitted values at \(x=0,1,2\) are \(11/6,10/3,29/6\), approximately 1.833, 3.333, and 4.833. The residuals are approximately 0.167, -0.333, and 0.167. Thus, neither endpoint has a large residual in this small example.

For a line with an intercept, leverage is \(h_i=1/n+(x_i-\bar{x})^2/\sum (x_j-\bar{x})^2\). With \(n=3\), the endpoint leverages are \(1/3+1/2=5/6\) each, while the middle leverage is \(1/3\). The endpoints have higher leverage because their covariate values are farther from the design center.

Deleting the subject at \(x=2\) leaves \((0,2)\) and \((1,3)\), giving slope \(1\) and intercept \(2\). The slope changes from \(1.5\) to \(1\), a change of \(-0.5\). Deleting the subject at \(x=0\) leaves \((1,3)\) and \((2,5)\), giving slope \(2\) and intercept \(1\), a slope change of \(+0.5\). This illustrates why high leverage can matter even when the residual is small. The tiny sample makes these changes unstable; it is the distinction, not a numerical cutoff, that carries over to NLME diagnostics.

Worked Example: Interpreting a Leave-One-Subject-Out NLME Refit

Suppose a hypothetical NLME model estimates typical clearance as \(5.20\) L/h with a standard error of \(0.20\) L/h using all subjects. After omitting one subject and refitting the same model, typical clearance is \(4.78\) L/h. The full-data fit estimates the between-subject standard deviation on the log-clearance scale as \(0.30\), with standard error \(0.05\); the deletion fit gives \(0.24\).

For typical clearance, the deletion change is \(5.20-4.78=0.42\) L/h. Relative to the full-data standard error, this is \(0.42/0.20=2.10\). The relative change from the full-data estimate is \(0.42/5.20=0.0808\), or about 8.08%. For the log-clearance standard deviation, the change is \(0.30-0.24=0.06\), which is \(0.06/0.05=1.20\) full-data standard errors.

These hypothetical results suggest that the subject materially affects the typical clearance estimate and also affects the estimated variability. They do not show that the subject is erroneous or should be excluded. The next steps are to examine that subject’s observations and individual predictions, verify records and model implementation, and check that both fits converged to comparable solutions. If the deletion fit did not converge reliably, the apparent parameter change could reflect estimation failure rather than subject influence.

Practical Review and Common Pitfalls

A disciplined review separates flagging from explanation. First locate the unusual observation or subject in residual and individual-fit displays. Then check whether the pattern is supported by the data record and whether it persists across appropriate displays. Finally, if the question concerns impact on population estimates, use a subject-deletion refit rather than inferring influence from residual size alone.

1
Locate the signal.
Identify unusual standardized residuals or an individual profile that departs from its predictions. Record which observations and times are involved.
2
Check context and fit.
Review the data record, sampling pattern, and individual-fit display. Consider whether the model is systematically inadequate, rather than assuming the subject is at fault.
3
Assess influence directly.
Refit without the subject when feasible, compare parameters and predictions on meaningful scales, and verify convergence and estimation quality.
4
Report transparently.
Describe the diagnostic and the deletion effect. Do not remove a subject solely because a residual or influence measure crosses a heuristic threshold.

A common mistake is to call the subject with the largest residual “the most influential.” That reasoning confuses discrepancy with impact. A correction is to inspect residuals for unusual fit, examine design and sensitivity for potential leverage, and compare full-data and deletion fits for actual influence. A second mistake is to interpret a large deletion change as proof of a data error. The change may be scientifically meaningful, reflect a sparse or unusual design region, reveal model sensitivity, or result from unstable estimation.

The main alternatives answer different questions. Residual displays are efficient for locating lack of fit but do not measure parameter impact. Local leverage summaries can identify subjects with unusual design or sensitivity, but rely on a local approximation and depend on how the NLME model and covariance are represented. Leave-one-subject-out refitting is more direct about impact, but can be computationally demanding and may become unstable when few subjects remain or parameters are weakly identified. No single diagnostic replaces the others, and deletion findings should be interpreted alongside the scientific model and data quality.

Key takeaway: A large residual indicates an unusual discrepancy; leverage indicates potential sensitivity to a subject’s information; influence is assessed by how the fit changes when that subject is omitted. Treat each as a diagnostic clue, not as an automatic exclusion rule.

Check Your Understanding

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

  1. A subject has one standardized residual of 3.1, but omitting the subject barely changes the population estimates. Which diagnostic property is clear, and which is not?
  2. Why can a subject with small residuals still have high leverage?
  3. A full-data clearance estimate is 6.0 L/h and the estimate after omitting one subject is 5.7 L/h. Calculate the deletion change and its percentage relative to the full-data estimate.
  4. Why should a leave-one-subject-out fit that failed to converge not be interpreted as evidence of strong influence?

Solutions. (1) The large residual flags an unusual observation; the small parameter change indicates little measured influence on those estimates. (2) Leverage reflects design location and model sensitivity, not residual size; a subject in a sparsely represented region can have high leverage while fitting closely. (3) The change is \(6.0-5.7=0.3\) L/h, or \(0.3/6.0=0.05=5\%\) of the full-data estimate. (4) A failed fit does not provide a reliable estimate to compare: the difference may arise from estimation failure rather than a genuine effect of removing the subject.