md.sample: md.sample

Description Usage Arguments Examples

View source: R/library.R

Description

Creates information of a covariate that represents a random sample (with replacement) of the provided values. This function call must be added to the md.simparams object.

Usage

1

Arguments

name

name of the covariate

array

vector of elements from which to choose from

weights

vector of probability weights for obtaining the elements of the vector being sampled or NULL if all values have equal probabilities

Examples

1
2
3
4
5
6
7
## Not run: 
library(missDeaths)

sim = md.simparams() +
   md.sample("X", c(0, 1, 2), c(0.2, 0.3, 0.5)) 

## End(Not run)

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