Learn R Programming

rcompanion (version 1.13.2)

wilcoxonOneSampleR: r effect size for Wilcoxon one-sample signed-rank test

Description

Calculates r effect size for a Wilcoxon one-sample signed-rank test.

Usage

wilcoxonOneSampleR(x, mu = NULL, digits = 3, ...)

Arguments

x

A vector of observations of an ordinal variable.

mu

The value to compare x to, as in wilcox.test

digits

The number of significant digits in the output.

...

Additional arguments passed to the wilcoxsign_test function.

Value

A single statistic, r

Details

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 NAs be removed beforehand.

References

http://rcompanion.org/handbook/F_02.html

Examples

Run this code
# 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