# NOT RUN {
# Load simulated data as example
data(simu_data)
# }
# NOT RUN {
# Estimate remaining life expectancy and Life Years
# Lost due to specific causes of death after each age
# from 30 to 40 years and before age 95 years
lyl_estimation <- lyl_range(data = simu_data, t = age_death, status = cause_death,
age_begin = 30, age_end = 40, tau = 95)
# Summarize and plot the data
plot(lyl_estimation)
plot(lyl_estimation, colors = c("chocolate", "cornflowerblue"))
# The plot can be modified with a usual ggplot2 format
plot(lyl_estimation) +
ggplot2::xlab("Age [in years]") +
ggplot2::ggtitle("Life Years Lost at ages 30-40 years")
# }
Run the code above in your browser using DataCamp Workspace