lyl_ci: Confidence intervals for Life Years Lost.

View source: R/lyl_ci.R

lyl_ciR 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 lyl or lyl_range.

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 age age_specific years and before age tau 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 is Dead and includes the total overall Life Years Lost

  • LYL_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 age age_specific years and before age tau 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 is Dead and includes the total overall Life Years Lost

  • tau: Maximum theoretical age \tau

  • age_specific: Specific age at which the Life Years Lost have been estimated

  • age_begin: Specific starting age at which the Life Years Lost have been estimated

  • age_end: Specific ending age at which the Life Years Lost have been estimated

  • death_labels: Label(s) for death status

  • competing_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 function lyl_ci.

  • plot.lyl_ci to plot objects obtained with function lyl_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)


lillies documentation built on Aug. 7, 2023, 5:09 p.m.

Related to lyl_ci in lillies...