Lifetable {popstudy} | R Documentation |
Life Table
Description
Estimates a lifetable from mortality rates and population data.
Usage
Lifetable(
rates,
pops,
sex,
max_age = NULL,
first_year,
threshold,
jump,
element = c("mx", "qx", "lx", "dx", "Lx", "Tx", "ex", "rx"),
...
)
Arguments
rates |
character. A character string that specifies mortality data path. The dataset is a .txt file like |
pops |
character. A character string that specifies population data path. The dataset is a .txt file like |
sex |
character. "female" or "male". |
max_age |
numeric. Desire omega age. If |
first_year |
numeric. First year to start estimation. |
threshold |
numeric. Maximum forecast year. |
jump |
character. Same purpose to |
element |
character. Wanted estimation element, one of "mx", "qx", "lx", "dx", "Lx", "Tx", "ex" or "rx". |
... |
additional arguments to be passed to |
Value
Lifetable
function returns a list with both data frames, wide and long format, for specified element in argument element
for desire years.
Author(s)
Cesar Gamboa-Sanabria
References
Wunsch G, Mouchart M, DuchĂȘne J (2002). The Life Table: Modelling Survival and Death, European Studies of Population. Springer Netherlands. ISBN 9781402006388, https://books.google.co.cr/books?id=ySex55d4nlsC.
Examples
## Not run:
write.table(CR_mortality_rates_2010_2015,
file = "CR_mortality_rates_2010_2015.txt",
sep = "\t", row.names = FALSE, quote = FALSE)
write.table(CR_populations_1950_2015,
file = "CR_populations_1950_2015.txt",
sep = "\t", row.names = FALSE, quote = FALSE)
Lifetable("CR_mortality_rates_2010_2015.txt", "CR_populations_1950_2015.txt",
sex="female", first_year=2011, threshold=2150, jump="actual", max_age = 100,
element="ex", label="CR")
## End(Not run)