cellwiseheatmap {crmReg}R Documentation

Heatmap of cellwise outliers

Description

Makes a heatmap of cellwise outliers.

Usage

cellwiseheatmap(cellwiseoutliers, data,
                col = c("blue", "lightgray", "red"), col.scale.factor = 1,
                notecol.outlier = "white", notecol.clean = "black", notecex = 1,
                margins = c(9.5, 14), lhei = c(0.5, 15), lwid = c(0.1, 3.5),
                sepcolor = "white", sepwidth = c(0.01, 0.01))

Arguments

cellwiseoutliers

a matrix that indicates the cellwise outliers as the (scaled) difference between the original data and imputed data, both scaled and centered. Typically the result of a call to the crm function.

data

the data as a data frame that is shown in the cells, including row and column names.

col

vector of colors used for downward outliers, clean cells and upward outliers respectively (default is c("blue", "lightgray", "red")).

col.scale.factor

numeric factor for scaling the colors of the cells (default is 1). Usually a value between 0 and 1, e.g. 1/2, 1/3, etc.

notecol.outlier

character string specifying the color for cellnote text of cellwise outliers (default is "white").

notecol.clean

character string specifying the color for cellnote text of clean cells (default is "black").

notecex

numeric scaling factor for cellnotes (default is 1).

margins

numeric vector of length 2 containing the margins (see par(mar= *)) for column and row names, respectively (default is c(9.5, 14)).

lhei

numeric vector of length 2 containing the row height (default is c(1, 15)).

lwid

numeric vector of length 2 containing the row width (default is c(0.7, 3.5)).

sepcolor

character string specifying the color between the cells (default is "white").

sepwidth

vector of length 2 giving the width and height of the separator box drawn between the cells (default is c(0.01, 0.01)).

Details

cellwiseheatmap plots a heatmap of cellwise outliers which are typically the result of a call to the crm function.

Author(s)

Peter Filzmoser, Sebastiaan Hoppner, Irene Ortner, Sven Serneels, and Tim Verdonck

References

Filzmoser, P., Hoppner, S., Ortner, I., Serneels, S., and Verdonck, T. (2020). Cellwise Robust M regression. Computational Statistics and Data Analysis, 147, 106944. DOI:10.1016/j.csda.2020.106944

See Also

crm, spadimo, predict.crm, daprpr

Examples

library(crmReg)
data(topgear)

# fit Cellwise Robust M-regression:
crmfit <- crm(formula = MPG ~ ., data = topgear)

# cellwise heatmap of casewise outliers:
cellwiseheatmap(cellwiseoutliers = crmfit$cellwiseoutliers[which(crmfit$casewiseoutliers), ],
                data = round(topgear[which(crmfit$casewiseoutliers), -7], 2),
                col.scale.factor = 1/4)
# check the plotted heatmap!

[Package crmReg version 1.0.2 Index]