plot.lyl_aggregated: Plot Life Years Lost at one specific age for two different...

View source: R/lyl_plot.R

plot.lyl_aggregatedR Documentation

Plot Life Years Lost at one specific age for two different populations obtained from aggregated data

Description

plot for objects of class lyl_aggregated creates a figure of Life Years Lost at one specific age for two different populations.

Usage

## S3 method for class 'lyl_aggregated'
plot(
  x,
  color_alive = NA,
  colors = NA,
  labels = c("Population of interest", "Reference population"),
  ...
)

Arguments

x

An object of class lyl_aggregated (obtained with function lyl_aggregated).

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 data, and "Reference population" for data0; which are provided to function lyl_aggregated.)

...

Additional arguments affecting the plot produced.

Value

A plot with survival function and stacked cause-specific cumulative incidences for two populations side by side.

References

  • 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.

See Also

  • lyl_aggregated for estimation of Life Years Lost at one specific age.

Examples

# 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)


lillies documentation built on Aug. 7, 2023, 5:09 p.m.