outlier | R Documentation |
Detect multivariante outliers using Mahalanobis distance using mean and covariance estimated either with standard or robust methods.
outlier(data, robust = FALSE, ...)
data |
matrix of data |
robust |
use robust covariance method, defaults to |
... |
arguments passed to |
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.
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
data <- matrix(rnorm(200), 100, 2)
res <- outlier(data)
res[1:4,]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.