| Title: | Ansari-Bradley Test with Arbitrarily Missing Data |
|---|---|
| Description: | Performs the two-sample Ansari–Bradley test (Ansari & Bradley, 1960 <https://www.jstor.org/stable/2237814>) for univariate, distinct data in the presence of missing values, as described in Zeng et al. (2025) <doi:10.48550/arXiv.2509.20332>. This method does not make any assumptions about the missingness mechanisms and controls the Type I error regardless of the missing values by taking all possible missing values into account. |
| Authors: | Yijin Zeng [aut, cre] |
| Maintainer: | Yijin Zeng <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-06-05 08:54:41 UTC |
| Source: | https://github.com/yijin-zeng/abwm |
Performs the two-sample Ansari-Bradley test for univariate, distinct data in the presence of missing values with controlled Type I error.
abwm.test(X, Y, alternative = c("two.sided", "less", "greater"))abwm.test(X, Y, alternative = c("two.sided", "less", "greater"))
X, Y
|
numeric vectors of data values with potential missing data. Inf and -Inf values will be omitted. |
alternative |
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter. |
abwm.test() performs the Ansari-Bradley scale testing method
(Ansari & Bradley, 1960) in the presence of missing data, as described in Zeng et al. (2025).
Suppose and ,
the Ansari-Bradley test statistic in Zeng et al. (2025) is defined as
where denotes the rank of in the set
. The function abwm.test() returns the tight bounds of
the Ansari-Bradley test statistic and its p-value obtained using the normal approximation.
The p-value of the test method proposed in Zeng et al. (2025) is then
returned as the maximum possible p-value of the Ansari-Bradley test.
This method (Zeng et al., 2025) does not make any missing data assumptions, and
controls the Type I error regardless of the values
of missing data.
p.value |
the p-value for the test. |
bounds.statistic |
bounds of the value of the Ansari-Bradley test statistic. |
bounds.pvalue |
bounds of the p-value of the Ansari-Bradley test. |
alternative |
a character string describing the alternative hypothesis. |
data.name |
a character string giving the names of the data. |
Y. Zeng, N. M. Adams, D. A. Bodenham. Scale two-sample testing with arbitrarily missing data. arXiv preprint arXiv:2509.20332. 2025.
A. R. Ansari, R. A. Bradley. Rank-Sum Tests for Dispersions. The Annals of Mathematical Statistics, pages 1174–1189, 1960.
stats::ansari.test() when data are completely observed.
#### Assume all values are distinct. X <- c(6.2, 3.5, NA, 7.6, 9.2) Y <- c(0.2, 1.3, -0.5, -1.7) ## Perform the two-sided Ansari-Bradley testing with missing data. abwm.test(X, Y, alternative = 'two.sided') ## Consider one-sided testing. abwm.test(X, Y, alternative = 'less')#### Assume all values are distinct. X <- c(6.2, 3.5, NA, 7.6, 9.2) Y <- c(0.2, 1.3, -0.5, -1.7) ## Perform the two-sided Ansari-Bradley testing with missing data. abwm.test(X, Y, alternative = 'two.sided') ## Consider one-sided testing. abwm.test(X, Y, alternative = 'less')