Simulate Competing Risks Data
Arguments
- n
Sample size.
- pars
List of parameter vectors, one per cause, each a named vector with `b`, `c`, `k` and optionally `a`. Defaults to two causes.
- gammas
Numeric vector of accelerated failure time coefficients, one per cause, acting on a single binary covariate. `NULL` for no covariate.
- censor_rate
Approximate proportion of right-censored observations.
- seed
Optional integer seed.
Value
A data frame with `time`, `cause` (0 for censored) and, when `gammas` is supplied, the covariate `x`.
Examples
d <- simulate_bd_competing_data(200, seed = 1)
table(d$cause)
#>
#> 0 1 2
#> 55 45 100