plot.lyl_aggregated {lillies}R 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

See Also

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)


[Package lillies version 0.2.12 Index]