R/plot.CIMTx_ATE_posterior.R

Defines functions plot.CIMTx_ATE_posterior

Documented in plot.CIMTx_ATE_posterior

#' Plot for non-IPTW estimation methods with bootstrapping for ATE effect
#'
#' @param x a \code{CIMTx_ATE_posterior} object obtained
#' @param ... further arguments passed to or from other methods.
#'
#' @return an error message
#' @export
#'
#' @examples
#' \dontrun{
#' result <- list(method = "RA")
#' class(result) <- "CIMTx_ATE_posterior"
#' plot(result)
#' }
plot.CIMTx_ATE_posterior <- function(x, ...) {
  if (x$method %in% c("IPTW-Multinomial", "IPTW-GBM", "IPTW-SL")) {
    stop(
      "Plot function is not supported for estimation method using ",
      x$method,
      " when boot is set to TRUE. Plot function is only supported",
      " for estimation method using IPTW when boot is set to FALSE."
    )
  } else {
    stop(
      "Plot function is not supported for estimation method using ",
      x$method,
      ". Plot function is only supported for estimation method using",
      " IPTW when boot is set to FALSE."
    )
  }
}

Try the CIMTx package in your browser

Any scripts or data that you put into this service are public.

CIMTx documentation built on June 24, 2022, 9:07 a.m.