By working with relatively small sub-populations, I encountered the issue of assessing the uncertainty around their life expectancy. In other words, I faced the issue of constructing confidence intervals around life expectancy. Chiang (1984) already proposed a solution based on the binomial assumptions for the probability of dying within the life table. Andreev and Shkolnikov (2010) presented a spreadsheet for calculation of confidence limits for any life table.
Mimicking this last work, my contribution is to provide a simple R routine for building confidence intervals for life expectancy using bootstrapping life table deaths based on the binomial assumptions. As by product, you could also find an R function for constructing a life table from a series of deaths and exposures.
Two codes and three datasets for testing the method are provided:
- LifeTableFUN.R : a collection of functions useful to building any life table and for constructing confidence interval for life expectancy at any user-defined level of confidence, number of simulated life table, age and sex.
- ConfidenceIntervalLifeExpectancy.R : a code running the previous routines on 3 different datasets which are provided below.
- ExampleLT.csv , ExampleLT2.txt and ExampleLT3.txt : three datasets which could be used for testing the approach.
As always, I commented these files as much as possible and I used simple data, but if something is not clear please let me know.