# NOT RUN {
# 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)
lyl_estimation_ci <- lyl_ci(lyl_estimation, niter = 3)
summary(lyl_estimation_ci)
# }
# NOT RUN {
# 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
lyl_estimation_ci2 <- lyl_ci(lyl_estimation2)
summary(lyl_estimation_ci2, weights = simu_data$age_disease)
# }
Run the code above in your browser using DataCamp Workspace