md.death {missDeaths} | R Documentation |
md.death
Description
Creates information of a time of death variable distributed according to the specified population mortality table and demographic information.
This function call must be added to the md.simparams
object.
Usage
md.death(name, poptable, sexcol, birthcol, startcol)
Arguments
name |
name of the column |
poptable |
population mortality table used to simulate times od death |
sexcol |
name of the column (covariate) specifying birth date |
birthcol |
name of the column (covariate) specifying birth date |
startcol |
name of the column (covariate) specifying the start date from which to calculate time of death |
Examples
## Not run:
library(missDeaths)
sim = md.simparams() +
md.sex("sex", 0.5) +
md.uniform("birth", as.Date("1930-1-1"), as.Date("1970-1-1")) +
md.uniform("start", as.Date("2005-1-1"), as.Date("2010-1-1")) +
md.death("death", survexp.us, "sex", "birth", "start")
## End(Not run)
[Package missDeaths version 2.7 Index]