Compile MCMC sampler using STAN and create analysis object
create_analysis_obj.Rd
Compile 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 classCovariates
as output by the functionadd_covariates()
.- outcome
Outcome
. Object of classOutcome
as output byexp_surv_dist()
,weib_ph_surv_dist()
, orlogistic_bin_outcome()
.- borrowing
Borrowing
. Object of classBorrowing
as output byborrowing_details()
.- treatment
Treatment
. Object of classTreatment
as 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()`.