Rank biserial correlation coefficient for one-sample Wilcoxon test
wilcoxonOneSampleRC.RdCalculates rank biserial correlation coefficient effect size for one-sample Wilcoxon signed-rank test; confidence intervals by bootstrap.
Usage
wilcoxonOneSampleRC(
x,
mu = NULL,
zero.method = "Wilcoxon",
ci = FALSE,
conf = 0.95,
type = "perc",
R = 1000,
histogram = FALSE,
digits = 3,
verbose = FALSE,
...
)Arguments
- x
A vector of observations.
- mu
The value to compare
xto, as inwilcox.test- zero.method
If
"Wilcoxon", differences of zero are discarded and then ranks are determined. If"Pratt", ranks are determined, and then differences of zero are discarded. If"none", differences of zero are not discarded.- ci
If
TRUE, returns confidence intervals by bootstrap. May be slow.- conf
The level for the confidence interval.
- type
The type of confidence interval to use. Can be any of "
norm", "basic", "perc", or "bca". Passed toboot.ci.- R
The number of replications to use for bootstrap.
- histogram
If
TRUE, produces a histogram of bootstrapped values.- digits
The number of significant digits in the output.
- verbose
If
TRUE, prints information on sample size and ranks.- ...
Additional arguments passed to the
wilcoxsign_testfunction.
Value
A single statistic, rc. Or a small data frame consisting of rc, and the lower and upper confidence limits.
Details
It is recommended that NAs be removed
beforehand.
When rc is close to extremes, or with small counts in some cells, the confidence intervals determined by this method may not be reliable, or the procedure may fail.
Author
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
Examples
### Example with one zero difference
A = c(11,12,13,14,15,16,17,18,19,20)
#' wilcoxonOneSampleRC(x = A, mu=15)
wilcoxonOneSampleRC(x = A, mu=15, verbose=TRUE, zero.method="Wilcoxon")
#>
#> zero.method: Wilcoxon
#> n kept = 9
#> Ranks plus = 18
#> Ranks minus = 27
#> T value = 18
#>
#> rc
#> 0.2
wilcoxonOneSampleRC(x = A, mu=15, verbose=TRUE, zero.method="Pratt")
#>
#> zero.method: Pratt
#> n kept = 9
#> Ranks plus = 22
#> Ranks minus = 32
#> T value = 22
#>
#> rc
#> 0.222
wilcoxonOneSampleRC(x = A, mu=15, verbose=TRUE, zero.method="none")
#>
#> zero.method: none
#> n kept = 10
#> Ranks plus = 22
#> Ranks minus = 32
#> T value = 22
#>
#> rc
#> 0.182