Skip to contents

take an Analysis object's data_matrix and remove everything unnecessary in preparation of making input data for Stan

Usage

trim_data_matrix(analysis_obj)

Arguments

analysis_obj

Analysis. An object of class Analysis as created through .create_analysis_obj().

Value

An object of class Analysis

Examples


anls <- psborrow2:::.analysis_obj(
  data_matrix = example_matrix,
  covariates = add_covariates(
    covariates = c("cov1", "cov2"),
    priors = normal_prior(0, 1000)
  ),
  outcome = exp_surv_dist(
    "time",
    "cnsr"
  ),
  borrowing = borrowing_details(
    "BDB",
    "ext",
    exponential_prior(.001),
    baseline_prior = normal_prior(0, 1000)
  ),
  treatment = treatment_details(
    "trt",
    normal_prior(0, 1000)
  ),
  ready_to_sample = FALSE
)

anls <- psborrow2:::trim_data_matrix(anls)