Computes the unconditional power of the fully randomised UMPU Fisher exact test at response rates \((\pi_1, \pi_2)\). Uses \(\gamma_1\) and \(\gamma_2\) from the test frame directly as rejection probabilities at the boundary, rather than applying a \(\gamma_0\) threshold. The test frame should be built for the relevant null odds ratio.
Arguments
- p
Length-2 numeric vector \((\pi_1, \pi_2)\): success probability in group 1 (\(\pi_1\)) and group 2 (\(\pi_2\)) at which power is evaluated.
- .m
Number of trials in group 1.
- .n
Number of trials in group 2.
- .df
Test frame (data frame) generated by
construct_test_frame(), containing critical values \(c_1\), \(c_2\) and randomisation probabilities \(\gamma_1\), \(\gamma_2\) for every possible total \(T\).- .alpha
Nominal significance level \(\alpha\). No default.
- .precision
Numerical precision. No default.
- .superiority
Logical. If
TRUE, power is computed only over tables where the observed rate in group 2 exceeds that in group 1. Defaults toFALSE.
Value
A single numeric value: the power of the randomised UMPU Fisher exact test at the response rates \((\pi_1, \pi_2)\), in \([0, 1]\).
See also
Other power:
power_asymptotic(),
power_conservative(),
power_modified(),
power_probability()
Examples
df <- construct_test_frame(.odds_ratio = 1, .m = 6, .n = 4,
.alpha = 0.05, .precision = 1e-3)
power_randomised(p = c(0.2, 0.6), .m = 6, .n = 4, .df = df,
.alpha = 0.05, .precision = 1e-3)
#> [1] 0.1947171
