Tests \(\mathrm{H_0\colon AUC} = 0.5\) vs \(\mathrm{H_1\colon AUC} \neq 0.5\) with exact finite-sample unbiased variance estimation for arbitrary tie patterns
wmw_pvalue_ties(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 Exact finite-sample Unbiased (EU) variance estimator derived from Hoeffding decomposition theory. Uses tie-corrected kernel \(h(x,y) = \mathbf{1}\{x < y\} + \frac{1}{2}\mathbf{1}\{x = y\}\) with universal second-order correction factor to provide honest p-values under \(\mathrm{H_0\colon AUC} = 0.5\) regardless of tie structure.
Uses three-tier approach: permutation \((n < 20)\), exact unbiased estimator \((20 \le n < 50)\), asymptotic with corrections \(n \ge 50\).
The unbiased variance estimator is constructed as a specific linear combination:
\(\widetilde{\mathrm{Var}}(\hat{A}) = \frac{n_2\hat{\zeta}_1^2 + n_1\hat{\zeta}_2^2 - \frac{M-1}{M}\hat{v}}{M+1}\)
where \(\hat{v}\) is the pooled sample variance of kernel values and \(\hat{\zeta}_1^2, \hat{\zeta}_2^2\) are row/column mean variances.
Welch-Satterthwaite degrees of freedom account for bias correction structure:
\(\nu = \frac{(\hat{\sigma}^2)^2}{\frac{(n_2\hat{\zeta}_1^2/(M+1))^2}{n_1-2} + \frac{(n_1\hat{\zeta}_2^2/(M+1))^2}{n_2-2} + \frac{((M-1)\hat{v}/(M(M+1)))^2}{M-3}}\)
Function uses mid-rank tie handling throughout, ensuring theoretical consistency with the corrected null hypothesis framework.
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.