choose_B {MultSurvTests} | R Documentation |
Choose B for permutation tests
Description
Computes the value of B for a permutation test required to obtain a specified accuracy when approximating the permutation p-values using B random permutations.
Usage
choose_B(p0 = 0.05, width = 0.01, conf.level = 0.95)
Arguments
p0 |
A guess for the p-value. Can be based e.g. on a small number of simulations. The default is 0.05. |
width |
The desired width of the Clopper-Pearson interval. The default is 0.01. |
conf.level |
The confidence level of the Clopper-Pearson interval. The default is 0.95. |
Details
Computations are based on the Clopper-Pearson interval, using a formula from Thulin (2014). The procedure is described in Section 3.3 in Persson et al. (2019).
Value
B
References
Persson I, Arnroth L, Thulin M (2019). “Multivariate two sample permutation tests for trials with multiple time to event outcomes.” Pharmaceutical Statistics, 18, 476–485. doi: 10.1002/pst.1938, https://doi.org/10.1002/pst.1938.
Thulin M (2014). “The cost of using exact confidence intervals for a binomial proportion.” Electronic Journal of Statistics, 8(1), 817–840. doi: 10.1214/14-EJS909, https://doi.org/10.1214/14-EJS909.
Examples
# B required to achieve an expected width of 0.02 when
# the p-value is approximately 0.1:
choose_B(p0 = 0.1, width = 0.02)