lyl | R Documentation |
lyl
estimates remaining life expectancy and Life Years Lost for a given population
after a specific age age_speficic
and restrictied to a maximum theoretical age \tau
.
lyl(
data,
t0 = NULL,
t,
status,
age_specific,
censoring_label = "Alive",
death_labels = "Dead",
tau = 100
)
data |
A dataframe, where each raw represents a person. The dataframe will
have a time-to-event format with at least two variables: age at end of follow-up ( |
t0 |
Age at start of the follow-up time. Default is |
t |
Age at the end of the follow-up time (death or censoring). |
status |
Status indicator, normally 0=alive, 1=dead. Other choices are
TRUE/FALSE (TRUE = death) or 1/2 (2=death). For multiple causes of death (competing risks
analysis), the status variable will be a factor, whose first level is treated as censoring; or
a numeric variable, whose lowest level is treated as censoring. In the latter case,
the label for censoring is |
age_specific |
Specific age at which the Life Years Lost have to be estimated. |
censoring_label |
Label for censoring status. If |
death_labels |
Label for event status. For only one cause of death, |
tau |
Remaining life expectancy and Life Years Lost are estimated restrictied to a maximum
theoretical age |
A list with class "lyl"
containing the following components:
data
: Data frame with 3 variables and as many observations as the original
data provided to estimate Life Years Lost: t0
, t
, and status
LYL
: Data frame with 1 observation and at least 3 variables: age
which corresponds
to age_spefific
; life_exp
which is the estimated remaining life expectancy at age age_specific
years
and before age tau
years; and one variable corresponding to the estimated Life Years Lost for each specific
cause of death. If only one cause of death is considered (no competing risks), this variable is Dead
and includes
the total overall Life Years Lost
tau
: Maximum theoretical age \tau
age_specific
: Specific age at which the Life Years Lost have been estimated
data_plot
: A data frame in long format with 3 variables time
, cause
, and cip
used
to create a Figure of Life Years Lost with function plot
.
censoring_label
: Label for censoring status
death_labels
: Label(s) for death status
competing_risks
: Logical value (TRUE
= more than one cause of death (competing risks))
type
: Whether the estimation is at "age_specific"
or "age_range"
.
Andersen PK. Life years lost among patients with a given disease. Statistics in Medicine. 2017;36(22):3573- 3582.
Andersen PK. Decomposition of number of life years lost according to causes of death. Statistics in Medicine. 2013;32(30):5278-5285.
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_range
for estimation of Life Years Lost for a range of different ages.
lyl_ci
to estimate bootstrapped confidence intervals.
lyl_diff
to compare Life Years Lost for two populations.
summary.lyl
to summarize objects obtained with function lyl
.
plot.lyl
to plot objects obtained with function lyl
.
# 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)
# Summarize and plot the data
summary(lyl_estimation)
plot(lyl_estimation)
# Estimate remaining life expectancy and Life Years
# Lost due to specific causes of death after age 45
# years and before age 95 years
lyl_estimation2 <- lyl(data = simu_data, t = age_death, status = cause_death,
age_specific = 45, tau = 95)
# Summarize and plot the data
summary(lyl_estimation2)
plot(lyl_estimation2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.