Running ‘andersondarling_behaviour.r’ [0s/0s]
  Running ‘andersondarling_correctness.r’ [1s/1s]
  Running ‘andersondarling_errors.r’ [0s/0s]
  Running ‘andersondarling_warnings.r’ [0s/0s]
  Running ‘bartlett_behaviour.r’ [0s/1s]
  Running ‘bartlett_correctness.r’ [2s/2s]
  Running ‘bartlett_errors.r’ [0s/1s]
  Running ‘bartlett_warnings.r’ [0s/0s]
  Running ‘brownforsythe_behaviour.r’ [0s/0s]
  Running ‘brownforsythe_correctness.r’ [8s/10s]
  Running ‘brownforsythe_errors.r’ [0s/0s]
  Running ‘brownforsythe_warnings.r’ [0s/1s]
  Running ‘cor_pearson_behaviour.r’ [0s/1s]
  Running ‘cor_pearson_correctness.r’ [1s/1s]
  Running ‘cor_pearson_errors.r’ [0s/0s]
  Running ‘cor_pearson_warnings.r’ [0s/0s]
  Running ‘cosinor_behaviour.r’ [0s/0s]
  Running ‘cosinor_correctness.r’ [15s/20s]
  Running ‘cosinor_errors.r’ [0s/1s]
  Running ‘cosinor_warnings.r’ [0s/0s]
  Running ‘f_var_behaviour.r’ [0s/1s]
  Running ‘f_var_correctness.r’ [1s/1s]
  Running ‘f_var_errors.r’ [0s/1s]
  Running ‘f_var_warnings.r’ [0s/1s]
  Running ‘flignerkilleen_behaviour.r’ [0s/1s]
  Running ‘flignerkilleen_correctness.r’ [2s/3s]
  Running ‘flignerkilleen_errors.r’ [0s/0s]
  Running ‘flignerkilleen_warnings.r’ [0s/0s]
  Running ‘jarquebera_behaviour.r’ [0s/1s]
  Running ‘jarquebera_correctness.r’ [1s/1s]
  Running ‘jarquebera_errors.r’ [0s/0s]
  Running ‘jarquebera_warnings.r’ [0s/0s]
  Running ‘kolmogorovsmirnov_twosample_behavioiur.r’ [0s/0s]
  Running ‘kolmogorovsmirnov_twosample_correctness.r’ [5s/6s]
  Running ‘kolmogorovsmirnov_twosample_errors.r’ [0s/0s]
  Running ‘kolmogorovsmirnov_twosample_warnings.r’ [0s/1s]
  Running ‘kruskalwallis_behaviour.r’ [0s/1s]
  Running ‘kruskalwallis_correctness.r’ [2s/2s]
  Running ‘kruskalwallis_errors.r’ [0s/0s]
  Running ‘kruskalwallis_warnings.r’ [0s/0s]
  Running ‘levene_behaviour.r’ [0s/0s]
  Running ‘levene_correctness.r’ [7s/8s]
  Running ‘levene_errors.r’ [0s/0s]
  Running ‘levene_warnings.r’ [0s/0s]
  Running ‘oneway_equalvar_behaviour.r’ [0s/0s]
  Running ‘oneway_equalvar_correctness.r’ [4s/5s]
  Running ‘oneway_equalvar_errors.r’ [0s/0s]
  Running ‘oneway_equalvar_warnings.r’ [0s/1s]
  Running ‘oneway_welch_behaviour.r’ [0s/0s]
  Running ‘oneway_welch_correctness.r’ [2s/3s]
  Running ‘oneway_welch_errors.r’ [0s/0s]
  Running ‘oneway_welch_warnings.r’ [0s/0s]
  Running ‘t_equalvar_behaviour.r’ [0s/1s]
  Running ‘t_equalvar_correctness.r’ [1s/1s]
  Running ‘t_equalvar_errors.r’ [0s/0s]
  Running ‘t_equalvar_warnings.r’ [0s/1s]
  Running ‘t_onesample_behaviour.r’ [0s/0s]
  Running ‘t_onesample_correctness.r’ [1s/1s]
  Running ‘t_onesample_errors.r’ [0s/0s]
  Running ‘t_onesample_warnings.r’ [0s/1s]
  Running ‘t_paired_behaviour.r’ [0s/0s]
  Running ‘t_paired_correctness.r’ [1s/1s]
  Running ‘t_paired_errors.r’ [0s/1s]
  Running ‘t_paired_warnings.r’ [0s/0s]
  Running ‘t_welch_behaviour.r’ [0s/0s]
  Running ‘t_welch_correctness.r’ [1s/1s]
  Running ‘t_welch_errors.r’ [0s/1s]
  Running ‘t_welch_warnings.r’ [0s/1s]
  Running ‘waerden_behaviour.r’ [0s/0s]
  Running ‘waerden_correctness.r’ [3s/3s]
  Running ‘waerden_errors.r’ [0s/1s]
  Running ‘waerden_warnings.r’ [0s/1s]
  Running ‘wilcoxon_onesample_behaviour.r’ [0s/0s]
  Running ‘wilcoxon_onesample_correctness.r’ [1s/1s]
  Running ‘wilcoxon_onesample_errors.r’ [0s/0s]
  Running ‘wilcoxon_onesample_warnings.r’ [0s/0s]
  Running ‘wilcoxon_paired_behaviour.r’ [0s/0s]
  Running ‘wilcoxon_paired_correctness.r’ [2s/2s]
  Running ‘wilcoxon_paired_errors.r’ [0s/0s]
  Running ‘wilcoxon_paired_warnings.r’ [0s/0s]
  Running ‘wilcoxon_twosample_behaviour.r’ [0s/0s]
  Running ‘wilcoxon_twosample_correctness.r’ [4s/4s]
  Running ‘wilcoxon_twosample_errors.r’ [0s/1s]
  Running ‘wilcoxon_twosample_warnings.r’ [0s/0s]
