Bootstrap confidence interval for the reproducibility index
Source:R/reproducibility_index.R
ri_confidence_interval.RdEstimates uncertainty in the RI by resampling the perturbation iterations
already stored in a reprostat object (no additional model fitting).
Arguments
- diag_obj
A
reprostatobject fromrun_diagnostics.- level
Confidence level, e.g.
0.95for a 95% interval. Default is0.95.- R
Number of bootstrap resamples of the perturbation draws. Default is
1000. Values of 300–500 are sufficient for most uses.- seed
Integer random seed passed to
set.seed, orNULL(default) to leave the global RNG state undisturbed. Pass an integer for fully reproducible intervals.
Value
A named numeric vector of length 2 giving the lower and upper quantile bounds of the RI bootstrap distribution.
Examples
set.seed(1)
d <- run_diagnostics(mpg ~ wt + hp, data = mtcars, B = 50)
ri_confidence_interval(d, R = 200, seed = 1)
#> 2.5% 97.5%
#> 95.75155 98.61878