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

Description Usage Arguments Value References See Also Examples

View source: R/lyl_plot.R

Description

lyl_2plot was used to create a figure of Life Years Lost at one specific age for two different populations. Please use lyl_compare_plot instead.

Usage

1
2
3
4
5
6
7
8
lyl_2plot(
  x,
  y,
  color_alive = NA,
  colors = NA,
  labels = c("Population of interest", "Reference population"),
  ...
)

Arguments

x

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

y

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

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 x, and "Reference population" for y)

...

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Load simulated data as example
data(simu_data)

# Estimate remaining life expectancy and Life Years
# Lost after age 45 years and before age 95 years
lyl_estimation <- lyl(data = simu_data, t = age_death, status = cause_death,
                      age_specific = 45, tau = 95)

# Same estimate for those with a specific disease
diseased <- simu_data[!is.na(simu_data$age_disease), ]

lyl_estimation1 <- lyl(data = diseased, t0 = age_disease,
                       t = age_death, status = cause_death,
                      age_specific = 45, tau = 95)

# Plot the data
lyl_compare_plot(list(lyl_estimation1, lyl_estimation))

lillies documentation built on Feb. 17, 2021, 1:07 a.m.

Related to lyl_2plot in lillies...