Lifespan {VirtualPop} | R Documentation |
Generates Individual Lifespan(s)
Description
Uses age-specific death rates to simulate length of life. The function generates age(s) at death and date(s) of death. The function uses the function rpexp() of the msm package and uniroot() of base R
Usage
Lifespan(data, ASDR, mort = NULL)
Arguments
data |
Data frame with individual data. If the object "data" includes date of birth (bdated; decimal date), then the date of death is computed. |
ASDR |
Age-specific death rates |
mort |
Presence or absence of mortality. This parameter is optional. Default is TRUE. If mortality is (should be) absent, mort=FALSE. |
Value
LS |
Data frame with age(s) at death and date(s) of death |
Examples
utils::data(dLH,package="VirtualPop")
utils::data(rates,package="VirtualPop")
d <- VirtualPop::Lifespan (dLH[1:5,1:5],ASDR=rates$ASDR)
[Package VirtualPop version 2.0.2 Index]