Skip to content

exactRankTests

Exact Distributions for Rank and Permutation Tests

v0.8-36 · Mar 9, 2026 · GPL (>= 2)

Description

Computes exact conditional p-values and quantiles using an implementation of the Shift-Algorithm by Streitberg & Roehmel.

Downloads

28.4K

Last 30 days

660th

28.4K

Last 90 days

28.4K

Last year

CRAN Check Status

1 ERROR
2 NOTE
11 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc ERROR
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 NOTE
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 NOTE
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (14 non-OK)
OK r-devel-linux-x86_64-debian-clang

*


            
ERROR r-devel-linux-x86_64-debian-gcc

tests

  Running ‘bugfix-tests.R’ [0s/1s]
  Comparing ‘bugfix-tests.Rout’ to ‘bugfix-tests.Rout.save’ ... OK
  Running ‘dtest.R’ [1s/2s]
  Running ‘reg-tests.R’ [0s/0s]
  Running ‘stest.R’ [2s/2s]
Running the tests in ‘tests/reg-tests.R’ failed.
Complete output:
  > 
  > require("exactRankTests")
  Loading required package: exactRankTests
   Package 'exactRankTests' is no longer under development.
   Please consider using package 'coin' instead.
  
  > suppressWarnings(RNGversion("3.5.3"))
  > set.seed(29081975)
  > 
  > #
  > #  Regression tests
  > #
  > 
  > # Blood Pressure data: Results from StatXact 5 (demo version)
  > 
  > data(bloodp)
  > # bloodp$group <- factor(c(rep("Behandlung", 4), rep("Kontrolle", 11)))
  > 
  > we <- wilcox.exact(bp ~ group, data=bloodp, conf.int=TRUE)
  > we
  
  	Exact Wilcoxon rank sum test
  
  data:  bp by group
  W = 35, p-value = 0.0989
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -4 22
  sample estimates:
  difference in location 
                     9.5 
  
  > stopifnot(round(we$p.value,4) == 0.0989)
  > stopifnot(we$conf.int[1] == -4)
  > stopifnot(we$conf.int[2] == 22)
  > stopifnot(we$conf.estimate == 9.5)
  >  
  > we <- wilcox.exact(bp ~ group, data=bloodp, conf.int=TRUE, exact=FALSE)
  > we
  
  	Asymptotic Wilcoxon rank sum test
  
  data:  bp by group
  W = 35, p-value = 0.08535
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -4.143776e-05  2.000007e+01
  sample estimates:
  difference in location 
                9.790799 
  
  > stopifnot(round(we$p.value,4) == 0.0853)
  >  
  > we <- wilcox.exact(bp ~ group, data=bloodp, alternative="greater", conf.int=TRUE)
  > stopifnot(round(we$p.value,4) == 0.0542)
  > 
  > 
  > pt <- perm.test(bp ~ group, data=bloodp)
  > pt
  
  	2-sample Permutation Test
  
  data:  bp by group
  T = 402, p-value = 0.104
  alternative hypothesis: true mu is not equal to 0
  
  > stopifnot(round(pt$p.value, 4) == 0.1040)
  > 
  > pt <- perm.test(bp ~ group, data=bloodp, alternative="greater")
  > pt
  
  	2-sample Permutation Test
  
  data:  bp by group
  T = 402, p-value = 0.05641
  alternative hypothesis: true mu is greater than 0
  
  > stopifnot(round(pt$p.value, 4) == 0.0564)
  > 
  > pt <- perm.test(bp ~ group, data=bloodp, exact=FALSE)
  > pt
  
  	Asymptotic 2-sample Permutation Test
  
  data:  bp by group
  T = 402, p-value = 0.107
  alternative hypothesis: true mu is not equal to 0
  
  > stopifnot(round(pt$p.value, 4) == 0.1070)
  > 
  > sc <- cscores(bloodp$bp, type="NormalQuantile")
  > X <- sum(sc[bloodp$group == "group2"])
  > stopifnot(round(pperm(X, sc, 11), 4) == 0.0462)
  > stopifnot(round(pperm(X, sc, 11, alternative="two.sided"), 4) == 0.0799)
  > 
  > # use scores mapped into integers
  > 
  > sc <- cscores(bloodp$bp, type="NormalQuantile", int=TRUE)
  > X <- sum(sc[bloodp$group == "group2"])
  > stopifnot(round(pperm(X, sc, 11), 4)  == 0.0462)
  > stopifnot(round(pperm(X, sc, 11, alternative="two.sided"), 4) == 0.0799)
  > 
  > # Equality of wilcox.test in package ctest and wilcox.exact
  > 
  > x <- c(1.83,  0.50,  1.62,  2.48, 1.68, 1.88, 1.55, 3.06, 1.30)
  > y <- c(0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29)
  > 
  > wt <- wilcox.test(y-x)  
  > we <- wilcox.exact(y -x)
  > wt
  
  	Wilcoxon signed rank exact test
  
  data:  y - x
  V = 5, p-value = 0.03906
  alternative hypothesis: true location is not equal to 0
  
  > we
  
  	Exact Wilcoxon signed rank test
  
  data:  y - x
  V = 5, p-value = 0.03906
  alternative hypothesis: true mu is not equal to 0
  
  > stopifnot(wt$p.value == we$p.value)
  > 
  > x <- c(0.80, 0.83, 1.89, 1.04, 1.45, 1.38, 1.91, 1.64, 0.73, 1.46)
  > y <- c(1.15, 0.88, 0.90, 0.74, 1.21)
  > we <- wilcox.exact(x, y, alternative = "g")        # greater
  > wt <- wilcox.test(x, y, alternative = "g")
  > stopifnot(we$p.value == wt$p.value)
  > stopifnot(all(we$conf.int == wt$conf.int))
  > 
  > x <- rnorm(10)
  > y <- rnorm(10, 2)
  > wilcox.exact(x, y, conf.int = TRUE)
  
  	Exact Wilcoxon rank sum test
  
  data:  x and y
  W = 13, p-value = 0.003886
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -2.6984506 -0.5996612
  sample estimates:
  difference in location 
                -2.07512 
  
  > 
  > if (!any(duplicated(c(x,y)))) {
  +     we <- wilcox.exact(x, y, conf.int = TRUE)
  +     print(we)
  +     wt <- wilcox.test(x, y, conf.int = TRUE)
  +     print(wt)
  +     we$pointprob <- NULL
  +     we$method <- NULL   
  +     we$null.value <- NULL
  +     wt$parameter <- NULL
  +     wt$method <- NULL   
  +     wt$null.value <- NULL
  +     stopifnot(all.equal(wt, we))
  +     we <- wilcox.exact(x, conf.int = TRUE)
  +     print(we)
  +     wt <- wilcox.test(x, conf.int = TRUE)
  +     print(wt)
  +     we$pointprob <- NULL
  +     we$method <- NULL   
  +     we$null.value <- NULL
  +     wt$parameter <- NULL
  +     wt$method <- NULL   
  +     wt$null.value <- NULL
  +     stopifnot(all.equal(wt, we))
  + }
  
  	Exact Wilcoxon rank sum test
  
  data:  x and y
  W = 13, p-value = 0.003886
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -2.6984506 -0.5996612
  sample estimates:
  difference in location 
                -2.07512 
  
  
  	Wilcoxon rank sum exact test
  
  data:  x and y
  W = 13, p-value = 0.003886
  alternative hypothesis: true location shift is not equal to 0
  95.67429 percent confidence interval:
   -2.6984506 -0.5996612
  sample estimates:
  difference in location 
                -2.07512 
  
  Error: wt and we are not equal:
    Component "conf.int": Attributes: < Component "conf.level": Mean relative difference: 0.007047815 >
  Execution halted
