SRAT without adjustment for additional covariates
srat0(Y, Z, n_ptb = 1000)
# Data from wilcox.test
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)
wilcox.test(x, y)
#>
#> Wilcoxon rank sum exact test
#>
#> data: x and y
#> W = 35, p-value = 0.2544
#> alternative hypothesis: true location shift is not equal to 0
#>
# SRAT p-value
set.seed(123)
Y <- c(x, y)
Z <- rep(0:1, c(length(x), length(y)))
srat0(Y, Z)$p_value
#> [1] 0.2758489