View source: R/bootstrap_calculations_helpers.R
| bootstrap_ystar | R Documentation |
Returns the B \times N integer count matrix consumed by the
infinitesimal-jackknife variance estimator in get_dfRes.
Entry (b, j) is the number of times row j of df was
selected on bootstrap iteration b.
bootstrap_ystar(df, nb_boots, seed = 8316951L)
df |
Data frame. Counts are computed by positional row index;
|
nb_boots |
Integer. Number of bootstrap samples. |
seed |
Integer or |
Integer matrix with nb_boots rows and nrow(df)
columns.
This function previously generated the count matrix via a parallel
foreach pass, with counts derived by matching against a
user-supplied id column. It now runs on the main process and
counts by positional row index via tabulate,
matching how bootstrap_results constructs bootstrap data
(df[in_boot, ]). For data with unique subject ids (the standard
clinical-trial case) the two implementations are equivalent. The new
implementation is also robust to non-unique id values.
Bootstrap indices generated by this version are not bit-identical to those produced by v0.1.x for the same seed (the generator now uses the main-process Mersenne-Twister stream rather than per-task L'Ecuyer streams). Statistical properties of bootstrap summaries are preserved.
## Not run:
df <- data.frame(id = 1:50, tte = rexp(50), event = rbinom(50, 1, 0.6),
treat = rep(0:1, 25))
ystar <- bootstrap_ystar(df, nb_boots = 10)
dim(ystar) # 10 x 50
rowSums(ystar) # all equal to 50
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.