Skip to contents

Create a list of data in the correct format for Stan

Usage

prepare_stan_data_inputs(analysis_obj)

Arguments

analysis_obj

Analysis. Object of class Analysis created by psborrow2:::.analysis_obj().

Value

Named list of data inputs that correspond to items in the Stan data block.

Examples

anls_obj <- psborrow2:::.analysis_obj(
  data_matrix = example_matrix,
  outcome = exp_surv_dist("time", "cnsr"),
  borrowing = borrowing_details(
    "BDB",
    normal_prior(0, 100),
    "ext",
    exponential_prior(0.001)
  ),
  treatment = treatment_details("trt", normal_prior(0, 100))
)

anls_obj@model_and_data <- list(
  data_in = psborrow2:::prepare_stan_data_inputs(anls_obj)
)