Running the tests in ‘tests/wilcoxon_onesample_correctness.r’ failed.
Complete output:
  > library(matrixTests)
  > 
  > #--- functions -----------------------------------------------------------------
  > 
  > base_wilcoxon_onesample <- function(mat, null=0, alternative="two.sided", exact=NA, correct=TRUE) {
  +   if(is.vector(mat)) mat <- matrix(mat, nrow=1)
  +   if(length(alternative)==1) alternative <- rep(alternative, nrow(mat))
  +   if(length(null)==1) null <- rep(null, nrow(mat))
  +   if(length(exact)==1) exact <- rep(exact, nrow(mat))
  +   if(length(correct)==1) correct <- rep(correct, nrow(mat))
  + 
  +   nx <- stat <- p <- m0 <- numeric(nrow(mat))
  +   al <- character(nrow(mat))
  +   ext <- cor <- logical(nrow(mat))
  +   for(i in 1:nrow(mat)) {
  +     vec <- mat[i,][!is.na(mat[i,])]
  +     ex  <- if(is.na(exact[i])) NULL else exact[i]
  + 
  +     res <- wilcox.test(vec, alternative=alternative[i], mu=null[i], exact=ex, correct=correct[i])
  + 
  +     nx[i]   <- sum((vec-null[i]) != 0)
  +     stat[i] <- res$statistic
  +     p[i]    <- res$p.value
  +     al[i]   <- res$alternative
  +     m0[i]   <- res$null.value
  + 
  +     cor[i] <- grepl("continuity correction", res$method)
  +     ext[i] <- if(is.na(exact[i])) (nx[i] < 50) else exact[i]
  +     ext[i] <- if(length(unique(abs(vec-m0[i]))) != length(vec)) FALSE else ext[i]
  +     ext[i] <- if(any((vec-m0[i]) == 0)) FALSE else ext[i]
  +   }
  + 
  +   data.frame(obs=nx, statistic=stat, pvalue=p, location.null=m0, alternative=al,
  +              exact=ext, corrected=cor, stringsAsFactors=FALSE
  +              )
  + }
  > 
  > 
  > #--- montecarlo ----------------------------------------------------------------
  > 
  > # 3 observations
  > x <- matrix(rnorm(3000), ncol=3)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > cor <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- base_wilcoxon_onesample(x, mus, alts, exact=ext, correct=cor)
  > res2 <- row_wilcoxon_onesample(x, mus, alts, exact=ext, correct=cor)
  > stopifnot(all.equal(res1, res2))
  > 
  > # 60 observations
  > x <- matrix(rnorm(60000), ncol=60)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > cor <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- base_wilcoxon_onesample(x, mus, alts, exact=ext, correct=cor)
  > res2 <- row_wilcoxon_onesample(x, mus, alts, exact=ext, correct=cor)
  > stopifnot(all.equal(res1, res2))
  > 
  > # 10 observations with ties and zeroes
  > x <- matrix(round(runif(10000, -15, 15)), ncol=10)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > mus[sample(length(mus), length(mus)/8)] <- 0
  > mus[sample(length(mus), length(mus)/8)] <- 1
  > cor <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- suppressWarnings(base_wilcoxon_onesample(x, mus, alts, exact=ext, correct=cor))
  > res2 <- suppressWarnings(row_wilcoxon_onesample(x, mus, alts, exact=ext, correct=cor))
  > stopifnot(all.equal(res1, res2))
  Error: res1 and res2 are not equal:
    Component "statistic": Mean relative difference: 0.1938291
    Component "pvalue": Mean relative difference: 0.02192928
    Component "corrected": 291 element mismatches
  Execution halted
