Computes the unconditional rejection probability (local size) of the MFET at
nuisance parameter \(p_0\), where \(p_1 = p_0 / (p_0 + \theta_0 (1 -
p_0))\). Called repeatedly by size_modified() during numerical
optimisation over \(p_0\) to find the maximum size. Computed as the
bilinear form \(p_u^\top R \, p_v\), where \(R\) is the rejection matrix
from .build_rejection_matrix() and \(p_u\), \(p_v\) are the
binomial probability vectors of the two groups.
Usage
local_size_modified(
nuisance,
.gamma0,
.odds_ratio,
.m,
.n,
.df,
.alpha,
.precision,
.rejection_matrix = NULL
)Arguments
- nuisance
The nuisance parameter \(p_0\): success probability in group 1 under \(H_0\). Must be in \([0, 1]\).
- .gamma0
The \(\gamma_0\) threshold: boundary values in the test frame are rejected only when their randomisation probability exceeds this value. Typically the output of
optimise_gamma0().- .odds_ratio
The null hypothesis odds ratio \(\theta_0\). No default.
- .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.
- .rejection_matrix
Optional prebuilt rejection matrix from
.build_rejection_matrix(). Defaults toNULL, in which case the matrix is built internally from.dfand.gamma0. Supply a prebuilt matrix when calling repeatedly with the same test frame and \(\gamma_0\) (assize_modified()does across its zoom grid) to avoid rebuilding it on every call. If supplied, it must correspond to the same.dfand.gamma0passed alongside it; this is not checked.
Value
A single numeric value: the local size (unconditional rejection probability) of the MFET at the given nuisance parameter, in \([0, 1]\).
See also
local_size_asymptotic(), local_size_probability(), local_size_randomised() for the local size under alternative tests at the same nuisance parameter value; size_modified() for the modified local size maximised over the nuisance parameter; power_modified() for the power of the modified Fisher exact test; modified_fisher_exact_test() for the main user-facing function.
Other size:
local_size_asymptotic(),
local_size_probability(),
local_size_randomised(),
size_modified()
Other modified:
construct_test_frame(),
modified_fisher_exact_test(),
optimise_gamma0(),
power_modified(),
size_modified()
Examples
df <- construct_test_frame(.odds_ratio = 1, .m = 6, .n = 4,
.alpha = 0.05, .precision = 1e-3)
# Local size at nuisance parameter p0 = 0.5, with gamma0 = 0.05:
local_size_modified(nuisance = 0.5, .gamma0 = 0.05, .odds_ratio = 1,
.m = 6, .n = 4, .df = df, .alpha = 0.05, .precision = 1e-3)
#> [1] 0.1777344
