Skip to contents

This function plots the density of ATE from bayesmsm output.

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.

Value

A ggplot object representing the density plot for the posterior predictive distribution of the Average Treatment Effect (ATE).

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)),
                  treatment_effect_type = "sq",
                  family = "gaussian",
                  data = testdata,
                  wmean = rep(1, 1000),
                  nboot = 10,
                  optim_method = "BFGS",
                  parallel = FALSE)
plot_ATE(model)