lyl {lillies}R Documentation

Life Years Lost at one specific age.

Description

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.

Usage

lyl(
  data,
  t0 = NULL,
  t,
  status,
  age_specific,
  censoring_label = "Alive",
  death_labels = "Dead",
  tau = 100
)

Arguments

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 (t) and status indicator with death/censoring (status). Note that this package is not developed to be used with tibbles.

t0

Age at start of the follow-up time. Default is NULL, which means all subjects are followed from birth. For delayed entry, t0 indicates age at beginning of follow-up.

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 censoring_label ("Alive" by default).

age_specific

Specific age at which the Life Years Lost have to be estimated.

censoring_label

Label for censoring status. If status is not a factor, "Alive" by default. If status is a factor, the first level will be treated as censoring label.

death_labels

Label for event status. For only one cause of death, "Dead" is the default. For multiple causes, the default are the values given in variable status.

tau

Remaining life expectancy and Life Years Lost are estimated restrictied to a maximum theoretical age \tau (\tau=100 years by default).

Value

A list with class "lyl" containing the following components:

References

See Also

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)

# 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)


[Package lillies version 0.2.12 Index]