compare.density.RdPlots smoothed density plots of observed and imputed values from output
from the amelia function.
compare.density(output, var, col = c("indianred", "dodgerblue"), scaled = FALSE, lwd = 1, main, xlab, ylab, legend = TRUE, frontend = FALSE, ...)
| output | output from the function |
|---|---|
| var | column number or variable name of the variable to plot. |
| col | a vector of length 2 containing the color to plot the (1) imputed density and (2) the observed density. |
| scaled | a logical indicating if the two densities should be scaled to reflect the difference in number of units in each. |
| lwd | the line width of the density plots. |
| main | main title of the plot. The default is to title the plot using the variable name. |
| xlab | the label for the x-axis. The default is the name of the variable. |
| ylab | the label for the y-axis. The default is "Relative Density." |
| legend | a logical value indicating if a legend should be plotted. |
| frontend | 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.