MyNixOS website logo
Description

Ansari-Bradley Test with Arbitrarily Missing Data.

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.

abwm

This package includes one function abwm.test(), which performs the Ansari-Bradley test (Ansari & Bradley, 1960) with missing data proposed in (Zeng et al., 2025). This method is a theoretical extension of the Ansari-Bradley test, with controlled Type I error regardless of values of missing data.

Bounds of the Ansari-Bradley test statistic and its p-value will be computed in the presence of missing data. 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.

Installation

You can install the development version of abwm from GitHub with:

# install.packages("devtools")
devtools::install_github("Yijin-Zeng/Ansari-Bradley-Test-with-Missing-data")

Example

This is a basic example which shows you how to perform the test with missing data:

library(abwm)

#### Two-sided test
X <- c(6.2, 3.5, NA, 7.6, 9.2)
Y <- c(NA, 1.3, -0.5, -1.7)
abwm.test(X, Y, alternative = 'two.sided')
#> $p.value
#> [1] 1
#> 
#> $bounds.statistic
#> [1]  7 14
#> 
#> $bounds.pvalue
#> [1] 0.04795881 1.00000000
#> 
#> $alternative
#> [1] "two.sided"
#> 
#> $data.name
#> [1] "X and Y"

## One-sided test
X <- c(6.2, 3.5, NA, 7.6, 9.2)
Y <- c(NA, 1.3, -0.5, -1.7)
abwm.test(X, Y, alternative = 'less')
#> $p.value
#> [1] 0.9176989
#> 
#> $bounds.statistic
#> [1]  7 14
#> 
#> $bounds.pvalue
#> [1] 0.02397941 0.91769888
#> 
#> $alternative
#> [1] "less"
#> 
#> $data.name
#> [1] "X and Y"

See Also

The R function stats::ansari.test() performs the Ansari-Bradley test when data are completely observed.

References

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.

Metadata

Version

0.1.0

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows