lyl_ci {lillies} | R Documentation |
Confidence intervals for Life Years Lost.
Description
lyl_ci
estimates confidence intervals for Life Years Lost using non-parametric
bootstrap. The confidence level can be specified when summarizing the results with
the function summary.lyl_ci
.
Usage
lyl_ci(lyl_estimation, niter = 1000)
Arguments
lyl_estimation |
An object of class |
niter |
Number of iterations for the bootstrap (default is 1,000). |
Value
A list with class "lyl_ci"
containing the following components:
LYL
: Data frame with one observation per age and at least 3 variables:age
;life_exp
which is the estimated remaining life expectancy at ageage_specific
years and before agetau
years; and one variable corresponding to the estimated Life Years Lost for each specific cause of death. If only one cause of death is considered (no competing risks), this variable isDead
and includes the total overall Life Years LostLYL_ci
: Data frame with one observation per age-iteration and at least 4 variables:age
;iteration
, which correspond to each specific iteration;life_exp
which is the estimated remaining life expectancy at ageage_specific
years and before agetau
years; and one variable corresponding to the estimated Life Years Lost for each specific cause of death. If only one cause of death is considered (no competing risks), this variable isDead
and includes the total overall Life Years Losttau
: Maximum theoretical age\tau
age_specific
: Specific age at which the Life Years Lost have been estimatedage_begin
: Specific starting age at which the Life Years Lost have been estimatedage_end
: Specific ending age at which the Life Years Lost have been estimateddeath_labels
: Label(s) for death statuscompeting_risks
: Logical value (TRUE
= more than one cause of death (competing risks))type
: Whether the estimation is at"age_specific"
or"age_range"
.niter
: Number of iterations used to estimate the confidence intervals
References
Plana-Ripoll et al. lillies – An R package for the estimation of excess Life Years Lost among patients with a given disease or condition. PLoS ONE. 2020;15(3):e0228073.
See Also
lyl
for estimation of Life Years Lost at one specific age.lyl_range
for estimation of Life Years Lost for a range of different ages.lyl_diff
to compare Life Years Lost for two populations.summary.lyl_ci
to summarize objects obtained with functionlyl_ci
.plot.lyl_ci
to plot objects obtained with functionlyl_ci
.
lyl_range
for estimation of Life Years Lost for a range of different ages.
Examples
# Load simulated data as example
data(simu_data)
# Estimate remaining life expectancy and Life Years
# Lost after age 45 years and before age 95 years
lyl_estimation <- lyl(data = simu_data, t = age_death, status = death,
age_specific = 45, tau = 95)
# Calculate bootstrapped confidence interval (3 iterations to test; more are necessary)
lyl_estimation_ci <- lyl_ci(lyl_estimation, niter = 3)
summary(lyl_estimation_ci)
plot(lyl_estimation_ci)
# Estimate remaining life expectancy and Life Years
# Lost after each age from 0 to 94 years and before age 95 years
lyl_estimation2 <- lyl_range(data = simu_data, t = age_death, status = death,
age_begin = 0, age_end = 94, tau = 95)
# Calculate bootstrapped confidence interval (3 iterations to test; more are necessary)
lyl_estimation_ci2 <- lyl_ci(lyl_estimation2, niter = 3)
summary(lyl_estimation_ci2, weights = simu_data$age_disease)
plot(lyl_estimation_ci2, weights = simu_data$age_disease)