Sample covariates using a variety of methods
sample_covariates.RdCategorical covariates: all covariate sampling methods (except multi-variate
normal) support sampling of categorical covariates as well as continuous.
In the mice sampling method, the categorical covariates have to be
provided specifically as a vector of character indicating the column names.
If not provided, they will otherwise be treated as continuous variables and
non-integer values may be sampled.
Usage
sample_covariates(
method = c("mvtnorm", "mice", "bootstrap", "nhanes"),
seed = NULL,
...
)Arguments
- method
sampling method, one of
mvtnorm,bootstrap,mice, ornhanes. E.g.list(AGE = c(60, 80), WT = c(70, 100)).- seed
integer random seed passed to
set.seed()for reproducibility. DefaultNULLdoes not set a seed.- ...
arguments passed to lower-level function(s).