This function takes a bbi_nmboot_model (created by a previous
new_bootstrap_run() call) and creates n new model objects and re-sampled
datasets in a subdirectory. The control stream found at
get_model_path(.boot_run) is used as the "template" for these new model
objects, and the new datasets are sampled from the dataset defined in its
$DATA record (i.e. get_data_path(.boot_run)).
Usage
setup_bootstrap_run(
.boot_run,
n = 200,
strat_cols = NULL,
seed = 1234,
data = NULL,
.bbi_args = list(no_grd_file = TRUE, no_shk_file = TRUE),
.overwrite = FALSE
)Arguments
- .boot_run
A
bbi_nmboot_modelobject.- n
Number of data sets and model runs to generate.
- strat_cols
Columns to maintain proportion for stratification
- seed
A numeric seed to set prior to resampling the data; use
NULLto avoid setting a seed.- data
A dataset to resample from. Defaults to
NULL, which will use the filtered output fromnm_data(.boot_run, filter = TRUE). If provided, must include the same column names as what's returned fromnm_data(.mod).- .bbi_args
Named list passed to
model_summary(orig_mod, .bbi_args), whereorig_modis the model.boot_runis based on. Seeprint_bbi_args()for valid options. Defaults tolist(no_grd_file = TRUE, no_shk_file = TRUE)becausemodel_summary()is only called internally to extract the number of records, so those files are irrelevant. Only used if the based on model (the model being bootstrapped) has been executed.- .overwrite
Logical (T/F) indicating whether or not to overwrite existing setup for a bootstrap run.
Details
Once you have run this function, you can execute your bootstrap with
submit_model(). You can use get_model_status() to check on your submitted
bootstrap run. Once all models have finished, use summarize_bootstrap_run()
to view the results. See examples below.
Examples
if (FALSE) { # \dontrun{
# Setup
.boot_run <- new_bootstrap_run(.mod)
.boot_run <- setup_bootstrap_run(
.boot_run,
n = 1000,
seed = 1234,
strat_cols = c("STUDY", "ETN")
)
# Submit
submit_model(.boot_run)
# Check status of runs during submission
get_model_status(.boot_run)
# Summarize results, once all runs have finished
if (check_nonmem_finished(.boot_run)) {
.boot_sum <- summarize_bootstrap_run(.boot_run)
}
} # }
