Visualizing the posterior sample Creates a set of plots for visually evaluating convergence and mixing of the chains from the MCMC sample of an object of class 'remiod'.

mcmcplot(object, what = c("trace", "density"), subset = c(analysis_main =
  TRUE), outcome = NULL, mi.setting = NULL, nrow = NULL, ncol = NULL,
  use_ggplot = TRUE, mess = TRUE, warn = FALSE, ...)

Arguments

object

an object inheriting from class 'remoid'

what

select either trace or density plots from MCMC samples

subset

subset of parameters/variables/nodes (columns in the MCMC sample). Follows the same principle as the argument monitor_params in *_imp.

outcome

optional; vector identifying a subset of sub-models included in the output, either by specifying their indices (using the order used in the list of model formulas), or their names (LHS of the respective model formula as character string)

mi.setting

a list of arguments for extracting MI data set, which will be used to update the one in remoid object. Default is NULL, meaning no update to the mi.setting in remoid object.

nrow

optional; number of rows in the plot layout; automatically chosen if unspecified

ncol

optional; number of columns in the plot layout; automatically chosen if unspecified

use_ggplot

logical; Should ggplot be used instead of the base graphics?

mess

logical; should messages be given? Default is TRUE.

warn

logical; should warnings be given? Default is TRUE.

...

Arguments passed on to graphics::matplot

lty

vector of line types, widths, and end styles. The first element is for the first column, the second element for the second column, etc., even if lines are not plotted for all columns. Line types will be used cyclically until all plots are drawn.

lwd

vector of line types, widths, and end styles. The first element is for the first column, the second element for the second column, etc., even if lines are not plotted for all columns. Line types will be used cyclically until all plots are drawn.

lend

vector of line types, widths, and end styles. The first element is for the first column, the second element for the second column, etc., even if lines are not plotted for all columns. Line types will be used cyclically until all plots are drawn.

col

vector of colors. Colors are used cyclically.

cex

vector of character expansion sizes, used cyclically. This works as a multiple of par("cex"). NULL is equivalent to 1.0.

bg

vector of background (fill) colors for the open plot symbols given by pch = 21:25 as in points. The default NA corresponds to the one of the underlying function plot.xy.

add

logical. If TRUE, plots are added to current one, using points and lines.

verbose

logical. If TRUE, write one line of what is done.

Value

plots of traces or densities of MCMC samples for selected parameters in imputation models.

Examples

# \donttest{
# data(schizow)

test = remiod(formula = y6 ~ tx + y0 + y1 + y3, data = schizow,
              trtvar = 'tx', algorithm = 'jags', method="MAR",
              ord_cov_dummy = FALSE, n.adapt = 10, n.chains = 1,
              n.iter = 10, thin = 2, warn = FALSE, seed = 1234)
#> NOTE: Stopping adaptation
#> 
#> 

p1 = mcmcplot(object=test, what="trace")
# }