Plot diagnostics for "Missing Completely at Random" (MCAR)

DESCRIPTION:

Graphically displays diagnostics of whether missingness patterns depend upon the values of other variables.

USAGE:

plot.mcar(x, ..., legend = F, args.key = NULL,  
  whichPlot = 1:2, ask = missing(whichPlot), patterns) 

REQUIRED ARGUMENTS:

x
an mcar object (created by mcar).

OPTIONAL ARGUMENTS:

...
graphing arguments which are passed to the second plot below. In particular, ylim can be used to make space for a legend.
legend
if TRUE a legend will be drawn using key.
args.key
a list containing optional arguments to key, e.g. x and y.
whichPlot
vector or scalar; if 1 then only the first plot is done, if 2 then only the second plot is done.
ask
if TRUE then the function pauses between plots. By default, the function pauses between the first and second plots if both are shown.
patterns
vector of indices or logical vector, indicating which patterns should be shown in the first plot.

SIDE EFFECTS:

Two plots are produced on the current graphics device.

The first plot is based on Little's test for MCAR. One rectangle is plotted for each pattern, with area equal to the normalized Mahalanobis distance, and width equal to the number of observed variables in that pattern. For patterns with relatively few observations, which have little influence on the overall estimate of mu, the heights of the rectangles are approximately distributed as chi-squared variables divided by their degrees of freedom, with an expected value of 1, if the null hypothesis H0 holds. More generally, the expected heights under H0 are approximately (1-influence) , where influence is the influence of the observations in a pattern on the overall estimate of the means; these expected heights are shown with horizontal lines. Rectangles which are taller than the corresponding lines indicate positive contributions to the test statistic. Also superimposed over each rectangle are points, one for each observed variable in the pattern, at heights equal to (1-fraction) , where fraction is the fraction of all observations for the variable which are found in the pattern. The lines and points may not be visible on a black and white graphics device.

The second plots are the values of t-tests for dependence between the values of numerical variables and whether or not other variables are missing. Each t-test compares the values of the numeric variable across two groups determined by whether the grouping variable is missing or not. The 0.025 and 0.975 percentiles of a t-distribution with the appropriate degrees of freedom are shown on the last plot. If the null hypothesis holds then on average approximately 5 percent of the t-values will fall outside this range.

DETAILS:

This function is a method for the generic function plot for the class "mcar". It can be invoked by calling plot for an object of class "mcar", or directly.

REFERENCES:

Hesterberg, Tim C. (1999). A Graphical Representation of Little's Test for MCAR. Technical Report No. 94, Research Department, Insightful Corporation, 1700 Westlake Ave. N., Suite 500, Seattle, WA 98109. http://www.insightful.com/Hesterberg/articles/tech94-mi-little.pdf

Little, R. J. A. (1988). A test of missing completely at random for multivariate data with missing values. Journal of the American Statistical Asssociation 38, 1198-1202.

SEE ALSO:

, , .

EXAMPLES:

set.seed(0) 
x <- longley.x; x[runif(96) > .9] <- NA  # random missing data 
M <- mcar(x) 
plot(M)