Introduction
Clinical datasets frequently contain observations that look unusual. A laboratory measurement may be substantially higher than the rest of the sample, a body weight may be unexpectedly low, a biomarker concentration may be several orders of magnitude larger than most observations, or a patient may have a combination of measurements that is unusual even though none of the individual measurements is extreme.
These observations are commonly called outliers.
Outlier detection is an important part of exploratory data analysis and clinical data review. It can identify transcription errors, unit-conversion problems, data-processing defects, unusual patient characteristics, genuine treatment effects, or rare biological responses.
However, one of the most important principles in clinical statistics is: an outlier is not automatically an error.
What Is an Outlier?
An outlier is an observation that is unusually distant from the main pattern of the data.
For a single continuous variable, an observation may be considered unusual because it is far from the center of the distribution.
For example, suppose systolic blood pressure is:
| Patient | Systolic BP |
|---|---|
| 001 | 118 |
| 002 | 121 |
| 003 | 125 |
| 004 | 119 |
| 005 | 123 |
| 006 | 127 |
| 007 | 121 |
| 008 | 124 |
| 009 | 122 |
| 010 | 198 |
The value of 198 mmHg is obviously unusual relative to the other observations.
But there are several possible explanations:
- The patient genuinely had severe hypertension.
- The measurement was taken during an acute clinical event.
- The value was transcribed incorrectly.
- The value was entered in the wrong unit or field.
- The observation may correspond to a different visit.
- A data-processing transformation may have been applied incorrectly.
The statistical method identifies the observation as unusual. Clinical and data review determines what the observation actually means.
Outliers Are Context-Dependent
There is no universal numerical definition of an outlier.
An observation can be unusual in one context but completely appropriate in another.
For example, a creatinine value that is extreme relative to a healthy volunteer population may be entirely plausible in a population with advanced renal disease.
Likewise, a tumor measurement that is extreme at baseline may reflect genuine disease burden rather than an error.
Types of Outliers in Clinical Data
Outliers can arise in several different ways.
| Type | Description | Example |
|---|---|---|
| Univariate outlier | Extreme value for one variable | Very high ALT |
| Multivariate outlier | Unusual combination of otherwise plausible measurements | Unusual combination of age, weight, and creatinine |
| Regression outlier | Observation poorly predicted by a fitted model | Unexpected treatment response |
| High-leverage observation | Unusual predictor values | Extremely high baseline biomarker |
| Influential observation | Observation that materially changes model estimates | One patient substantially changing a treatment effect estimate |
| Data-quality outlier | Unusual value caused by a data problem | Height entered as 1800 cm |
Outlier Detection Is Not the Same as Data Cleaning
These concepts are related but different.
Outlier detection asks:
Which observations appear unusual?
Data cleaning asks:
Is the unusual observation incorrect, and if so, what should be done?
A statistical outlier can be:
- Correct and clinically meaningful.
- Correct but rare.
- Incorrect because of a data-entry error.
- Incorrect because of a unit error.
- Incorrect because of a programming or derivation error.
- Uncertain and requiring clarification.
The First Step: Visual Inspection
Before applying a formal statistical rule, inspect the data graphically.
Useful plots include:
- Histograms
- Boxplots
- Dot plots
- Scatterplots
- Time-series plots
- Spaghetti plots for repeated measurements
- Subject-level profile plots
Graphical inspection is especially valuable because an algorithm can identify an extreme observation without showing why the observation is unusual.
Boxplots and the IQR Rule
The interquartile range, or IQR, is one of the most widely used approaches for identifying potential univariate outliers.
Define:
where \(Q_1\) is the first quartile and \(Q_3\) is the third quartile.
The conventional Tukey fences are:
Observations below \(L\) or above \(U\) are commonly flagged as potential outliers.
Worked IQR Example
Suppose a clinical chemistry variable has:
Then:
The lower fence is:
and the upper fence is:
Therefore, observations above 32 or below 0 would be flagged by the conventional 1.5-IQR rule.
Why the IQR Method Is Useful
The IQR method has an important advantage: it is relatively robust to extreme observations.
The quartiles are much less affected by a few extreme values than the mean and standard deviation.
This makes the IQR rule particularly useful when clinical variables are skewed or contain a small number of very large observations.
Modified IQR Rules
Some analyses use more conservative or more liberal multipliers.
For example, the 3-IQR outer fence is:
and similarly:
The 1.5-IQR rule is generally useful for identifying potential outliers, while 3-IQR fences are sometimes used to identify more extreme observations.
Z-Scores
A z-score measures how far an observation is from the sample mean in standard deviation units.
where:
- \(x_i\) is the observation.
- \(\bar{x}\) is the sample mean.
- \(s\) is the sample standard deviation.
A commonly used screening threshold is:
although the appropriate threshold depends on the purpose and distribution.
Worked Z-Score Example
Suppose a biomarker has:
A patient has a value of 151.
The z-score is:
The observation is therefore more than three standard deviations above the sample mean.
It would commonly be flagged for investigation.
A Major Problem with Ordinary Z-Scores
The mean and standard deviation themselves can be strongly affected by outliers.
Consider a dataset in which nearly all observations are around 100 but one observation is 1,000.
The extreme observation increases the standard deviation, which can make the z-score appear less extreme than it would have been without the observation.
This is one reason robust alternatives can be useful.
Modified Z-Scores
A modified z-score replaces the mean and standard deviation with robust quantities based on the median and median absolute deviation.
The median absolute deviation, or MAD, is:
A commonly used modified z-score is:
A common screening criterion is:
The modified z-score is particularly useful when the dataset is contaminated by extreme observations.
IQR vs. Z-Score vs. Modified Z-Score
| Method | Center | Scale | Robust to Outliers? |
|---|---|---|---|
| IQR | Quartiles | IQR | Yes |
| Z-score | Mean | SD | No |
| Modified z-score | Median | MAD | Yes |
Clinical Reference Ranges
Statistical outlier rules should not replace clinical knowledge.
For laboratory measurements, reference ranges can provide an important independent source of information.
For example, suppose a laboratory test has an upper reference limit of 40 U/L. A value of 500 U/L is clinically notable regardless of whether it is flagged by a particular statistical rule.
However, reference ranges and statistical outlier thresholds answer different questions.
| Question | Method |
|---|---|
| Is the value unusual relative to this study population? | Statistical outlier method |
| Is the value outside a laboratory reference interval? | Clinical reference range |
| Is the value clinically dangerous? | Clinical interpretation |
| Is the value a data error? | Source-data / data-quality investigation |
Outliers in Skewed Clinical Variables
Many clinical variables are not normally distributed.
Examples include:
- Biomarker concentrations
- Pharmacokinetic exposure measures
- Hospital length of stay
- Healthcare costs
- Time-to-event variables
- Some laboratory measurements
A right-skewed variable can naturally contain large observations.
For example, consider:
The value 45 is much larger than the other observations, but it may be a legitimate feature of the distribution rather than a data error.
Log Transformation Can Help Reveal Structure
For strongly right-skewed positive variables, a logarithmic transformation may make the distribution easier to inspect.
For a positive measurement \(x\), define:
An observation that looks extreme on the original scale may be much less unusual on the log scale.
This is especially relevant for pharmacokinetic variables and biomarkers that approximately follow log-normal distributions.
Do Not Delete Outliers Just to Improve Normality
A common statistical mistake is:
- Plot the data.
- Find a few extreme observations.
- Delete them.
- Observe that the distribution now looks more normal.
This approach can produce biased estimates and invalid inference.
The correct question is not: "Does removing the outlier make the distribution look better?"
The correct question is: "Is there a defensible scientific or data-quality reason for excluding this observation from this analysis?"
Outliers and Missing Data Are Different
An outlier is an observed value.
A missing value is an absence of an observed value.
These require different handling strategies.
| Situation | Example | Primary Issue |
|---|---|---|
| Valid extreme value | Very high biomarker | Influence / distribution |
| Missing value | No laboratory measurement | Missing-data mechanism |
| Invalid value | Impossible height | Data quality |
| Below quantification limit | BLQ concentration | Censoring / measurement process |
Outlier Detection by Treatment Group
In randomized clinical trials, distributions should often be inspected by treatment group.
A value that appears unusual in the overall population may be common within one treatment group.
Conversely, a treatment-specific cluster of unusual observations may indicate a real treatment effect or a treatment-related data issue.
Useful displays include:
- Side-by-side boxplots
- Group-specific histograms
- Strip plots
- Baseline-versus-postbaseline scatterplots
- Individual patient profiles
Baseline and Postbaseline Values
For longitudinal clinical data, an observation should not always be evaluated without considering baseline.
Suppose a patient has:
| Visit | Biomarker |
|---|---|
| Baseline | 5 |
| Week 2 | 6 |
| Week 4 | 7 |
| Week 8 | 42 |
The Week 8 value may be an outlier relative to the patient's earlier measurements.
But it may be much more clinically informative to examine the change from baseline than to classify the raw value as an outlier.
Outliers in Change-from-Baseline Analyses
Let:
A patient may not have an unusual baseline measurement but may have an extreme change from baseline.
For example:
gives:
Whether that is an outlier depends on the clinical context and the distribution of changes among the other patients.
Multivariate Outliers
Univariate methods examine one variable at a time.
But clinical observations are often multivariate.
A patient may have:
- Age within the usual range
- Weight within the usual range
- Creatinine within the usual range
- Blood pressure within the usual range
yet the combination of those variables may be unusual.
This is a multivariate outlier.
Mahalanobis Distance
Mahalanobis distance accounts for the covariance among variables.
For observation vector \(x\), mean vector \(\mu\), and covariance matrix \(\Sigma\), the squared Mahalanobis distance is:
Unlike ordinary Euclidean distance, Mahalanobis distance recognizes that variables can be correlated.
For example, weight and body-surface area are related. A patient who is large on both measures may not be unusual even though both individual measurements are relatively high.
Interpreting Mahalanobis Distance
Under multivariate normal assumptions, squared Mahalanobis distance can be compared approximately with a chi-square distribution with \(p\) degrees of freedom:
where \(p\) is the number of variables.
For example, with four variables, a high \(D^2\) relative to a \(\chi^2_4\) reference distribution may identify a potentially unusual multivariate observation.
Regression-Based Outlier Detection
Outlier detection becomes more sophisticated when the data are analyzed using a statistical model.
In linear regression:
an observation can be unusual because its outcome is far from the fitted regression line.
Such an observation has a large residual.
Residuals
The ordinary residual is:
A large absolute residual indicates that the model predicts the observation poorly.
However, a large residual alone does not establish that the observation is incorrect.
The observation may represent a genuine biological response that the model does not adequately describe.
Studentized Residuals
Studentized residuals scale residuals by an estimate of their appropriate standard deviation.
A commonly used diagnostic is the externally studentized residual:
where \(h_{ii}\) is the leverage of observation \(i\) and \(s_{(i)}\) is a residual scale estimate calculated with the observation removed.
Large absolute studentized residuals can identify observations deserving further investigation.
Leverage
An observation can be unusual because its predictor values are far from those of the other observations.
This is called high leverage.
Leverage is represented by the diagonal elements of the hat matrix:
The diagonal element \(h_{ii}\) describes how unusual observation \(i\)'s predictor pattern is relative to the rest of the dataset.
High leverage does not necessarily mean that the observation is influential.
Influence
An observation is influential if removing it substantially changes the fitted model.
One common diagnostic is Cook's distance:
where \(\hat{y}_{j(i)}\) represents the fitted value when observation \(i\) is omitted.
Large Cook's distance indicates that the observation deserves investigation.
Outliers in Logistic Regression
Binary clinical endpoints require different diagnostics.
For logistic regression:
Potentially unusual observations can be identified using:
- Pearson residuals
- Deviance residuals
- Leverage
- Cook's distance
- DFBETAs
Again, the purpose is to identify observations that warrant investigation, not to automatically remove them.
Outliers in Survival Analysis
Time-to-event data have their own complications.
An unusually long or short observed survival time is not automatically an outlier because censoring is part of the data-generating process.
For example, a patient who remains event-free throughout follow-up may have a long censored observation.
That observation should not simply be deleted because its time exceeds a statistical threshold.
Outliers in Pharmacokinetic Data
Pharmacokinetic datasets frequently contain highly variable concentration measurements.
Potentially unusual observations can arise from:
- True biological variability
- Sampling-time deviations
- Incorrect sample collection time
- Assay problems
- Concentration transcription errors
- Below-quantification-limit handling
- Incorrect dose information
- Incorrect units
A concentration that is unusually high should therefore be investigated using both statistical and pharmacokinetic information.
For example, compare the concentration with:
- Dose
- Sampling time
- Previous concentrations
- Subject-level PK profile
- Other subjects at comparable sampling times
Clinical Plausibility Checks
Some of the most effective outlier detection methods are simple validation rules based on clinical knowledge.
| Variable | Potential Validation Check |
|---|---|
| Age | Check plausible study-population range |
| Height | Check physiologically plausible values and units |
| Weight | Check implausible extremes and unit conversions |
| Heart rate | Check physiological plausibility |
| Laboratory values | Compare with assay/reference limits |
| Visit dates | Check chronological consistency |
| Dose | Check against protocol-defined dose levels |
Outlier Detection Should Combine Multiple Signals
A strong clinical data-review process rarely relies on one statistical rule.
Instead, consider multiple sources of evidence:
A Worked Clinical Example
Suppose 20 patients have a baseline laboratory measurement:
The final observation, 185, is visually suspicious.
The first question is not whether to delete it.
The first question is: Why is it 185?
Step 1: Apply the IQR Rule
Suppose the quartiles calculated from the data are approximately:
Then:
The upper Tukey fence is:
The value 185 is therefore clearly flagged.
Step 2: Calculate a Z-Score
Suppose the sample mean and standard deviation are:
Then:
The observation is also extreme according to a conventional \(|z|>3\) screening threshold.
Step 3: Investigate the Patient
Now suppose the clinical data review shows that the patient's actual result was 105, but 185 was entered during transcription.
This is not a biological outlier.
It is a data error.
The appropriate action is therefore to correct the data according to the study's predefined data-management procedures.
A Different Outcome
Suppose instead that source documentation confirms that the patient's actual measurement was 185.
The observation is still an outlier statistically, but it may be completely valid.
In that case, the appropriate approach may be to retain it and evaluate its effect on the planned analysis.
Should an Outlier Be Removed?
There are several legitimate reasons an observation may be excluded from a specific analysis.
Examples include:
- The value is demonstrably erroneous.
- The value violates a prespecified data-quality rule.
- The measurement was obtained outside the protocol-defined assessment window when the analysis requires a valid window.
- The observation is invalid according to a predefined endpoint algorithm.
However, the following is generally not sufficient:
"The value makes the treatment effect statistically significant when it is included."
or:
"The value makes the distribution non-normal."
Sensitivity Analysis for Potential Outliers
When a valid observation has unusually large influence, a sensitivity analysis can be informative.
For example, an analysis might compare:
- The prespecified primary analysis including all valid observations.
- A sensitivity analysis excluding a particular observation under a clearly defined diagnostic criterion.
- A robust analysis less sensitive to extreme observations.
The primary analysis should remain tied to the prespecified estimand and analysis population.
Robust Statistical Methods
Sometimes the correct response to extreme observations is not removal but the use of a method that is less sensitive to them.
Examples include:
- Median instead of mean
- IQR instead of standard deviation
- Median regression
- Robust regression
- Trimmed means in appropriate settings
- Transformation of highly skewed variables
- Robust covariance estimation
The appropriate method depends on the scientific question and estimand.
Mean vs. Median in the Presence of an Outlier
Consider:
The median is 13.
The mean is:
The extreme observation pulls the mean from the center of the majority of the data.
This illustrates why robust summaries can be useful during exploratory analysis.
Winsorization and Trimming
Winsorization replaces extreme values with less extreme values according to prespecified quantiles.
Trimming removes observations from the tails before calculating a summary.
These approaches can be useful in some statistical applications, but they should not be introduced simply because a clinical dataset contains inconvenient observations.
Outlier Detection in Repeated-Measures Data
Repeated observations from the same patient create an additional challenge.
Suppose one patient's measurements are:
The final value is unusual both relative to the patient and relative to the population.
But suppose another patient's values are:
The final value is high but is consistent with that patient's trajectory.
This is why subject-level plots are extremely valuable for longitudinal clinical datasets.
Outliers and Mixed Models
In longitudinal analyses using mixed-effects models, unusual observations can affect estimated fixed effects, variance components, and subject-specific random effects.
For example:
where \(b_i\) is a patient-specific random effect.
A potentially unusual observation should therefore be evaluated in the context of:
- The patient's overall trajectory
- Within-patient residuals
- Between-patient variation
- Influence on fixed effects
- Influence on variance components
R: Basic IQR Outlier Detection
The following R code identifies observations beyond the conventional 1.5-IQR fences.
x <- c( 98, 101, 103, 99, 105, 102, 100, 104, 97, 106, 101, 103, 99, 102, 104, 100, 98, 107, 101, 185 ) q1 <- quantile(x, 0.25) q3 <- quantile(x, 0.75) iqr_value <- IQR(x) lower_fence <- q1 - 1.5 * iqr_value upper_fence <- q3 + 1.5 * iqr_value outliers <- x[ x < lower_fence | x > upper_fence ] outliers
The resulting vector contains observations identified by the IQR screening rule.
R: Creating an Outlier Flag
outlier_flag <- x < lower_fence |
x > upper_fence
data.frame(
value = x,
outlier = outlier_flag
)
This is often preferable to immediately removing observations because it preserves the original dataset while creating an explicit diagnostic variable.
R: Z-Scores
z_score <- as.numeric( scale(x) ) z_flag <- abs(z_score) > 3 data.frame( value = x, z_score = z_score, outlier = z_flag )
The threshold of 3 is a common screening convention, not a universal rule.
R: Modified Z-Scores
med_x <- median(x) mad_x <- mad( x, constant = 1 ) modified_z <- 0.6745 * (x - med_x) / mad_x modified_flag <- abs(modified_z) > 3.5 data.frame( value = x, modified_z = modified_z, outlier = modified_flag )
The modified z-score is more resistant to the influence of extreme observations than the ordinary z-score.
R: Boxplot Detection
boxplot(x) boxplot.stats(x)$out
The second expression returns observations classified as outliers according to the boxplot rule used by R.
R: Detecting Outliers Within Treatment Groups
Suppose the dataset contains:
df <- data.frame(
USUBJID = c("01","02","03","04","05","06"),
TRT = c("Drug A","Drug A","Drug A",
"Placebo","Placebo","Placebo"),
VALUE = c(101, 103, 150, 99, 102, 104)
)
An important question is whether the value of 150 is unusual relative to the entire study population or specifically within the Drug A group.
by(
df$VALUE,
df$TRT,
function(z) {
q1 <- quantile(z, 0.25)
q3 <- quantile(z, 0.75)
iqr_value <- IQR(z)
c(
lower = q1 - 1.5 * iqr_value,
upper = q3 + 1.5 * iqr_value
)
}
)
For small clinical trial groups, however, automated group-specific outlier rules can be unstable.
R: Regression Diagnostics
Suppose we fit a simple linear model:
fit <- lm( outcome ~ baseline + treatment, data = df ) summary(fit)
Basic diagnostic plots can be obtained with:
par(mfrow = c(2, 2)) plot(fit)
These plots can reveal:
- Large residuals
- Nonconstant variance
- Potential leverage points
- Potentially influential observations
R: Cook's Distance
cook_d <- cooks.distance(fit) plot( cook_d, type = "h", ylab = "Cook's distance", xlab = "Observation" ) abline( h = 4 / nrow(model.frame(fit)), lty = 2 )
The commonly used \(4/n\) reference is a heuristic rather than a universal cutoff.
R: Leverage
hat_values <- hatvalues(fit) plot( hat_values, type = "h", ylab = "Leverage", xlab = "Observation" )
High leverage observations should be investigated alongside their residuals and influence diagnostics.
R: Studentized Residuals
student_resid <- rstudent(fit) plot( student_resid, type = "h", ylab = "Studentized residual", xlab = "Observation" ) abline(h = c(-3, 3), lty = 2)
Large absolute studentized residuals can identify observations that are poorly described by the fitted model.
R: Mahalanobis Distance
Suppose three baseline variables are being examined jointly.
X <- df[, c( "age", "weight", "creatinine" )] center <- colMeans( X, na.rm = TRUE ) cov_matrix <- cov( X, use = "complete.obs" ) mahalanobis_distance <- mahalanobis( X, center = center, cov = cov_matrix ) df$mahalanobis_d2 <- mahalanobis_distance
Under multivariate normal assumptions, the squared distances can be compared with a chi-square reference distribution.
cutoff <- qchisq( 0.975, df = ncol(X) ) df$multivariate_outlier <- df$mahalanobis_d2 > cutoff
For small datasets or datasets already suspected of containing outliers, robust covariance estimation should be considered rather than relying blindly on classical Mahalanobis distance.
Robust Outlier Detection
Robust methods attempt to reduce the effect of extreme observations on the location and scale estimates used to identify other unusual observations.
Examples include:
- Median and MAD
- Robust regression
- Robust covariance matrices
- Minimum covariance determinant approaches
- Other high-breakdown estimators
These methods can be particularly useful when the assumption that most of the data come from a clean approximately normal distribution is questionable.
Multiple Testing and Outlier Detection
Clinical datasets can contain hundreds or thousands of variables.
If an automated outlier rule is applied to every variable, some observations will be flagged simply by chance.
For example, if many independent variables are examined using a criterion that flags approximately 1% of observations under the null, numerous flags may occur even when the dataset contains no systematic errors.
Outlier Detection in Large Clinical Databases
Large clinical datasets require additional considerations.
An automated pipeline may need to process:
- Hundreds of laboratory variables
- Thousands of subjects
- Multiple visits
- Multiple treatment groups
- Multiple analysis populations
In such settings, outlier detection is best implemented as a reproducible quality-control process rather than an ad hoc manual review.
A Reproducible Outlier Flagging Framework
What an Outlier Review Dataset Should Contain
For clinical programming, an outlier review dataset can be structured to contain both the original value and diagnostic information.
| Variable | Purpose |
|---|---|
| USUBJID | Patient identifier |
| VISIT | Assessment visit |
| PARAMCD | Parameter identifier |
| AVAL | Original analysis value |
| FLAG_IQR | IQR screening flag |
| FLAG_Z | Z-score screening flag |
| FLAG_MODZ | Modified z-score flag |
| CLINICAL_FLAG | Clinical plausibility flag |
| REVIEW_STATUS | Outcome of investigation |
| REVIEW_REASON | Documented reason for decision |
Potential Review Statuses
A standardized classification system can make the review process reproducible.
| Status | Meaning |
|---|---|
| Valid extreme | Unusual but confirmed to be correct |
| Data error | Incorrect source or entered value |
| Unit error | Incorrect unit or conversion |
| Derivation error | Incorrect calculated value |
| Protocol deviation | Value affected by a relevant protocol issue |
| Pending review | Investigation incomplete |
Outlier Detection vs. Data Validation
These processes should work together.
Data validation rules can identify observations that violate known constraints.
Statistical outlier detection can identify observations that are unusual even when they do not violate any explicit constraint.
For example, a height of 1800 cm is easily identified through a validation rule.
A height of 205 cm may be statistically unusual but clinically plausible.
The first is likely a data-quality issue. The second may simply represent a tall patient.
Clinical Outliers vs. Statistical Outliers
| Observation | Statistical Status | Clinical Status |
|---|---|---|
| Very high but plausible lab value | Outlier | Potentially valid |
| Impossible measurement | Outlier | Invalid |
| Common value in disease population | Not necessarily an outlier | Clinically important |
| Rare but documented adverse event | Potential outlier | Potentially meaningful |
Outliers and the Analysis Population
Outlier status can depend on the analysis population.
For example, a value may appear unusual among all randomized patients but not within the treated population.
Likewise, an observation may be extreme at one visit but ordinary at another.
Therefore, the population and grouping used for outlier detection should be defined carefully.
Should Outliers Be Removed Before Summary Statistics?
Generally, not automatically.
If an observation is valid, descriptive statistics should generally reflect the observed data unless the analysis specification defines a different estimand or summary.
For skewed data, it may be appropriate to report both mean and median, or additional robust summaries such as quartiles.
| Summary | Useful Information |
|---|---|
| Mean | Arithmetic average; sensitive to extremes |
| Median | Central location; robust to extremes |
| SD | Overall dispersion; sensitive to extremes |
| IQR | Middle 50% spread; robust |
| Minimum / maximum | Shows observed range |
Outliers in Clinical Trial Tables
Outliers can affect common clinical-trial outputs such as:
- Baseline descriptive statistics
- Change-from-baseline summaries
- Laboratory shift tables
- Boxplots
- Scatterplots
- Regression analyses
- Pharmacokinetic summaries
- Exposure-response analyses
A value should not be silently removed from one table while remaining in another unless the difference is explicitly defined by the analysis.
Traceability Is Essential
When an outlier is corrected or excluded, the change should be traceable.
A reproducible workflow should make it possible to answer:
- What was the original value?
- Why was it flagged?
- Who reviewed it?
- What evidence supported the decision?
- What value was ultimately used?
- Which analyses were affected?
Common Mistakes
- Deleting every observation beyond 1.5 IQR. The IQR rule identifies potential outliers; it does not establish that they are errors.
- Using z-scores blindly for skewed variables. Mean and SD can be distorted by extreme observations and may be inappropriate for heavily skewed data.
- Ignoring clinical context. A statistically unusual laboratory result may be biologically plausible.
- Checking only the overall dataset. Treatment group, visit, disease severity, and patient trajectory can materially change interpretation.
- Ignoring multivariate relationships. An observation can be unusual because of a combination of variables even when each individual measurement looks normal.
- Confusing leverage with an outlier. A high-leverage observation is unusual in predictor space; it is not necessarily a response outlier.
- Using Cook's distance as an automatic deletion rule. Influence diagnostics identify observations that affect the model; they do not determine whether those observations are invalid.
- Removing observations after looking at the treatment effect. This can introduce serious bias.
- Failing to document decisions. Outlier handling should be reproducible and traceable.
- Using an arbitrary threshold without justification. Thresholds such as 3 SD or 1.5 IQR are conventions, not universal laws.
A Practical Outlier Detection Strategy
Choosing the Right Method
| Situation | Useful Approach |
|---|---|
| Simple continuous variable | Boxplot / IQR |
| Approximately symmetric variable | Z-scores |
| Skewed variable | IQR or modified z-score |
| Strongly skewed positive variable | Log-scale inspection + robust methods |
| Several correlated variables | Mahalanobis / robust multivariate methods |
| Linear regression | Residuals, leverage, Cook's distance, DFBETAs |
| Logistic regression | Residuals, leverage, influence diagnostics |
| Longitudinal data | Subject-level trajectories + model diagnostics |
| Time-to-event data | Survival-specific diagnostics |
| Laboratory data | Statistical + clinical reference ranges |
A Layered Approach Works Best
The strongest clinical data-review strategy is usually layered.
Instead of asking which single outlier method is best, ask which combination of methods provides the most useful evidence.
What Should Be Reported?
If outlier detection materially affects a clinical analysis, the statistical documentation should describe:
- Which variables were screened
- Which analysis population was used
- Whether screening was performed overall or by treatment and visit
- The statistical criteria used
- How clinically important observations were investigated
- How confirmed data errors were corrected
- How valid extreme observations were handled
- Any sensitivity analyses performed
- The impact of influential observations on key conclusions
Example Statistical Analysis Plan Language
A practical analysis-plan description might state that continuous variables will be reviewed using graphical and descriptive methods, with potentially unusual observations identified using prespecified diagnostic criteria where appropriate.
Potential outliers will be investigated for data quality and clinical plausibility. Valid observations will not be excluded solely because they are statistically extreme. Any exclusions from the primary analysis will follow the prespecified analysis population and endpoint definitions.
Where an observation has substantial influence on a model-based analysis, appropriate sensitivity analyses may be performed to evaluate robustness of the conclusions.
Outliers and Regulatory Review
In a regulated clinical-trial environment, unexplained changes to patient data can create traceability and data-integrity concerns.
Therefore, the safest general principle is: investigate first, document second, and modify or exclude only under a defensible predefined process.
The statistical programming dataset should preserve traceability to the underlying source and derivation process.
Outlier Detection Checklist
| Question | Check |
|---|---|
| Is the value statistically unusual? | IQR, robust z-score, or appropriate diagnostic |
| Is the value clinically plausible? | Clinical review / reference range |
| Is the unit correct? | Unit validation |
| Is the visit correct? | Visit and date review |
| Is the subject trajectory unusual? | Longitudinal plot |
| Is the combination of variables unusual? | Multivariate diagnostics |
| Does the observation affect a model? | Residuals / leverage / influence |
| Is the value erroneous? | Source-data investigation |
| Should it be excluded? | Apply prespecified analysis rules |
| Can the decision be reproduced? | Document the reason and retain traceability |
The Most Important Distinction
The most important distinction in outlier analysis is between:
statistical unusualness
and:
data invalidity.
These are not the same thing.
A value can be:
- Statistically extreme and valid.
- Statistically ordinary and incorrect.
- Statistically extreme and incorrect.
- Statistically ordinary and valid.
Statistical methods are therefore best viewed as screening tools within a broader clinical data-review process.
Summary of Major Methods
| Method | Best Use | Main Limitation |
|---|---|---|
| IQR / Tukey fences | General univariate screening | Can flag legitimate tail observations |
| Z-score | Approximately symmetric variables | Sensitive to mean and SD distortion |
| Modified z-score | Robust univariate screening | Still requires interpretation |
| Boxplot | Visual distribution review | Not a formal data-validity test |
| Mahalanobis distance | Multivariate unusualness | Classical version sensitive to contamination |
| Studentized residuals | Regression outliers | Model-dependent |
| Leverage | Unusual predictor patterns | Not necessarily influential |
| Cook's distance | Influential observations | Does not establish data invalidity |
| Clinical reference ranges | Clinical plausibility | Not a statistical outlier definition |
Key Takeaways
References
Tukey, J.W. (1977). Exploratory Data Analysis.
Addison-Wesley.
Rousseeuw, P.J. & Leroy, A.M. (1987). Robust Regression and Outlier Detection.
Wiley.
Hubert, M. & Van der Veeken, S. (2008). Outlier detection for skewed data. Journal of Chemometrics, 22, 235–246.
Cook, R.D. (1977). Detection of influential observation in linear regression. Technometrics, 19(1), 15–18.
Mahalanobis, P.C. (1936). On the generalized distance in statistics. Proceedings of the National Institute of Sciences of India, 2,
49–55.
Barnett, V. & Lewis, T. (1994). Outliers in Statistical Data.
Wiley.
Fox, J. & Weisberg, S. (2019). An R Companion to Applied Regression.
SAGE Publications.
Chambers, J.M. (1992). Linear models.
In Statistical Models in S.
Wadsworth & Brooks/Cole.