50% off: Unlimited data and AI learning.
The Learning Leader's Guide to AI Literacy

mi (version 0.10-2)

missing.pattern.plot: Missing Pattern Plot

Description

Function to plot a missing pattern plot.

Usage

missing.pattern.plot ( data, y.order = FALSE, x.order = FALSE, clustered = TRUE, 
                                    xlab = "Index", ylab = "Variable", 
                                    main = NULL, gray.scale = FALSE,
                                    obs.col = "blue", mis.col = "red", ... )

Arguments

data
data.frame or matrix of data with missing data coded as "NA".
y.order
if TRUE, orders the variable by number of missing value. Default is FALSE.
x.order
if TRUE, orders the data by number of missing value. Default is FALSE.
clustered
if TRUE, data are grouped together with similiar missingness patterns.
xlab
a title for the x axis: see 'title'.
ylab
a title for the y axis: see 'title'.
main
an overall title for the plot: see 'title'.
gray.scale
if TRUE, makes the plot into black and white. This option overwrites the color specification.
obs.col
color used for observed values. Default is "blue".
mis.col
color used for missing values. Default is "red".
...
additional parameters passed to 'image' function.

Value

  • Plot to visualize pattern of missingness in the data.

Details

Color image with different color for missing and observed value in the dataset is plotted. By default the observed is in "blue" and missing is in "red".

References

Yu-Sung Su, Andrew Gelman, Jennifer Hill, Masanao Yajima. Forthcoming. Multiple Imputation with Diagnostics (mi) in R: Opening Windows into the Black Box. Journal of Statistical Software. Kobi Abayomi, Andrew Gelman and Marc Levy. (2008). Diagnostics for multivariate imputations. Applied Statistics 57, Part 3: 273--291. Andrew Gelman and Jennifer Hill. (2007). Data Analysis Using Regression and Multilevel/Hierarchical Models. Cambridge University Press.

See Also

mi, plot

Examples

Run this code
data(CHAIN)
  missing.pattern.plot(CHAIN)

Run the code above in your browser using DataLab