Calculates r effect size for a Wilcoxon one-sample signed-rank test; confidence intervals by bootstrap.
wilcoxonOneSampleR(x, mu = NULL, ci = FALSE, conf = 0.95,
type = "perc", R = 1000, histogram = FALSE, digits = 3, ...)
A vector of observations of an ordinal variable.
The value to compare x
to, as in wilcox.test
If TRUE
, returns confidence intervals by bootstrap.
May be slow.
The level for the confidence interval.
The type of confidence interval to use.
Can be any of "norm
", "basic
",
"perc
", or "bca
".
Passed to boot.ci
.
The number of replications to use for bootstrap.
If TRUE
, produces a histogram of bootstrapped values.
The number of significant digits in the output.
Additional arguments passed to the wilcoxsign_test
function.
A single statistic, r. Or a small data frame consisting of r, and the lower and upper confidence limits.
A Z value is extracted from the wilcoxsign_test
function in the
coin package. r is calculated as Z divided by
square root of the number of observations.
The calculated statistic is equivalent to the statistic returned
by the wilcoxPairedR
function with one group equal
to a vector of mu
.
The author knows of no reference for this technique.
Currently, the function makes no provisions for NA
values in the data. It is recommended that NA
s be removed
beforehand.
When the data are greater than mu
, r is positive.
When the data are less than mu
, r is negative.
When r 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.
# NOT RUN {
data(Pooh)
Data = Pooh[Pooh$Time==2,]
wilcox.test(Data$Likert, mu=3, exact=FALSE)
wilcoxonOneSampleR(x = Data$Likert, mu=3)
# }
Run the code above in your browser using DataLab