Calculates the exact Wilcoxon signed rank test (using Pratt's method if there are zero values). Gives exact matching confidence intervals based on repeated calls to wilcoxsign_test.
Usage
wsrTest(x, y = NULL, conf.int = TRUE, conf.level = 0.95,
mu = 0, alternative = c("two.sided", "less", "greater"),
digits = NULL)
Arguments
x
numeric vector, either the difference (if y=NULL) or the first of the paired responses (so difference is x-y).
y
second of paired differences. If NULL assumes x is the vector of paired differences.
conf.int
logica, calculate confidence interval on median of differences
conf.level
confidence level
mu
null median difference
alternative
alternative hypothesis
digits
number of digits for accuracy of confidence intervals, results are accurate to round(ci,cidigits). If digits=NULL picks about 4 digits if the range of the differences is 0 to 1, with similar accuracy as the range changes (see details).
Details
This function calculate the exact Wilcoxon signed rank test using the Pratt method if there are zeros. In other words, rank the differences equal to zero together with the absolute value of the differences, but then permute the signs of only the non-zero ranks. The p-values are calculated using wilcoxsign_test, this function is just a wrapper to get confidence intervals.
Value
An object of class 'htest', list with elements:
estimate
Hodeges-Lehmann estimator of median difference
p.value
p.value associated with alternative
conf.int
confidence interval
null.value
null median difference
alternative
alternative
method
description of method
Author(s)
Michael P. Fay
References
Pratt, JW (1959). Remarks on zeros and ties in the Wilcoxon signed rank procedures. JASA 54(287) 655-667.