View source: R/create_analysis_obj.R
create_analysis_obj | R Documentation |
Compile MCMC sampler using STAN and create analysis object
create_analysis_obj(
data_matrix,
outcome,
borrowing,
treatment,
covariates = NULL,
quiet = FALSE
)
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 ( |
Object of class Analysis
.
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)
)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.