summary.lyl_ci: Summarize Life Years Lost with confidence intervals

Description Usage Arguments Value References See Also Examples

View source: R/lyl_summary.R

Description

summary for objects of class lyl_ci summarizes Life Years Lost at one specific age or over a range of different ages, including bootstrapped confidence intervals

Usage

1
2
3
4
5
6
7
8
9
## S3 method for class 'lyl_ci'
summary(
  object,
  decimals = 2,
  level = 0.95,
  weights = NA,
  difference = FALSE,
  ...
)

Arguments

object

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

decimals

Number of decimals to be reported (default is 2).

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). If weights are not provided (dafault is weights = NA), then the differences in Life Years Lost at each age is provided. If weights are provided, then a weighted average is provided.

difference

Parameter automatically created by the package.

...

Additional arguments affecting the summary produced.

Value

A table with the summary of the results.

References

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# 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 (3 iterations to test)
lyl_estimation_ci <- lyl_ci(lyl_estimation, niter = 3)
summary(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)
summary(lyl_estimation_ci2, weights = simu_data$age_disease)

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