Skip to contents

Computes the cumulative incidence of one cause from a fitted Beta-Danish competing risks model, \(F_j(t) = \int_0^t f_j(u)\prod_{l \neq j} S_l(u)\,du\).

Usage

cif_betadanish(fit, tvec, cause_idx, x = NULL)

Arguments

fit

An object of class `"bd_competing"`.

tvec

Numeric vector of times at which to evaluate the CIF.

cause_idx

The cause to evaluate, matching one of the fitted causes.

x

Optional covariate values at which to evaluate, one per covariate in the fit. Defaults to zero for every covariate, which is the reference subject. Ignored when the model has no covariates.

Value

A numeric vector of probabilities the same length as `tvec`.

Details

The integrand is the cause-specific density multiplied by the survival of every other cause, so the sum of all cause CIFs approaches the overall failure probability rather than one, and each individual CIF is bounded by it.

Any covariate effect is folded into the scale parameter before integration, since accelerating time by \(\lambda\) is equivalent to dividing \(k\) by \(\lambda\).

See also

[fit_bd_competing()], [cif_compare()]

Examples

# \donttest{
d <- simulate_bd_competing_data(120, seed = 2)
fit <- fit_bd_competing(d$time, d$cause, submodel = TRUE, n_starts = 1)
cif_betadanish(fit, tvec = c(1, 5, 10), cause_idx = 1)
#> [1] 0.005387727 0.091747265 0.205950398
# }