There are several methods according to which outlier cells can be detected or defined. Which one to use strongly depends on the researchers question at hand. See details for more information on which method does what exactly.

detectOutliers(
  object,
  method_outlier = "iqr",
  threshold_pval = 0.001,
  variable_names = NULL,
  verbose = NULL
)

Arguments

object

A valid cypro object.

method_outlier

Character vector. Specifies the method/algorithm of interest.

Use validOutlierDetectionMethods() to obtain all valid input options.

verbose

Logical. If set to TRUE informative messages regarding the computational progress will be printed.

(Warning messages will always be printed.)

Value

An updated version of the input cypro-object.

Details

This function only detects outliers. It does not remove them from the object. Use removeOutliers() for that matter. To get more insights in the outlier detection results before removing them use getOutlierResults().

Method: Interquartile Range (iqr)

Every stat variable denoted in argument variable_names is screened via R's built in function grDevices::boxplot.stats(). Every ID that is recognized as an outlier is stored in a list slot named after the stat variable under which it was detected as an outlier.

Method: mahalanobis

Multivariate outlier detection method. Mahalanobis distance is computed including all stat variables denoted in argument variable_names via stats::mahalanobis(). P-values are calculated via stats::pchisq() and cells are filtered according to the threshold set with argument threshold_pval. Cells with a mahalanobis distance p-value lower or equal than the threshold are defined as outliers.

See also

removeOutliers()