Skip to contents

Convenience wrapper that builds a recipe list for proportional-hazard (PH) models, parallel to recipe_quick_aft for AFT models. The returned recipe is validated and ready for simulate_from_recipe.

Usage

recipe_quick_ph(
  n,
  model = c("ph_exponential", "ph_weibull", "ph_gompertz", "cox_pwexp"),
  baseline,
  treat_effect,
  covariates = list(),
  target_censoring = 0.25,
  allocation = "1:1",
  seed = NULL
)

Arguments

n

Total sample size (integer).

model

PH model. One of "ph_exponential", "ph_weibull", "ph_gompertz", "cox_pwexp".

baseline

Named list of baseline hazard parameters:

ph_exponential

list(rate = ...)

ph_weibull

list(shape = ..., scale = ...)

ph_gompertz

list(shape = ..., rate = ...)

cox_pwexp

list(rates = c(...), cuts = c(...))

treat_effect

Numeric log-hazard ratio for the treatment arm.

covariates

List of covariate definitions. Use covar_continuous, covar_binary, or covar_categorical. Default list().

target_censoring

Target overall censoring fraction (0–1). Default 0.25.

allocation

Treatment allocation ratio string, e.g. "1:1" (default) or "1:2".

seed

Optional integer seed.

Value

A recipe list suitable for simulate_from_recipe.

Examples

r <- recipe_quick_ph(100, "ph_weibull",
       baseline = list(shape = 1.5, scale = 10),
       treat_effect = -0.5,
       covariates = list(covar_continuous("age")),
       target_censoring = 0.30)
dat <- simulate_from_recipe(r, seed = 1)