OK r-devel-linux-x86_64-fedora-clang

*


            
OK r-devel-linux-x86_64-fedora-gcc

*


            
NOTE r-devel-macos-arm64

tests

  Running ‘bugfix-tests.R’ [0s/0s]
  Comparing ‘bugfix-tests.Rout’ to ‘bugfix-tests.Rout.save’ ... OK
  Running ‘dtest.R’ [0s/0s]
  Running ‘reg-tests.R’ [0s/0s]
  Comparing ‘reg-tests.Rout’ to ‘reg-tests.Rout.save’ ...
194c194
< 95 percent confidence interval:
---
> 95.67429 percent confidence interval:
218c218
< 95 percent confidence interval:
---
> 95.11719 percent confidence interval:
  Running ‘stest.R’ [1s/1s]
OK r-devel-windows-x86_64

*


            
OK r-oldrel-macos-arm64

*


            
OK r-oldrel-macos-x86_64

*


            
OK r-oldrel-windows-x86_64

*


            
OK r-patched-linux-x86_64

*


            
OK r-release-linux-x86_64

*


            
NOTE r-release-macos-arm64

tests

  Running ‘bugfix-tests.R’ [0s/0s]
  Comparing ‘bugfix-tests.Rout’ to ‘bugfix-tests.Rout.save’ ... OK
  Running ‘dtest.R’ [0s/0s]
  Running ‘reg-tests.R’ [0s/0s]
  Comparing ‘reg-tests.Rout’ to ‘reg-tests.Rout.save’ ...194c194
