detect_outliers: Outliers detection

View source: R/detect_outliers.R

detect_outliersR Documentation

Outliers detection

Description

Detection of observations outliers based on residuals values according to two different methods: Grubb's test or a non-parametric method.

Usage

detect_outliers(
  run,
  compartment = NULL,
  residuals = NULL,
  method = "grubbs",
  grubbs_pvalue_threshold = 0.05,
  boxplot_coefficient = 3,
  keep_time_zero = FALSE
)

Arguments

run

pmxploit NONMEM run object.

compartment

integer. Number of the compartment of the observations of interest.

residuals

character. Column name of the residuals in the output tables.

method

character. One of "grubbs" (for iterative Grubb's test) or "boxplot" (for non-parametric detection).

grubbs_pvalue_threshold

numeric. p-value threshold for Grubb's test.

boxplot_coefficient

numeric. k coefficient for non-parametric test.

keep_time_zero

logical. If TRUE, does not ignore values at initiation (when TIME = 0). Default is FALSE.

Value

A list with the following structure:

  • method: character string of outlier detection method.

  • residuals: character string of the type of residuals.

  • source: tibble of the data source.

  • outliers: tibble of the outliers with 5 columns: ID, TIME, CMT, DV and "residuals".

Examples

EXAMPLERUN %>%
 detect_outliers(compartment = 2, residuals = "CWRES", method = "grubbs")

EXAMPLERUN %>%
 detect_outliers(compartment = 2, residuals = "CWRES",
                 method = "grubbs", grubbs_pvalue_threshold = 0.10)

EXAMPLERUN %>%
 detect_outliers(compartment = 2, residuals = "CWRES", method = "boxplot")

pnolain/pmxploit documentation built on Jan. 31, 2024, 1:16 p.m.