Compile MCMC sampler using STAN and create analysis object
create_analysis_obj.RdCompile MCMC sampler using STAN and create analysis object
Usage
create_analysis_obj(
data_matrix,
covariates = NULL,
outcome,
borrowing,
treatment,
quiet = FALSE
)Arguments
- data_matrix
matrix. The data matrix, including all covariates to be adjusted for, all relevant outcome variables, and treatment arm and external control arm flags.
- covariates
Covariates. Object of classCovariatesas output by the functionadd_covariates().- outcome
Outcome. Object of classOutcomeas output byexp_surv_dist(),weib_ph_surv_dist(), orlogistic_bin_outcome().- borrowing
Borrowing. Object of classBorrowingas output byborrowing_details().- treatment
Treatment. Object of classTreatmentas output bytreatment_details().- quiet
logical. Whether to suppress messages (
TRUE) or not (FALSE, the default)
Value
Object of class Analysis.
Examples
anls <- create_analysis_obj(
data_matrix = example_matrix,
covariates = add_covariates(
covariates = c("cov1", "cov2"),
priors = normal_prior(0, 1000)
),
outcome = exp_surv_dist(
"time",
"cnsr",
baseline_prior = normal_prior(0, 1000)
),
borrowing = borrowing_details(
"BDB",
"ext",
exponential_prior(.001)
),
treatment = treatment_details(
"trt",
normal_prior(0, 1000)
)
)
#> Inputs look good.
#> Stan program compiled successfully!
#> Ready to go! Now call `mcmc_sample()`.