Description Usage Arguments Value Examples
View source: R/boot-empirical.R
comp_boot_emp_sample
draws one bootstrap samples
(i.e. sampling observations with replacement) from the input
data
. It returns a list containing the indices of the
m
observations that have been sampled (indices
) and
the bootstrapped dataset (data
).
1 | comp_boot_emp_samples(data, B = 1, m = NULL, replace = TRUE)
|
data |
A tibble or data frame containing the dataset to be sampled from. |
B |
Bootstrap repetitions or number of bootstrap samples to be drawn. |
m |
Number of observations to be sampled with replacement from the original dataset for each bootstrap repetition. |
replace |
TODO: ADD |
A tibble containing the number of bootstrap iteration, the
bootstrap samples (data
),
and the indices of the observations (linked to the original sample) in the
sample (indices
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# Draw B=100 bootstrap samples of size m=5
set.seed(162632)
n <- 100
boot <- comp_boot_emp_samples(
data.frame(
y = stats::rnorm(n, 0, 1),
x = stats::rnorm(n, 0, 1)
),
B = 100,
m = 5
)
# Display the output
print(boot)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.