View source: R/dm.mahalanobis.R
dm.mahalanobis | R Documentation |
Implements Mahalanobis distance measure for outlier detection. In addition to the basic distance measure, boxplots are provided with potential outlier(s) to give an insight into the early stage of data cleansing task.
dm.mahalanobis(data, from="median", p=10, plot=FALSE, v.index=NULL, layout=NULL)
data |
Dataframe |
from |
Datum point from which the distance is measured |
p |
Percentage to which outlier point(s) is noted (default of 10) |
plot |
Switch for boxplot(s) |
v.index |
Numeric vector indicating column(s) to be printed in the boxplot.
Default value of |
layout |
Numeric vector indicating dimension of boxplots.
Default value of |
$dist |
|
$excluded |
Excluded row(s) in row number |
$order |
Distance order (decreasing) in row number |
$suspect |
Potential outlier(s) in row number |
Dong-Joon Lim, PhD
Hair, Joseph F., et al. Multivariate data analysis. Vol. 7. Upper Saddle River, NJ: Pearson Prentice Hall, 2006.
# Generate a sample dataframe
df <- data.frame(replicate(6, sample(0 : 100, 50)))
# go
dm.mahalanobis(df, plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.