Skip to contents

jointly estimate all treatments generate Stan code

Usage

bmcm_stan(
  input_data,
  formula,
  cureformula = ~1,
  family_latent = "exponential",
  prior_latent = NA,
  prior_cure = list(),
  centre_coefs = FALSE,
  bg_model = c("bg_distn", "bg_fixed"),
  bg_varname = "bg_rate",
  bg_hr = 1,
  t_max = 70,
  save_stan_code = FALSE,
  read_stan_code = FALSE,
  precompiled_model_path = NA,
  use_cmdstanr = FALSE,
  ...
)

Arguments

input_data

Long format data frame

formula

R formula object for latent model component

cureformula

R formula object for cure fraction model component

family_latent

Name of distribution, from "exp", "weibull", "gompertz", "lognormal", "loglogistic", "gengamma". Single string or vector of length number of end-points

prior_latent

Optional

prior_cure

Optional

centre_coefs

Logical

bg_model

User supplied distribution or estimated. In future this will be probabilities or fitted model object.

bg_varname

Background variable name in input_data

bg_hr

Background hazard ratio adjustment

t_max

Maximum time horizon

precompiled_model_path

Path to precompiled model, Default is NA

use_cmdstanr

Logical. If TRUE, use cmdstanr to fit the model. Default is FALSE.

...

Additional parameters to pass to the Stan sampler

Value

Stan output as bmcm class