| pridit_boot | R Documentation |
Resamples observations with replacement B times, refitting the full
PRIDIT pipeline on each resample. Returns percentile confidence intervals
for every indicator weight and, optionally, for every observation's score.
pridit_boot(fit, data, B = 500L, conf_level = 0.95, scores = TRUE, seed = NULL)
fit |
A |
data |
The same data frame that was passed to |
B |
Integer. Number of bootstrap replicates. Default 500. |
conf_level |
Numeric in (0, 1). Coverage probability. Default 0.95. |
scores |
Logical. If |
seed |
Optional integer random seed for reproducibility. |
Because PCA sign is arbitrary, each bootstrap replicate's weight vector is aligned to the original fit before aggregation: if the Pearson correlation between the replicate weights and the original weights is negative, the replicate is sign-flipped.
An object of class "pridit_boot", a list with components:
weights_ciData frame with columns indicator,
estimate, lower, upper.
scores_ciData frame with columns id,
estimate, lower, upper (or NULL if
scores = FALSE).
BNumber of replicates used.
conf_levelCoverage probability.
callMatched call.
pridit, autoplot.pridit_boot
dat <- data.frame(
id = letters[1:30],
x1 = runif(30), x2 = runif(30), x3 = runif(30)
)
fit <- pridit(dat)
boot <- pridit_boot(fit, dat, B = 100, seed = 42)
boot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.