View source: R/outlier-detection.R
detectOutliers | R Documentation |
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, across = NULL, phase = NULL, verbose = NULL )
object |
A valid cypro object. |
method_outlier |
Character vector. Specifies the method/algorithm of interest. Use |
across |
Character value, character vector or NULL (see details for more). Specifies the grouping variable of interest. Use |
phase |
Character or numeric. If character, the ordinal value referring to the phase of interest (e.g. 'first', 'second' etc.). referring to the phase of interest or 'all'. If numeric, the number referring to the phase. If set to NULL takes the phase denoted as default with Ignored if the experiment design contains only one phase. |
verbose |
Logical. If set to TRUE informative messages regarding the computational progress will be printed. (Warning messages will always be printed.) |
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.
An updated version of the input cypro
-object.
removeOutliers()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.