Learn R Programming

VIM (version 7.3.0)

plot.vimmi: Diagnostic plots for a vimmi object

Description

Draws mice-style multiple-imputation diagnostics for a vimmi object, for every numeric variable with imputed cells:

"chains"

convergence trace plots of the sequential (FCS) imputation: the mean and the standard deviation of the imputed values against the iteration number, one line per imputation. Chains that mix well fluctuate around a common level without trends; systematic drift suggests increasing nseq. Requires chain statistics (stored by vimpute() since VIM 7.3.0).

"density"

the density of the observed values (blue, bold) overlaid with the density of each imputation's imputed values (red, thin) -- the analogue of mice::densityplot(). Imputed densities that deviate wildly from the observed one can flag model misfit (or genuine MAR shifts).

"strip"

every value as a point: column 0 holds the observed values (blue), columns 1..m the imputed values of each imputation (red) -- the analogue of mice::stripplot().

Usage

# S3 method for vimmi
plot(x, y = c("chains", "density", "strip"), ...)

Value

x, invisibly

Arguments

x

A vimmi object created by vimpute() with m > 1

y

Type of diagnostic: "chains" (default), "density", or "strip"

...

Passed on to the underlying base-graphics calls

See Also

vimmi, vimpute

Examples

Run this code
if (FALSE) {
result <- vimpute(sleep, method = "ranger", m = 5, seed = 1)
plot(result)             # convergence chains
plot(result, "density")  # observed vs imputed densities
plot(result, "strip")    # observed vs imputed values
}

Run the code above in your browser using DataLab