md.sample {missDeaths} | R Documentation |
md.sample
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
md.sample(name, array, weights=NULL)
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
## Not run:
library(missDeaths)
sim = md.simparams() +
md.sample("X", c(0, 1, 2), c(0.2, 0.3, 0.5))
## End(Not run)
[Package missDeaths version 2.7 Index]