Outlier Detection for Precision Profiles

knitr::opts_chunk$set(
  fig.width = 8,
  fig.height = 6,
  fig.align = "center",
  collapse = TRUE,
  comment = "#>",
  warning = FALSE,
  message = FALSE
)

Motivation

Outliers can strongly influence precision profiles, especially when only a small number of concentration levels is available. The outlier detection workflow in VFP is intended as a diagnostic aid. A detected outlier should not be removed automatically; the analytical context and available experimental information should be reviewed before deciding whether to exclude an observation.

Example Data

The Glucose data set contains duplicate measurements. For this example, the mean concentration and variance are calculated from each duplicate pair. Because each variance is derived from two measurements, the corresponding degrees of freedom are set to one.

suppressPackageStartupMessages(library(VFP))

glucose <- Glucose
glucose$DF <- 1
glucose$Mean <- (glucose$V1 + glucose$V2) / 2
glucose$VC <- (glucose$V1 - glucose$V2)^2 / 4
glucose <- glucose[glucose$VC > 0, ]

head(glucose[, c("Mean", "VC", "DF")])

Fit the Initial Precision Profile

First, fit the candidate precision profile models to all observations.

fit <- fit_vfp(glucose, model.no = 1:9, quiet = TRUE)
plot(fit, type = "cv")

The initial fit represents the precision profile using all observations. If one observation has a large influence on the selected model or on the fitted curve, this may become visible in the profile or in the model diagnostics.

Run Outlier Detection

out <- find_outliers(fit, mult = "fdr")
out$outliers$res[, c("SampleID", "OCmean", "OCvar", "OCcv", "pValue", "Outlier")]

Here, mult = "fdr" uses false discovery rate adjustment. See the section "Notes on Multiplicity Adjustment" for available options.

find_outliers() ranks candidate observations using deviance residuals and evaluates whether removing a candidate improves the model fit. The procedure refits the model iteratively and can adjust p-values for multiple testing.

Visualize the Result

plot_outliers(out, type = "cv")

The outlier plot compares the original fit with the final fit after removal of confirmed outliers.

Interpretation

The result should be interpreted as statistical evidence for influential observations, not as an automatic exclusion rule. Before removing an observation, review whether there is an analytical, technical, or documentation-based reason for exclusion.

A recommended workflow is:

  1. Fit the initial precision profile.
  2. Inspect the fitted model and diagnostic plots.
  3. Run find_outliers().
  4. Visualize the result with plot_outliers().
  5. Review each detected outlier in context.
  6. Document whether the observation is removed or retained.
  7. Report the final model and the rationale.

Notes on Multiplicity Adjustment

The mult argument controls how p-values are adjusted for multiple testing. Available options are:

For most routine applications, "fdr" is a reasonable starting point because it balances sensitivity and control of false discoveries. Use "bonf" when false positive outlier calls should be minimized, and "none" mainly for exploratory analyses or debugging.

Limitations

Outlier detection is most useful as a diagnostic tool. Results can be unstable for very small data sets, highly sparse concentration ranges, or cases where several observations jointly influence the model. The procedure should therefore support, not replace, scientific judgment.



Try the VFP package in your browser

Any scripts or data that you put into this service are public.

VFP documentation built on Dec. 4, 2026, 5:09 p.m.