summary.CIMTx_ATT_posterior: Summarize a CIMTx_ATT_posterior object

View source: R/summary.CIMTx_ATT_posterior.R

summary.CIMTx_ATT_posteriorR Documentation

Summarize a CIMTx_ATT_posterior object

Description

Summarize a CIMTx_ATT_posterior object

Usage

## S3 method for class 'CIMTx_ATT_posterior'
summary(object, ...)

Arguments

object

a CIMTx_ATT_posterior object obtained with ce_estimate function.

...

further arguments passed to or from other methods.

Value

a list with w-1 elements for ATT effect. Each element of the list contains the estimation, standard error, lower and upper 95% CI for RD/RR/OR.

References

Hadley Wickham (2019). stringr: Simple, Consistent Wrappers for Common String Operations. R package version 1.4.0. URL:https://CRAN.R-project.org/package=stringr

Examples

lp_w_all <-
  c(
    ".4*x1 + .1*x2  - .1*x4 + .1*x5", # w = 1
    ".2 * x1 + .2 * x2  - .2 * x4 - .3 * x5"
  ) # w = 2
nlp_w_all <-
  c(
    "-.5*x1*x4  - .1*x2*x5", # w = 1
    "-.3*x1*x4 + .2*x2*x5"
  ) # w = 2
lp_y_all <- rep(".2*x1 + .3*x2 - .1*x3 - .1*x4 - .2*x5", 3)
nlp_y_all <- rep(".7*x1*x1  - .1*x2*x3", 3)
X_all <- c(
  "rnorm(0, 0.5)", # x1
  "rbeta(2, .4)", # x2
  "runif(0, 0.5)", # x3
  "rweibull(1,2)", # x4
  "rbinom(1, .4)" # x5
)

set.seed(111111)
data <- data_sim(
  sample_size = 300,
  n_trt = 3,
  x = X_all,
  lp_y = lp_y_all,
  nlp_y = nlp_y_all,
  align = FALSE,
  lp_w = lp_w_all,
  nlp_w = nlp_w_all,
  tau = c(-1.5, 0, 1.5),
  delta = c(0.5, 0.5),
  psi = 1
)
ce_estimate_ra_att_result <- ce_estimate(
  y = data$y, x = data$covariates,
  w = data$w, reference_trt = 1, ndpost = 10, method = "RA", estimand = "ATT"
)
summary(ce_estimate_ra_att_result)

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