plot.mi {mi}R Documentation

Diagnostic Plots for multiple imputation object

Description

Diagnostic plots for testing the fit of the imputation method to the observed data.

Usage

## S3 method for class 'mi':
plot( x, m = 1, vrb = NULL, vrb.name = "Variable Score",
                    gray.scale = FALSE, mfrow=c( 1, 4 ), ... )

Arguments

x mi object generated by the mi function.
m The m-th imputation. By default is 1.
vrb A chosen variable for the scatter plot.
vrb.name A name of the vrb variable.
gray.scale When set to TRUE, makes the plot into gray scale with predefined color and line type.
mfrow See "par" for details.
... Arguments for other methods, not used.

Details

For each variable, observed values are in blue, the imputed values are in red. In the scatterplot the observed and the imputed are plotted versus a variable the users can choose. By default the values are plotted against an index number but it strongly recommended to use a variable containing more information. Fitted lowess lines are also plotted for both observed and imputed data. A small amount of random noise (jittering) is added to the points so that they do not fall on top of each other.

Value

Histograms, scatterplots, and residual plots of the fit of the imputation models. Binned residual plots are for each dichotomous variable.

Author(s)

Masanao Yajima yajima@stat.columbia.edu, M.Grazia Pittau grazia@stat.columbia.edu, Andrew Gelman gelman@stat.columbia.edu

References

Andrew Gelman and M. Grazia Pittau, A flexible program for missing-data imputation and model checking, Technical report, Columbia University, New York; Andrew Gelman and Jennifer Hill, Data Analysis Using Regression and Multilevel/Hierarchical Models, Cambridge University Press, 2007.

See Also

mi, mi.scatterplot, mi.hist

Examples

  data(CHAIN)
  imp.CHAIN <- mi(CHAIN,n.iter=6)
  plot(imp.CHAIN)

  #==========================================
  #Selecting the variable for the scatterplot
  #==========================================
  #The selected variable vrb is the average of the continuous variables
  #imputed in the first imputation
  vv <- as.vector(apply(mi.matrix(imp.CHAIN), 2, typecast))=="squareroot-continuous"
  var <- apply(mi.matrix(imp.CHAIN)[,vv],1,mean)
  plot(imp.CHAIN, vrb=var,  vrb.name="Average of the continuous variables")

[Package mi version 0.02-02 Index]