Skip to contents

Computes the unconditional rejection probability (local size) of the fully randomised UMPU Fisher exact test at nuisance parameter \(p_0\), where \(p_1 = p_0 / (p_0 + \theta_0 (1 - p_0))\). Unlike local_size_modified(), which applies a \(\gamma_0\) threshold and returns 0 or 1 at the boundary, this function uses \(\gamma_1\) and \(\gamma_2\) directly as rejection probabilities, reflecting the true expected size of the randomised test.

Usage

local_size_randomised(nuisance, .m, .n, .df, .odds_ratio, .alpha, .precision)

Arguments

nuisance

The nuisance parameter \(p_0\): success probability in group 1 under \(H_0\). Must be in \([0, 1]\).

.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\).

.odds_ratio

The null hypothesis odds ratio \(\theta_0\). No default.

.alpha

Nominal significance level \(\alpha\). No default.

.precision

Numerical precision. No default.

Value

A single numeric value: the local size of the randomised UMPU Fisher exact test at the given nuisance parameter, in \([0, 1]\).

Examples

df <- construct_test_frame(.odds_ratio = 1, .m = 6, .n = 4,
                           .alpha = 0.05, .precision = 1e-3)
local_size_randomised(nuisance = 0.5, .m = 6, .n = 4, .df = df,
                      .odds_ratio = 1, .alpha = 0.05, .precision = 1e-3)
#> [1] 0.05