
Contrast cumulative incidence and time lost to a cause between arms
Source:R/crcontrast.R
sest_cr_contrast.RdFor one cause of a competing-risks outcome, estimate in each arm the
cumulative incidence at times and the time lost to that cause up to tau,
and their differences from a reference arm.
Usage
sest_cr_contrast(
formula,
data,
arm,
cause,
times = NULL,
tau = NULL,
method = c("aalen_johansen", "cause_specific_cox"),
reference = NULL,
interval = NULL,
n_boot = 200L,
seed = 1L,
conf_level = 0.95,
...
)Arguments
- formula
survival::Surv(time, event) ~ arm + covariates, witheventa factor whose first level is censoring. For the Aalen-Johansen method the right-hand side is the arm alone; other variables are refused.- data
A data frame.
- arm
Name of the arm column.
- cause
The level of
eventto contrast.- times
Numeric times for the cumulative-incidence contrast.
- tau
Single horizon for the time lost.
- method
"aalen_johansen"or"cause_specific_cox".- reference
Reference arm level (default: the first level).
- interval
"delta"(Aalen-Johansen only),"bootstrap"or"none". The default is"delta"for Aalen-Johansen and"bootstrap"for the Cox method.- n_boot, seed, conf_level
As for
sest_contrast().- ...
Passed to
survival::coxph()(for exampleties).weights,idandsubsetare refused.
Value
A sest_contrast list as from sest_contrast(), with
estimands "cif" and "time_lost" and an extra element cause.
Details
The cumulative incidence of cause \(k\) is \(F_k(t) = \int_0^t S(u-)\, dA_k(u)\), where \(S\) is the probability of being free of every cause and \(A_k\) the cause-specific cumulative hazard. The time lost to cause \(k\) up to \(\tau\) is \(\int_0^\tau F_k(t)\, dt\) (Andersen 2013): the expected time, within the first \(\tau\), spent after an event of cause \(k\).
method = "aalen_johansen" (unadjusted) computes the Aalen-Johansen
estimator in each arm. Standard errors are the infinitesimal-jackknife
errors that survival::survfit() reports for its multi-state fit (for the
time lost, the standard error of the restricted mean time in the state);
interval = "delta" combines them as for independent arms, so the label
names the normal interval, not the delta method.
method = "cause_specific_cox" (standardised) fits one Cox model per
cause on the right-hand side of formula, predicts every row's cumulative
incidence with arm set to \(a\) (as the product-integral
\(S(t) = \prod (1 - \sum_k dA_k)\)), and averages over the sample.
Intervals come from the seeded bootstrap of sest_contrast().
References
Andersen PK. Decomposition of number of life years lost according to causes of death. Statistics in Medicine 2013; 32(30): 5278-5285. doi:10.1002/sim.5903
See also
sest_contrast(), sest_cuminc().
Other estimands-and-tests:
sest_contrast(),
sest_logrank(),
sest_ph_check(),
sest_pseudo()
Examples
mg <- survival::mgus2
mg$etime <- with(mg, ifelse(pstat == 1, ptime, futime))
mg$event <- factor(ifelse(mg$pstat == 1, "pcm",
ifelse(mg$death == 1, "death", "censor")),
levels = c("censor", "pcm", "death"))
sest_cr_contrast(survival::Surv(etime, event) ~ sex, mg, arm = "sex",
cause = "pcm", times = 120, tau = 240)
#> <sest_contrast> aalen_johansen, unadjusted; interval: delta
#> cause: pcm
#> by arm:
#> estimand time arm estimate se conf_low conf_high
#> cif 120 F 0.07389 0.010770 0.05278 0.09499
#> time_lost 240 F 15.87940 2.090775 11.78156 19.97725
#> cif 120 M 0.05531 0.008644 0.03837 0.07225
#> time_lost 240 M 12.77632 1.701043 9.44234 16.11030
#>
#> contrasts against the reference arm:
#> estimand time arm reference estimate se conf_low conf_high
#> cif 120 M F -0.01858 0.01381 -0.04564 0.008491
#> time_lost 240 M F -3.10308 2.69535 -8.38586 2.179698