Learn R Programming

OutlierDetection (version 0.1.1)

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

Description

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

Usage

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

Value

Outlier Observations: A vector of outlier observations

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

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.

Examples

Run this code
# NOT RUN {
#Create dataset
X=iris[,1:4]
#Outlier detection
depthout(X,cutoff=0.05)
UnivariateOutlierDetection(iris[,1],cutoff=.95,Method="euclidean",rnames=FALSE)
# }

Run the code above in your browser using DataLab