View source: R/lyl_aggregated_range.R
lyl_aggregated_range | R Documentation |
lyl
estimates differences in remaining life expectancy and Life Years Lost
for two given life tables data
and data0
after a range of specific ages
(age_begin
to age_end
) and restrictied to a maximum theoretical age \tau
.
lyl_aggregated_range(
data,
age,
rates,
surv,
weights,
data0,
age0,
rates0,
surv0,
age_begin,
age_end,
censoring_label = "Alive",
death_labels = "Dead",
tau = 100
)
data |
A dataframe, where each raw represents an age, for the population of interest. The dataframe will contain information on age-specific mortality rates or survivial probability (if both parameters are provided, rates will be used). |
age |
Variable in |
rates |
Variable in |
surv |
Variable in |
weights |
Variable in |
data0 |
A dataframe, where each raw represents an age, for the population of reference The dataframe will contain information on age-specific mortality rates or survivial probability (if both parameters are provided, rates will be used). |
age0 |
Variable in |
rates0 |
Variable in |
surv0 |
Variable in |
age_begin |
Specific starting age at which the Life Years Lost have to be estimated. |
age_end |
Specific ending age at which the Life Years Lost have to be estimated. |
censoring_label |
Label for censoring status ( |
death_labels |
Label for event status ( |
tau |
Remaining life expectancy and Life Years Lost are estimated restrictied to a maximum
theoretical age |
A list with class "lyl_aggregated"
containing the following components:
data
: Name of the dataset preovided in parameter data
data0
: Name of the dataset preovided in parameter data0
LYL
: Data frame with 1 observation and 2 variables: life_exp
and life_exp0
which are the
estimated remaining life expectancies averaged over the age range
and before age tau
years for the population provided in data
and data0
, respectively
tau
: Maximum theoretical age \tau
age_begin
: Specific starting age at which the Life Years Lost have been estimated
age_end
: Specific ending 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
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_aggregated
for estimation of Life Years Lost at one specific age.
summary.lyl_aggregated
to summarize objects obtained with function lyl_aggregated_range
.
# Load simulated data as example
data(aggreg_data)
data(pop_ref)
# Estimate remaining life expectancy and Life Years
# Lost after each age from 40 to 89 years and before age 90 years
lyl_summary_data <- lyl_aggregated_range(data = aggreg_data, age = age,
rates = rate, weights = new_cases,
data0 = pop_ref, age0 = age, surv0 = survival,
age_begin = 40, age_end = 89, tau = 90)
# Summarize the data
summary(lyl_summary_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.