Wilcoxon z statistic
wilcoxonZ.RdCalculates the z statistic for a Wilcoxon two-sample, paired, or one-sample test.
Arguments
- x
A vector of observations.
- y
For the two-sample and paired cases, a second vector of observations.
- mu
For the one-sample case, the value to compare
xto, as inwilcox.test- paired
As used in
wilcox.test.- exact
As used in
wilcox.test, default here isFALSE.- correct
As used in
wilcox.test, default here isFALSE.- digits
The number of significant digits in the output.
Details
This function uses code from wilcox.test,
and reports the z statistic,
which is calculated by the original function
but isn't returned.
The returned value will be NA if the function attempts an exact test.
For the paired case, the observations in x and
and y should be ordered such that the
first observation in x is paired with the first observation
in y, and so on.
Author
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu, R Core Team
Examples
data(Pooh)
wilcoxonZ(x = Pooh$Likert[Pooh$Time==1], y = Pooh$Likert[Pooh$Time==2],
paired=TRUE, exact=FALSE, correct=FALSE)
#> z
#> -2.33