create_analysis_obj {psborrow2} | R Documentation |
Compile MCMC sampler using STAN and create analysis object
Description
Compile MCMC sampler using STAN and create analysis object
Usage
create_analysis_obj(
data_matrix,
outcome,
borrowing,
treatment,
covariates = NULL,
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. |
outcome |
|
borrowing |
|
treatment |
|
covariates |
|
quiet |
logical. Whether to suppress messages ( |
Value
Object of class Analysis
.
Examples
if (check_cmdstan()) {
anls <- create_analysis_obj(
data_matrix = example_matrix,
outcome = outcome_surv_exponential(
"time",
"cnsr",
baseline_prior = prior_normal(0, 1000)
),
borrowing = borrowing_hierarchical_commensurate(
"ext",
prior_exponential(.001)
),
treatment = treatment_details(
"trt",
prior_normal(0, 1000)
),
covariates = add_covariates(
covariates = c("cov1", "cov2"),
priors = prior_normal(0, 1000)
)
)
}
[Package psborrow2 version 0.0.3.4 Index]