plot.lyl_aggregated | R Documentation |
plot
for objects of class lyl_aggregated
creates a figure of Life Years Lost
at one specific age for two different populations.
## S3 method for class 'lyl_aggregated'
plot(
x,
color_alive = NA,
colors = NA,
labels = c("Population of interest", "Reference population"),
...
)
x |
An object of class |
color_alive |
Color to be used for the censoring category. Default is NA, and default color is "white". |
colors |
Vector with one color for each cause of death. Default is NA, and default colors are used. |
labels |
Vector with labels for the two populations (default are "Population of
interest" for |
... |
Additional arguments affecting the plot produced. |
A plot with survival function and stacked cause-specific cumulative incidences for two populations side by side.
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_aggregated
for estimation of Life Years Lost at one specific age.
# Load simulated data as example
data(aggreg_data)
data(pop_ref)
# Estimate remaining life expectancy and Life Years
# Lost after age 70 years and before age 90 years
lyl_summary_data70 <- lyl_aggregated(data = aggreg_data, age = age, rates = rate,
data0 = pop_ref, age0 = age, surv0 = survival,
age_specific = 70, tau = 90)
# Plot the data
plot(lyl_summary_data70)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.