CreateBootstrapSamples: Create bootstrap samples

Description Usage Arguments

View source: R/CreateBootstrapSamples.R

Description

Creates bootstrap samples and save them to disk, to use in functions that rely on bootstraping to estimate uncertainty intervals or to come up with other estimators, for example a linear shrinkage factor.

Usage

1
2
3
4
CreateBootstrapSamples(study.sample, random.seed.already.set = FALSE,
  random.seed = NULL, number.of.bootstrap.samples = 1000,
  strata = NULL, create.as.list = TRUE, return.samples = FALSE,
  save.to.disk = TRUE)

Arguments

study.sample

Data frame. The study sample. No default.

random.seed.already.set

Logical vector of length 1. If TRUE random.seed does not need to be set within this function as it indicates that this has been done (which is good practice) earlier in the code. Defaults to FALSE.

random.seed

Numeric vector of length 1. Has to be an integer. The seed to use for random number generation. Only used if random.seed.already.set is FALSE. Defaults to NULL.

number.of.bootstrap.samples

Numeric vector of length 1. Has to be a positive integer. The number of bootstrap samples to create. Only used it bootstrap.confidence.interval is TRUE. Defaults to 1000.

strata

Character vector of length 1 or NULL. The name of the variable on which to stratify the bootstrap, i.e. do the bootstrap separately in each level of the strata variable and then combine the results. If NULL the bootstrap is not stratified. Defaults to NULL.

create.as.list

Logical vector of length 1. If TRUE the bootstrap samples are returned or saved as a list. If FALSE the samples are returned as a data.frame. Defaults to TRUE.

return.samples

Logical vector of length 1. If TRUE, the function returns bootstrap.samples to parent enviroment. Defaults to FALSE.

save.to.disk

Logical vector of length 1. If TRUE, bootstrap.samples are saved to disk in RDS format. Defaults to TRUE.


martingerdin/bengaltiger documentation built on Feb. 29, 2020, 4:46 p.m.