Plots smoothed density plots of observed and imputed values from output
from the amelia
function.
compare.density(output, var, col = c("red","black"), scaled = FALSE,
lwd = 1, main, xlab, ylab, legend = TRUE, frontend = FALSE, …)
output from the function amelia
.
column number or variable name of the variable to plot.
a vector of length 2 containing the color to plot the (1) imputed density and (2) the observed density.
a logical indicating if the two densities should be scaled to reflect the difference in number of units in each.
the line width of the density plots.
main title of the plot. The default is to title the plot using the variable name.
the label for the x-axis. The default is the name of the variable.
the label for the y-axis. The default is "Relative Density."
a logical value indicating if a legend should be plotted.
a logical value used internally for the Amelia GUI.
further graphical parameters for the plot.
This function first plots a density plot of the observed units for the
variable var
in col[2]
. The the function plots a density plot of the mean
or modal imputations for the missing units in col[1]
. If a
variable is marked "ordinal" or "nominal" with the ords
or
noms
options in amelia
, then the modal imputation will
be used. If legend
is TRUE
, then a legend is plotted as well.
Abayomi, K. and Gelman, A. and Levy, M. 2005 "Diagnostics for Multivariate Imputations," Applied Statistics. 57,3: 273--291.
For more information on how densities are computed,
density
; Other imputation diagnostics are
overimpute
, disperse
, and
tscsPlot
.