# NOT RUN {
# Load simulated data as example
data(simu_data)
# }
# NOT RUN {
# Estimate remaining life expectancy and Life Years
# Lost after each age from 0 to 94 years and before age 95 years
lyl_estimation <- lyl_range(data = simu_data, t = age_death, status = death,
age_begin = 0, age_end = 94, tau = 95)
# Visualize data at each different specific age
summary(lyl_estimation)
plot(lyl_estimation)
# Summarize data over an age distribution
summary(lyl_estimation, weights = simu_data$age_disease)
# 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 = simu_data, t = age_death, status = cause_death,
age_begin = 0, age_end = 94, tau = 95)
# Visualize data at each different specific age
summary(lyl_estimation2)
plot(lyl_estimation2)
# Summarize data over an age distribution
summary(lyl_estimation2, weights = simu_data$age_disease)
# }
Run the code above in your browser using DataCamp Workspace