Skip to contents

Sample covariates using bootstrap

Usage

sample_covariates_bootstrap(
  data,
  n_subjects = nrow(data),
  conditional = NULL,
  ...
)

Arguments

data

data.frame (n x p) containing the original, observed, time-invariant covariates (ID should not be included) that will be used to inform the imputation.

n_subjects

number of simulated subjects, default is the number of subjects in the data.

conditional

list with conditional limits for sampled population, e.g. list("WT" = c(40, 60), "BMI" = c(15, 25)).

...

additional arguments passed to mice::mice() function

Value

a data.frame with the simulated covariates, with n_subjects rows and p columns