Running the tests in ‘tests/wilcoxon_paired_correctness.r’ failed.
Complete output:
  > library(matrixTests)
  > 
  > #--- functions -----------------------------------------------------------------
  > 
  > base_wilcoxon_paired <- function(mat1, mat2, null=0, alternative="two.sided", exact=NA, correct=TRUE) {
  +   if(is.vector(mat1)) mat1 <- matrix(mat1, nrow=1)
  +   if(is.vector(mat2)) mat2 <- matrix(mat2, nrow=1)
  +   if(length(alternative)==1) alternative <- rep(alternative, nrow(mat1))
  +   if(length(null)==1) null <- rep(null, nrow(mat1))
  +   if(length(exact)==1) exact <- rep(exact, nrow(mat1))
  +   if(length(correct)==1) correct <- rep(correct, nrow(mat1))
  + 
  +   nx <- ny <- nxy <- stat <- p <- m0 <- numeric(nrow(mat1))
  +   al <- character(nrow(mat1))
  +   ext <- cor <- logical(nrow(mat1))
  +   for(i in 1:nrow(mat1)) {
  +     ex  <- if(is.na(exact[i])) NULL else exact[i]
  +     res <- wilcox.test(mat1[i,], mat2[i,], alternative=alternative[i], mu=null[i], paired=TRUE, exact=ex, correct=correct[i])
  + 
  +     inds <- complete.cases(mat1[i,], mat2[i,])
  +     vec1 <- mat1[i,inds]
  +     vec2 <- mat2[i,inds]
  +     nx[i]   <- sum(!is.na(mat1[i,]))
  +     ny[i]   <- sum(!is.na(mat2[i,]))
  +     nxy[i]  <- sum((vec1 - vec2 - null[i]) != 0, na.rm=TRUE)
  +     stat[i] <- res$statistic
  +     p[i]    <- res$p.value
  +     al[i]   <- res$alternative
  +     m0[i]   <- res$null.value
  + 
  +     cor[i] <- grepl("continuity correction", res$method)
  +     ext[i] <- if(is.na(exact[i])) (nxy[i] < 50) else exact[i]
  +     ext[i] <- if(length(unique(abs(vec1-vec2-m0[i]))) != length(vec1)) FALSE else ext[i]
  +     ext[i] <- if(any((vec1-vec2-m0[i]) == 0)) FALSE else ext[i]
  +   }
  + 
  +   data.frame(obs.x=nx, obs.y=ny, obs.paired=nxy, statistic=stat, pvalue=p,
  +              location.null=m0, alternative=al, exact=ext, corrected=cor,
  +              stringsAsFactors=FALSE
  +              )
  + }
  > 
  > 
  > #--- montecarlo ----------------------------------------------------------------
  > 
  > # 4 paired samples
  > x <- matrix(rnorm(4000), ncol=4)
  > y <- matrix(rnorm(4000), ncol=4)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > cor  <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext  <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- base_wilcoxon_paired(x, y, mus, alts, exact=ext, correct=cor)
  > res2 <- row_wilcoxon_paired(x, y, mus, alts, exact=ext, correct=cor)
  > stopifnot(all.equal(res1, res2))
  > 
  > # 60 paired samples
  > x <- matrix(rnorm(60000), ncol=60)
  > y <- matrix(rnorm(60000), ncol=60)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > cor  <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext  <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- base_wilcoxon_paired(x, y, mus, alts, exact=ext, correct=cor)
  > res2 <- row_wilcoxon_paired(x, y, mus, alts, exact=ext, correct=cor)
  > stopifnot(all.equal(res1, res2))
  > 
  > 
  > # 6 paired samples per group with ties and zeroes
  > x <- matrix(round(runif(6000, -10, 10)), ncol=6)
  > y <- matrix(round(runif(6000, -10, 10)), ncol=6)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > mus[sample(length(mus), length(mus)/8)] <- 0
  > mus[sample(length(mus), length(mus)/8)] <- 1
  > cor  <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext  <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- suppressWarnings(base_wilcoxon_paired(x, y, mus, alts, exact=ext, correct=cor))
  > res2 <- suppressWarnings(row_wilcoxon_paired(x, y, mus, alts, exact=ext, correct=cor))
  > stopifnot(all.equal(res1, res2))
  Error: res1 and res2 are not equal:
    Component "statistic": Mean relative difference: 0.2685789
    Component "pvalue": Mean relative difference: 0.05150233
    Component "corrected": 149 element mismatches
  Execution halted
