plot.lyl_ci: Plot evolution of bootstrapped parameters for Life Years Lost

View source: R/lyl_plot.R

plot.lyl_ciR Documentation

Plot evolution of bootstrapped parameters for Life Years Lost

Description

plot for objects of class lyl_ci creates a figure of the bootstrapped Life Years Lost to examine if the number of iterations is enough.

Usage

## S3 method for class 'lyl_ci'
plot(x, level = 0.95, weights, ...)

Arguments

x

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

level

Confidence level (default is 0.95 for 95% confidence intervals)

weights

Vector with age distribution of disease/condition onset to be used when Life Years Lost are estimated over a range of ages (with lyl_range function).

...

Additional arguments affecting the plot produced.

Value

A plot with the evolution of bootstrapped parameters.

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_range for estimation of Life Years Lost for a range of different ages.

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

  • lyl_ci to estimate bootstrapped confidence intervals.

Examples


# 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 = death,
                      age_specific = 45, tau = 95)


# Calculate bootstrapped confidence interval (10 iterations to test)
lyl_estimation_ci <- lyl_ci(lyl_estimation, niter = 10)
plot(lyl_estimation_ci)

# Estimate remaining life expectancy and Life Years
# Lost after each age from 0 to 94 years and before age 95 years
lyl_estimation2 <- lyl_range(data = simu_data, t = age_death, status = death,
                             age_begin = 0, age_end = 94, tau = 95)

# Calculate bootstrapped confidence interval
lyl_estimation_ci2 <- lyl_ci(lyl_estimation2)
plot(lyl_estimation_ci2, weights = simu_data$age_disease)


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

Related to plot.lyl_ci in lillies...