lyl_diff_ref {lillies} | R Documentation |
Summarize differences in Life Years Lost.
Description
lyl_diff
summarizes differences in estimated Life Years Lost
in two different populations: lyl_estimation1
compared to a life table provided in data_ref
.
Usage
lyl_diff_ref(
lyl_population1,
data_ref,
age,
surv,
rates,
decimals = 2,
level = 0.95,
weights = NA,
lyl_population0
)
Arguments
lyl_population1 |
Population of interest: An object of class |
data_ref |
A dataframe, where each raw represents an age, for the population of reference The dataframe will contain information on age-specific mortality rates or survivial probability (if both parameters are provided, rates will be used). |
age |
Variable in |
surv |
Variable in |
rates |
Variable in |
decimals |
Number of decimals to be reported (default is 2). |
level |
Confidence level if |
weights |
Vector with age distribution of disease/condition onset to be used when Life Years Lost are estimated
over a range of ages (with |
lyl_population0 |
Parameter automatically created. |
Value
A table with the summary of the differences between two populations.
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.
Examples
# Load simulated data as example
data(simu_data)
data(pop_ref)
# Estimate remaining life expectancy and Life Years
# Lost due to specific causes of death after age 45
# years and before age 95 years for those with a disease
diseased <- simu_data[!is.na(simu_data$age_disease), ]
lyl_estimation1 <- lyl(data = diseased, t0 = age_disease,
t = age_death, status = cause_death,
age_specific = 45, tau = 95)
lyl_diff_ref(lyl_estimation1, pop_ref, age = age, surv = survival)
lyl_diff_ref(lyl_estimation1, pop_ref, age = age, rates = mortality_rates)
# Calculate bootstrapped confidence interval (3 iterations to test; more are necessary)
lyl_estimation1_ci <- lyl_ci(lyl_estimation1, niter = 3)
lyl_diff_ref(lyl_estimation1_ci, pop_ref, age = age, surv = survival)
# Estimate remaining life expectancy and Life Years
# Lost due to specific causes of death after each age
# from 0 to 94 years and before age 95 years
lyl_estimation2 <- lyl_range(data = diseased, t0 = age_disease,
t = age_death, status = cause_death,
age_begin = 0, age_end = 94, tau = 95)
lyl_diff_ref(lyl_estimation2, pop_ref, age = age, surv = survival)
lyl_diff_ref(lyl_estimation2, pop_ref, age = age, surv = survival, weights = diseased$age_disease)