choose_B: Choose B for permutation tests

Description Usage Arguments Details Value References Examples

View source: R/choose_B.R

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

1
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

\insertRef

persson19MultSurvTests

\insertRef

thulin14MultSurvTests

Examples

1
2
3
# 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)

MultSurvTests documentation built on June 18, 2021, 9:07 a.m.