outlier: Multivariate outlier detection

View source: R/outlier.R

outlierR Documentation

Multivariate outlier detection

Description

Detect multivariante outliers using Mahalanobis distance using mean and covariance estimated either with standard or robust methods.

Usage

outlier(data, robust = FALSE, ...)

Arguments

data

matrix of data

robust

use robust covariance method, defaults to FALSE

...

arguments passed to MASS::cov.rob()

Details

The distance follow a chisq distrubtion under the null with standard method for mean and covariance. It is approximate if the robust method is used. So use qchisq(p = 0.999 , df = k) to get cutoff to keep 99.9% of samples under the null for data with k=2 columns.

Value

data.frame storing chisq and z-score for each entry indicating deviation from the mean. The z-score is computed by evaluating the p-value of chisq statistic and converting it into a z-score

Examples

data <- matrix(rnorm(200), 100, 2)

res <- outlier(data)

res[1:4,]

GabrielHoffman/dreamlet documentation built on Nov. 23, 2024, 12:28 a.m.