Running 'bugfix-tests.R' [159s]
  Running 'dtest.R' [1s]
  Running 'reg-tests.R' [166s]
  Running 'stest.R' [2s]
Running the tests in 'tests/bugfix-tests.R' failed.
Complete output:
  > 
  > library("exactRankTests")
   Package 'exactRankTests' is no longer under development.
   Please consider using package 'coin' instead.
  
  > 
  > # From Ruggero Bellio <ruggero.bellio@dss.uniud.it>
  > # 20.02.2002
  > # and 23.07.2002
  > 
  > x <- c(0,87, 0, 0, 0, 0, 8, 0,16, 0,64, 0, 0,37, 200, 0,0,32, 5 ,0, 0,14, 0,
  +        0, 4, 0, 0,50, 0, 0,99, 0, 0,12,36,22, 4,13, 0,10,70, 0, 0, 0, 0,19,
  +        0, 4, 3, 4,23, 0, 0, 0,0, 0, 0 ,14, 4, 8, 0,11,42, 0, 0, 0, 0, 0,18,
  +        11,29, 0, 0)
  > 
  > y <- c(0, 0,14, 0, 0,16, 0, 145, 0, 0,16, 0, 0,47, 0, 0,0, 144, 0 , 2, 0,13,
  +        0, 0, 114, 0, 6, 0, 0, 4, 9, 0, 0,17, 0,0,42, 0 , 0, 0, 0, 0, 0, 0,25,
  +        0, 1, 178, 0, 0, 0, 6, 0,7,76, 252, 0 , 0,23, 0, 0,68, 0, 0, 0,24, 0,
  +        59, 0, 0, 0, 0,16)
  > 
  > wilcox.exact(x, y, paired=TRUE, conf.int=TRUE)  # was broken
  
  	Exact Wilcoxon signed rank test
  
  data:  x and y
  V = 559, p-value = 0.9603
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -13.5  10.5
  sample estimates:
  (pseudo)median 
           -0.25 
  
  > 
  > p1 <- wilcox.exact(x, y, paired=TRUE, alternative="g", mu=-50)$p.value
  > p2 <- wilcox.exact(x, y, paired=TRUE, alternative="l", mu=-50)$p.value
  > p <- p1 + p2
  > names(p) <- NULL
  > 
  > stopifnot(all.equal(p, 1))
  > 
  > p1 <- perm.test(x, y, paired=TRUE, alternative="g")$p.value
  > p2 <- perm.test(x, y, paired=TRUE, alternative="l")$p.value
  > p <- p1 + p2
  > names(p) <- NULL
  > 
  > stopifnot(all.equal(p, 1))
  > 
  > # From Achim Zeileis <zeileis@ci.tuwien.ac.at>
  > # 15.04.2002
  > 
  > ramsay <- c(111, 107, 100, 99, 102, 106, 109, 108,
  +   104, 99, 101, 96, 97, 102, 107, 113, 116, 113, 110, 98)
  > jung.parekh <- c(107, 108, 106, 98, 105, 103, 110, 105,
  +   104, 100, 96, 108, 103, 104, 114, 114, 113, 108, 106, 99)
  > scores <- rank(c(ramsay, jung.parekh))
  > scores <- pmin(scores, length(ramsay) + length(jung.parekh) - scores + 1)
  > AB <- sum(scores[seq(along = ramsay)])
  > pperm(AB, scores, length(ramsay), alternative = "two.sided")
  [1] 0.1880644
  > perm.test(scores[1:20], scores[21:40])
  
  	2-sample Permutation Test (scores mapped into 1:(m+n) using rounded
  	scores)
  
  data:  scores[1:20] and scores[21:40]
  T = 358, p-value = 0.1878
  alternative hypothesis: true mu is not equal to 0
  
  > 
  > # dperm was broken for some configurations of paired samples
  > 
  > ret <- c()
  > for (i in 1:100)
  +   ret <- c(ret,dperm(-(1:10), sample(1:20, 5), 5))
  > stopifnot(sum(ret) == 0) 
  > 
  > try(dperm(0, c(0,-1,2,2), m=4))
  Error in equiscores(scores, m, tol, fact, simulate) : 
    scores must be positive
  > 
  > # missing values to the default method `perm.test.default'
  > # spotted by Claus Ekstroem <claus@ekstroem.dk>
  > # 18.09.2003
  > x <- c(1, 2, 3, 4, NA)
  > y <- c(1, 2, 1, 2, 3)
  > perm.test(x,y, paired=TRUE)
  
  	1-sample Permutation Test
  
  data:  x and y
  T = 4, p-value = 0.5
  alternative hypothesis: true mu is not equal to 0
  
  > 
  > # now fixed: This was a problem when defining two-sided P-values for discrete
  > # distributions; the statistic was equal to the expectation (coin deals with this).
  > # spotted by Dieter Menne <dieter.menne@menne-biomed.de>
  > pperm(5, 1:4, 4, alt = "two.sided")
  [1] 1
  > 
  > # mu was ignored, spotted by <Reiczigel.Jeno@aotk.szie.hu>
  > x <- c(28,39,66,75,59,33,45,108,110,81,77,34,80,69,72)
  > stopifnot(all.equal(perm.test(x, mu = 60)$p.value, 
  +           perm.test(x - 60, mu = 0)$p.value))
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.32    0.04    0.32 
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 percent confidence interval:
   -2.6984506 -0.5996612
  sample estimates:
  difference in location 
                -2.07512 
  
  
  	Exact Wilcoxon signed rank test
  
  data:  x
  V = 17, p-value = 0.3223
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -0.9374751  0.7638509
  sample estimates:
  (pseudo)median 
      -0.3968314 
  
  
  	Wilcoxon signed rank exact test
  
  data:  x
  V = 17, p-value = 0.3223
  alternative hypothesis: true location is not equal to 0
  95 percent confidence interval:
   -0.9374751  0.7638509
  sample estimates:
  (pseudo)median 
      -0.3968314 
  
  > 
  > 
  > # Hollander & Wolfe (1999), second edition, Example 4.2., page 112
  > 
  > contr <- c(1042, 1617, 1180, 973, 1552, 1251, 1151, 728, 1079, 951, 1319)
  > SST <- c(874, 389, 612, 798, 1152, 893, 541, 741, 1064, 862, 213)
  > 
  > wilcox.exact(contr, SST, conf.int=TRUE)
  
  	Exact Wilcoxon rank sum test
  
  data:  contr and SST
  W = 106, p-value = 0.00186
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   168 690
  sample estimates:
  difference in location 
                     410 
  
  > 
  > # page 110, Example 4.1
  > 
  > term <- c(0.8, 0.83, 1.89, 1.04, 1.45, 1.38, 1.91, 1.64, 0.73, 1.46)
  > weeks <- c(1.15, 0.88, 0.90, 0.74, 1.21)
  > 
  > wilcox.exact(weeks, term, conf.int=TRUE)
  
  	Exact Wilcoxon rank sum test
  
  data:  weeks and term
  W = 15, p-value = 0.2544
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -0.76  0.15
  sample estimates:
  difference in location 
                  -0.305 
  
  > 
  > 
  > # Hollander & Wolfe, p. 39, results p. 40 and p. 53
  > 
  > 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)
  > 
  > we <- wilcox.exact(y,x, paired=TRUE, conf.int=TRUE)
  > we 
  
  	Exact Wilcoxon signed rank test
  
  data:  y and x
  V = 5, p-value = 0.03906
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -0.786 -0.010
  sample estimates:
  (pseudo)median 
           -0.46 
  
  >    
  > stopifnot(round(we$p.value,4) == 0.0391)
  > stopifnot(round(we$conf.int,3) == c(-0.786, -0.010))
  > stopifnot(round(we$estimate,3) == -0.46)
  > 
  > # Hollander & Wolfe, p. 110, results p. 111 and p. 126
  > 
  > x <- c(0.8, 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(y,x, conf.int=TRUE)
  > we
  
  	Exact Wilcoxon rank sum test
  
  data:  y and x
  W = 15, p-value = 0.2544
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -0.76  0.15
  sample estimates:
  difference in location 
                  -0.305 
  
  > stopifnot(round(we$p.value,4) == 0.2544)
  > stopifnot(round(we$conf.int,3) == c(-0.76, 0.15))
  > stopifnot(round(we$estimate,3) == -0.305)
  > 
  > wel <- wilcox.exact(y,x, conf.int=TRUE, alternative="less")
  > weg <- wilcox.exact(y,x, conf.int=TRUE, alternative="greater")
  > 
  > stopifnot(we$estimate == wel$estimate & we$estimate == weg$estimate)
  > stopifnot(we$conf.int[1] <= weg$conf.int[1] & 
  +           we$conf.int[2] >= wel$conf.int[2])
  > 
  > # just kidding
  > 
  > stopifnot(wilcox.exact(1:8)$p.value == 0.0078125)
  > stopifnot(wilcox.exact(c(1:7,7))$p.value == 0.0078125)
  > stopifnot(wilcox.exact(c(1,1,1))$p.value == 0.25)
  > 
  > x <- rnorm(10)
  > y <- rnorm(10)
  > stopifnot(wilcox.test(x,y,conf.int=TRUE)$estimate ==
  +           wilcox.exact(x,y,conf.int=TRUE)$estimate) 
  > stopifnot(wilcox.test(x,conf.int=TRUE)$estimate ==  
  +           wilcox.exact(x,conf.int=TRUE)$estimate)   
  > 
  > 
  > # permutation test: AIDS data
  > 
  > diff <- c(-149, 51, 0, 126, -106, -20, 0, -52, -292, 0, -103, 0, -84, -89,
  + -159, -404, -500, -259, -14, -2600)
  > 
  > # p-values in StatXact == 0.0011 one-sided, 0.0021 two.sided, page 183
  > 
  > stopifnot(round(perm.test(diff)$p.value, 4) == 0.0021)
  > stopifnot(round(perm.test(diff, alternative="less")$p.value,4) == 0.0011)
  > pt <- perm.test(diff, exact=FALSE)
  > stopifnot(round(pt$p.value, 4) == 0.0878)
  > 
  > # permutation test: binary data
  > # Example from Gardner & Altman (1989), p. 30
  > # two treatments A and B, 1 means improvement, 0 means no improvement
  > # confidence sets cf. R\"ohmel (1996)
  > 
  > A <- c(rep(1, 61), rep(0, 19))
  > B <- c(rep(1, 45), rep(0, 35))
  > pt <- perm.test(A, B, conf.int=TRUE, exact=TRUE)
  > pt
  
  	2-sample Permutation Test
  
  data:  A and B
  T = 61, p-value = 0.0118
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   0.05263158 0.34285714
  
  > stopifnot(round(pt$conf.int, 4) == c(0.0526, 0.3429))
  > 
  > # real response
  > data(globulin)
  > pt <- perm.test(gfrac ~ group, data=globulin, conf.int=TRUE)
  > pt
  
  	2-sample Permutation Test
  
  data:  gfrac by group
  T = 331, p-value = 0.1475
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
   -8.50  1.25
  
  > stopifnot(pt$conf.int == c(-8.50, 1.25))
  > 
  > # Bergmann Benchmark
  > data(rotarod)
  > stopifnot(round(wilcox.exact(time ~ group, data=rotarod,
  + alternative="g")$p.value, 4) == 0.0186)
  > stopifnot(round(wilcox.exact(time ~ group, data=rotarod,
  + conf.int=TRUE)$p.value, 4) == 0.0373)
  > stopifnot(round(wilcox.exact(time ~ group, data=rotarod,
  + exact=FALSE)$p.value, 4) == 0.0147)
  > 
  > # Conover scores
  > 
  > data(neuropathy)
  > # compare with Table 2 of Conover & Salsburg (1988)
  > wilcox.exact(pain ~ group, data=neuropathy, alternative="less")
  
  	Exact Wilcoxon rank sum test
  
  data:  pain by group
  W = 357, p-value = 0.1654
  alternative hypothesis: true mu is less than 0
  
  > css <- cscores(neuropathy$pain, type="ConSal")   
  > round(pperm(sum(css[neuropathy$group=="control"]),css,
  +       m=sum(neuropathy$group=="control")),3)
  [1] 0.031
  Warning message:
  In findfact(scores - min(scores) + 1, m, tol) :
    cannot hold tol, tolerance: 0.047123
  > 
  > # paired Wilcoxon
  > 
  > # paired observations
  > # Data from the StatXact-4 manual, page 167, serum antigen level
  > 
  > # StatXact 4 for Windows: p.value=0.0021 (page 168)
  > 
  > data(sal)
  > attach(sal)
  > 
  > we <- wilcox.exact(pre, post, paired=TRUE, conf.int=TRUE)
  > we
  
  	Exact Wilcoxon signed rank test
  
  data:  pre and post
  V = 124, p-value = 0.002136
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
    54 292
  sample estimates:
  (pseudo)median 
          137.75 
  
  > stopifnot(round(we$p.value,4) == 0.0021)
  > 
  > we <- wilcox.exact(post, pre, paired=TRUE, conf.int=TRUE)
  > stopifnot(we$estimate > we$conf.int[1] & we$estimate < we$conf.int[2])
  > stopifnot(we$conf.int[1] == -292)
  > stopifnot(we$conf.int[2] == -54)
  > stopifnot(round(we$estimate,1) == -137.8)
  > 
  > we <- wilcox.exact(pre,post, paired=TRUE, conf.int=TRUE, exact=FALSE)
  > we
  
  	Asymptotic Wilcoxon signed rank test
  
  data:  pre and post
  V = 124, p-value = 0.003783
  alternative hypothesis: true mu is not equal to 0
  95 percent confidence interval:
    54.49998 281.50005
  sample estimates:
  (pseudo)median 
        137.2646 
  
  > stopifnot(round(we$p.value,4) == 0.0038)
  > 
  > # irank
  > x <- rnorm(100)
  > stopifnot(all(rank(x) == irank(x)))
  > 
  > proc.time()
     user  system elapsed 
     0.50    0.12    0.60