UnivariateOutlierDetection: Univariate Outlier Detection(Intersection of all the methods)

Description Usage Arguments Details Value Author(s) Examples

Description

Takes a vector and finds its outliers using combination of different methods

Usage

1
2
3
UnivariateOutlierDetection(x, k = 0.05 * length(x), cutoff = 0.95,
  dist = FALSE, dens = FALSE, depth = FALSE, Method = "euclidean",
  rnames = FALSE)

Arguments

x

vector for which outliers are to be found

k

No. of nearest neighbours to be used for distance methods, default value is 0.05*nrow(x)

cutoff

Percentile threshold used for outlier detection using bootstrapping, default value is 0.95

dist

Logical value indicating whether distance based methods should be used or not, default is False

dens

Logical value indicating whether density based method should be used or not, default is False

depth

Logical value indicating whether depth based method should be used or not, default is False

Method

Distance method, default is euclidean

rnames

Logical value indicating whether the dataset has rownames, default value is False

Details

UnivariateOutlierDetection finds outlier observations for an univariate data using different methods and based on all the methods, labels an observation as outlier(intersection of all the methods). It also shows the scatterplot of the data with labelled outliers with observation no. as x-axis.

Value

Outlier Observations: A vector of outlier observations

Location of Outlier: Vector of Sr. no. of outliers

Author(s)

Vinay Tiwari, Akanksha Kashikar

Examples

1
2
3
4
5
#Create dataset
X=iris[,1:4]
#Outlier detection
depthout(X,cutoff=0.05)
UnivariateOutlierDetection(iris[,1],cutoff=.95,Method="euclidean",rnames=FALSE)

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 
$`Outlier Observations`
    Sepal.Length Sepal.Width Petal.Length Petal.Width
110          7.2         3.6          6.1         2.5
118          7.7         3.8          6.7         2.2
119          7.7         2.6          6.9         2.3
132          7.9         3.8          6.4         2.0

$`Location of Outlier`
[1] 110 118 119 132

$`Outlier Probability`
[1] 1.00 1.00 1.00 0.99

$`3Dplot`

Warning messages:
1: `arrange_()` is deprecated as of dplyr 0.7.0.
Please use `arrange()` instead.
See vignette('programming') for more help
This warning is displayed once every 8 hours.
Call `lifecycle::last_warnings()` to see where this warning was generated. 
2: `line.width` does not currently support multiple values. 
3: `line.width` does not currently support multiple values. 
$`Outlier Observations`
[1] 4.3 7.6 7.7 7.7 7.7 7.4 7.9 7.7

$`Location of Outlier`
[1]  14 106 118 119 123 131 132 136

$`Scatter plot`

OutlierDetection documentation built on June 16, 2019, 1:03 a.m.