Skip to contents

Plot Average Treatment Effect Density from Bootstrap Results

Usage

plot_ATE(
  input,
  ATE = "RD",
  col_density = "blue",
  fill_density = "lightblue",
  main = "Posterior Predictive Distribution of Average Treatment Effect",
  xlab = "ATE",
  ylab = "Posterior Predictive Distribution",
  xlim = NULL,
  ylim = NULL,
  ...
)

Arguments

input

A model object, data frame or vector containing the bootstrap estimates of ATE.

ATE

define causal estimand of interest from RD, OR, RR.

col_density

Color for the density plot (default is "blue").

fill_density

Fill color for the density plot (default is "lightblue").

main

Title of the plot (default is "Density of ATE Estimates").

xlab

X-axis label (default is "ATE").

ylab

Y-axis label (default is "Density").

xlim

Limits for the x-axis (default is NULL).

ylim

Limits for the y-axis (default is NULL).

...

Additional graphical parameters passed to the plot function.

Examples

testdata <- read.csv(system.file("extdata",
                                 "continuous_outcome_data.csv",
                                 package = "bayesmsm"))
model <- bayesmsm(ymodel = y ~ a_1+a_2,
                           nvisit = 2,
                           reference = c(rep(0,2)),
                           comparator = c(rep(1,2)),
                           family = "gaussian",
                           data = testdata,
                           wmean = rep(1, 1000),
                           nboot = 100,
                           optim_method = "BFGS",
                           parallel = TRUE,
                           ncore = 2)
plot_ATE(model)