< 95 percent confidence interval:
---
> 95.67429 percent confidence interval:
218c218
< 95 percent confidence interval:
---
> 95.11719 percent confidence interval:
  Running ‘stest.R’ [1s/1s]
OK r-release-macos-x86_64

*


            
OK r-release-windows-x86_64

*


            

Additional Issues

M1mac Details →

Check History

ERROR 11 OK · 2 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 9, 2026
ERROR r-devel-linux-x86_64-debian-gcc

tests

  Running ‘bugfix-tests.R’ [0s/1s]
  Comparing ‘bugfix-tests.Rout’ to ‘bugfix-tests.Rout.save’ ... OK
  Running ‘dtest.R’ [1s/2s]
  Running ‘reg-tests.R’ [0s/0s]
  Running ‘stest.R’ [2s/2s]
Running the tests in ‘tests/reg-tests.R’ failed.
Complete output:
  > 
  > require("exactRankTests")
  Loading required package: exactRankTests
   Package 'exactRankTests' is no longer under development.
   Please consider using package 'coin' instead.
  
  > suppressWarnings(RNGversion("3.5.3"))
  > set.seed
NOTE r-devel-macos-arm64

tests

  Running ‘bugfix-tests.R’ [0s/0s]
  Comparing ‘bugfix-tests.Rout’ to ‘bugfix-tests.Rout.save’ ... OK
  Running ‘dtest.R’ [0s/0s]
  Running ‘reg-tests.R’ [0s/0s]
  Comparing ‘reg-tests.Rout’ to ‘reg-tests.Rout.save’ ...
194c194
< 95 percent confidence interval:
---
> 95.67429 percent confidence interval:
218c218
< 95 percent confidence interval:
---
> 95.11719 percent confidence interval:
  Running ‘stest.R’ [1s/1s]
NOTE r-release-macos-arm64

tests

  Running ‘bugfix-tests.R’ [0s/0s]
  Comparing ‘bugfix-tests.Rout’ to ‘bugfix-tests.Rout.save’ ... OK
  Running ‘dtest.R’ [0s/0s]
  Running ‘reg-tests.R’ [0s/0s]
  Comparing ‘reg-tests.Rout’ to ‘reg-tests.Rout.save’ ...194c194
< 95 percent confidence interval:
---
> 95.67429 percent confidence interval:
218c218
< 95 percent confidence interval:
---
> 95.11719 percent confidence interval:
  Running ‘stest.R’ [1s/1s]

Reverse Dependencies (6)

Dependency Network

Dependencies Reverse dependencies Coinprofile MKinfer maxstat rankdifferencetest DiscreteQvalue MKmisc exactRankTests

Version History

new 0.8-36 Mar 9, 2026