plot.RoBTT allows to visualize different "RoBTT" object parameters in various ways. See type for the different model types.

# S3 method for RoBTT
plot(
  x,
  parameter = "mu",
  transform_rho = FALSE,
  conditional = FALSE,
  plot_type = "base",
  prior = FALSE,
  dots_prior = NULL,
  ...
)

Arguments

x

a fitted 'RoBTT' object

parameter

a parameter to be plotted. Defaults to "delta" (for the effect size). The additional options are "rho" (for the heterogeneity), "nu" (for the degrees of freedom).

transform_rho

whether rho parameter should be translated into log standard deviation ratio

conditional

whether conditional estimates should be plotted. Defaults to FALSE which plots the model-averaged estimates.

plot_type

whether to use a base plot "base" or ggplot2 "ggplot" for plotting. Defaults to "base".

prior

whether prior distribution should be added to figure. Defaults to FALSE.

dots_prior

list of additional graphical arguments to be passed to the plotting function of the prior distribution. Supported arguments are lwd, lty, col, and col.fill, to adjust the line thickness, line type, line color, and fill color of the prior distribution respectively.

...

list of additional graphical arguments to be passed to the plotting function. Supported arguments are lwd, lty, col, col.fill, xlab, ylab, main, xlim, ylim to adjust the line thickness, line type, line color, fill color, x-label, y-label, title, x-axis range, and y-axis range respectively.

Value

plot.RoBTT returns either NULL if plot_type = "base"

or an object object of class 'ggplot2' if plot_type = "ggplot2".

See also

Examples

if (FALSE) {
data("fertilization", package = "RoBTT")
fit <- RoBTT(
  x1       = fertilization$Self,
  x2       = fertilization$Crossed,
  prior_delta = prior("cauchy", list(0, 1/sqrt(2))),
  prior_rho   = prior("beta",   list(3, 3)),
  seed        = 1, 
  chains      = 1,
  warmup      = 1000,
  iter        = 2000,
  control     = set_control(adapt_delta = 0.95)
)

# plot the model-averaged effect size estimate
plot(fit, parameter = "delta")

# plot prior and posterior of the conditional effect size estimate
plot(fit, parameter = "delta", conditional = TRUE, prior = TRUE)
}