Tests \(\mathrm{H_0\colon AUC} = 0.5\) vs \(\mathrm{H_1\colon AUC} \neq 0.5\) with proper finite-sample corrections
wmw_pvalue(x, y, alternative = "two.sided")p-value
Numeric vector of cases/group 1 values
Numeric vector of controls/reference group values
character: "two.sided", "greater", or "less"
Implements the Bias-Corrected (BC) variance estimator with second-order U-statistic correction to provide honest p-values under \(\mathrm{H_0\colon AUC} = 0.5\). Uses three-tier approach: permutation \((n < 20)\), bias-corrected \((20 \le n < 50)\), asymptotic with correction \(n \ge 50\).
For medium samples, the naive variance estimators \(\widehat{\mathrm{Var}}(G(X))\) and \(\widehat{\mathrm{Var}}(F(Y))\) are corrected by subtracting O(1/n) bias terms of the form \((n_1 n_2)^{-1} \sum_i \hat{G}(X_i)(1 - \hat{G}(X_i))\) to prevent variance underestimation that would inflate Type I error rates.
Function assumes \(x\) represents cases and \(y\) represents the reference level,
in accord with wilcox.test() and wmw_test().
Internal calculations convert to P(X < Y) framework to match theoretical derivations.