lyl_checkplot | R Documentation |
Given a lyl_range
-class object, lyl_checkplot
draws numbers of persons at risk of
dying at each specific age from age_begin
until age \tau
.
lyl_checkplot(x)
x |
An object of class |
A plot with the number of persons at risk at each specific age.
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.
lyl_range
for estimation of Life Years Lost for a range of different ages.
# Load simulated data as example
data(simu_data)
# 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 = 45, age_end = 50, tau = 95)
# Check whether small numbers could compromise the results
lyl_checkplot(lyl_estimation)
# The plot can be modified with a usual ggplot2 format
lyl_checkplot(lyl_estimation) +
ggplot2::geom_hline(yintercept = 10, linetype = "dashed", color = "red") +
ggplot2::xlab("Age [in years]") +
ggplot2::ggtitle("Persons at risk of dying at each age 0-94 years")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.