Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.mids

Plot the trace lines of the MICE algorithm


Description

Trace line plots portray the value of an estimate against the iteration number. The estimate can be anything that you can calculate, but typically are chosen as parameter of scientific interest. The plot method for a mids object plots the mean and standard deviation of the imputed (not observed) values against the iteration number for each of the $m$ replications. By default, the function plot the development of the mean and standard deviation for each incomplete variable. On convergence, the streams should intermingle and be free of any trend.

Usage

## S3 method for class 'mids'
plot(
  x,
  y = NULL,
  theme = mice.theme(),
  layout = c(2, 3),
  type = "l",
  col = 1:10,
  lty = 1,
  ...
)

Arguments

x

An object of class mids

y

A formula that specifies which variables, stream and iterations are plotted. If omitted, all streams, variables and iterations are plotted.

theme

The trellis theme to applied to the graphs. The default is mice.theme().

layout

A vector of length 2 given the number of columns and rows in the plot. The default is c(2, 3).

type

Parameter type of panel.xyplot.

col

Parameter col of panel.xyplot.

lty

Parameter lty of panel.xyplot.

...

Extra arguments for xyplot.

Value

An object of class "trellis".

Author(s)

Stef van Buuren 2011

See Also

Examples

imp <- mice(nhanes, print = FALSE)
plot(imp, bmi + chl ~ .it | .ms, layout = c(2, 1))

mice

Multivariate Imputation by Chained Equations

v3.13.0
GPL-2 | GPL-3
Authors
Stef van Buuren [aut, cre], Karin Groothuis-Oudshoorn [aut], Gerko Vink [ctb], Rianne Schouten [ctb], Alexander Robitzsch [ctb], Patrick Rockenschaub [ctb], Lisa Doove [ctb], Shahab Jolani [ctb], Margarita Moreno-Betancur [ctb], Ian White [ctb], Philipp Gaffert [ctb], Florian Meinfelder [ctb], Bernie Gray [ctb], Vincent Arel-Bundock [ctb]
Initial release
2021-01-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.