missDeaths (version 2.7)

md.sex: md.sex

Description

Creates information of a sex covariate that is a special case of Bernoulli covariate specifying 1 for male and 2 for female sex. This function call must be added to the md.simparams object.

Usage

md.sex(name, maleperc = 0.5, asfactor = FALSE)

Arguments

name

name of the covariate

maleperc

percentage of males (value = 1) versus females (value = 2)

asfactor

specifies whether the resulting sex covariate is factorized using as.factor or not

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
library(missDeaths)

sim = md.simparams() +
   md.sex("sex", 0.5)
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace