md.death: md.death

Description Usage Arguments Examples

View source: R/library.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)

missDeaths documentation built on Oct. 23, 2020, 6:39 p.m.