outlier1dv: Outlier measure based on tukey definition

Description Usage Arguments Value Author(s) See Also Examples

View source: R/preperation.R

Description

Creates a matrix of outlier scores for the data set based on Tukey's defnition.

Usage

1

Arguments

x

A numeric vector, a numeric matrix or a data frame. In case of a data frame only the numeric variables are used.

Value

A data frame with same dimension as x minus non-numeric variables.

Author(s)

Katrin Grimm

See Also

outliertuk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data(Election2005)
## Not run: 
outlm <- outlier1dv(Election2005)

# order data frame based on absolute row and column sums
abssum <- function(x){
  x <- abs(x)
  return(sum(x))
}
outlm2 <- outlm[order(apply(outlm,1,abssum),decreasing=TRUE),]
# consider only the 50 rows with  hightest values
outlm3 <- outlm2[1:50,1:68]
outlm4 <- outlm3[,order(apply(outlm3,2,abssum),decreasing=TRUE)]

# plot in heatmap

library(gplots)
heatmap.2(as.matrix(outlm4), col=colorpanel(20, "red", "white","blue"),
          breaks=seq(-1,1,2/20),dendrogram="none",
          key=FALSE,trace="none",Rowv=FALSE,Colv=FALSE)
          
## End(Not run)

mbgraphic documentation built on May 2, 2019, 2:45 a.m.