mbgraphic (version 1.0.1)

outlier1dv: Outlier measure based on tukey definition

Description

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

Usage

outlier1dv(x)

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.

See Also

outliertuk

Examples

Run this code
# NOT RUN {
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)
          
# }

Run the code above in your browser using DataLab