md.eval {missDeaths}R Documentation

md.eval

Description

Creates information of a covariate that is calculated (from other covariates) by evaluating a specified formula. This function call must be added to the md.simparams object.

Usage

md.eval(name, eval, center = Inf, invisible = FALSE)

Arguments

name

name of the covariate

eval

string specifying the formula to calculate the covariate

center

expected value of the calculated covariate

invisible

specifies whether the calculated covariate is included in the simulated dataset

Examples


## Not run: 
library(missDeaths)

sim = md.simparams() +
    md.uniform("birth", as.Date("1915-1-1"), as.Date("1930-1-1")) +
      md.uniform("start", as.Date("2000-1-1"), as.Date("2005-1-1")) +
          md.eval("age", "as.numeric(start - birth)/365.2425", 80, FALSE)

## End(Not run)

[Package missDeaths version 2.7 Index]