Running the tests in ‘tests/wilcoxon_twosample_correctness.r’ failed.
Complete output:
  > library(matrixTests)
  > 
  > #--- functions -----------------------------------------------------------------
  > 
  > base_wilcoxon_twosample <- function(mat1, mat2, null=0, alternative="two.sided", exact=NA, correct=TRUE) {
  +   if(is.vector(mat1)) mat1 <- matrix(mat1, nrow=1)
  +   if(is.vector(mat2)) mat2 <- matrix(mat2, nrow=1)
  +   if(length(alternative)==1) alternative <- rep(alternative, nrow(mat1))
  +   if(length(null)==1) null <- rep(null, nrow(mat1))
  +   if(length(exact)==1) exact <- rep(exact, nrow(mat1))
  +   if(length(correct)==1) correct <- rep(correct, nrow(mat1))
  + 
  +   nx <- ny <- nxy <- stat <- p <- m0 <- numeric(nrow(mat1))
  +   al <- character(nrow(mat1))
  +   ext <- cor <- logical(nrow(mat1))
  +   for(i in 1:nrow(mat1)) {
  +     ex  <- if(is.na(exact[i])) NULL else exact[i]
  + 
  +     res <- wilcox.test(mat1[i,], mat2[i,], alternative=alternative[i], mu=null[i], exact=ex, correct=correct[i])
  + 
  +     nx[i]   <- sum(!is.na(mat1[i,]))
  +     ny[i]   <- sum(!is.na(mat2[i,]))
  +     nxy[i]  <- nx[i] + ny[i]
  +     stat[i] <- res$statistic
  +     p[i]    <- res$p.value
  +     al[i]   <- res$alternative
  +     m0[i]   <- res$null.value
  + 
  +     cor[i] <- grepl("continuity correction", res$method)
  +     ext[i] <- if(is.na(exact[i])) (nx[i] < 50 & ny[i] < 50) else exact[i]
  +     ext[i] <- if(length(unique(na.omit(c(mat1[i,]-m0[i], mat2[i,])))) != nxy[i]) FALSE else ext[i]
  +   }
  + 
  +   data.frame(obs.x=nx, obs.y=ny, obs.tot=nxy, statistic=stat, pvalue=p,
  +              location.null=m0, alternative=al, exact=ext, corrected=cor,
  +              stringsAsFactors=FALSE
  +              )
  + }
  > 
  > 
  > #--- montecarlo ----------------------------------------------------------------
  > 
  > # 2 samples in one group and 4 in another
  > x <- matrix(rnorm(2000), ncol=2)
  > y <- matrix(rnorm(4000), ncol=4)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > cor <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- base_wilcoxon_twosample(x, y, mus, alts, exact=ext, correct=cor)
  > res2 <- row_wilcoxon_twosample(x, y, mus, alts, exact=ext, correct=cor)
  > stopifnot(all.equal(res1, res2))
  > 
  > # 51 samples in one group and 51 in another
  > x <- matrix(rnorm(51000), ncol=51)
  > y <- matrix(rnorm(51000), ncol=51)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > cor <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- base_wilcoxon_twosample(x, y, mus, alts, exact=ext, correct=cor)
  > res2 <- row_wilcoxon_twosample(x, y, mus, alts, exact=ext, correct=cor)
  > stopifnot(all.equal(res1, res2))
  > 
  > # 4 samples in one group and 51 in another
  > x <- matrix(rnorm(4000), ncol=4)
  > y <- matrix(rnorm(51000), ncol=51)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > cor <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- base_wilcoxon_twosample(x, y, mus, alts, exact=ext, correct=cor)
  > res2 <- row_wilcoxon_twosample(x, y, mus, alts, exact=ext, correct=cor)
  > stopifnot(all.equal(res1, res2))
  > 
  > # 6 samples per group with ties and zeroes
  > x <- matrix(round(runif(6000, -15, 15)), ncol=6)
  > y <- matrix(round(runif(6000, -15, 15)), ncol=6)
  > alts <- sample(c("t", "g", "l"), nrow(x), replace=TRUE)
  > mus  <- runif(nrow(x), -1, 1)
  > mus[sample(length(mus), length(mus)/8)] <- 0
  > mus[sample(length(mus), length(mus)/8)] <- 1
  > cor <- sample(c(TRUE, FALSE), nrow(x), replace=TRUE)
  > ext <- sample(c(TRUE, FALSE, NA), nrow(x), replace=TRUE)
  > res1 <- suppressWarnings(base_wilcoxon_twosample(x, y, mus, alts, exact=ext, correct=cor))
  > res2 <- suppressWarnings(row_wilcoxon_twosample(x, y, mus, alts, exact=ext, correct=cor))
  > stopifnot(all.equal(res1, res2))
  Error: res1 and res2 are not equal:
    Component "pvalue": Mean relative difference: 0.02892939
    Component "corrected": 239 element mismatches
  Execution halted