Compute the rank-biserial correlation, Cliff's delta, rank Epsilon squared, and Kendall's W effect sizes for non-parametric (rank sum) tests.

rank_biserial(
x,
y = NULL,
data = NULL,
mu = 0,
ci = 0.95,
iterations = 200,
paired = FALSE,
verbose = TRUE,
...
)

cliffs_delta(
x,
y = NULL,
data = NULL,
mu = 0,
ci = 0.95,
iterations = 200,
verbose = TRUE,
...
)

rank_epsilon_squared(x, groups, data = NULL, ci = 0.95, iterations = 200, ...)

kendalls_w(
x,
groups,
blocks,
data = NULL,
ci = 0.95,
iterations = 200,
verbose = TRUE,
...
)

## Arguments

x Can be one of: A numeric vector, or a character name of one in data. A formula in to form of DV ~ groups (for rank_biserial() and rank_epsilon_squared()) or DV ~ groups | blocks (for kendalls_w(); See details for the blocks and groups terminology used here). A list of vectors (for rank_epsilon_squared()). A matrix of blocks x groups (for kendalls_w()). See details for the blocks and groups terminology used here. An optional numeric vector of data values to compare to x, or a character name of one in data. Ignored if x is not a vector. An optional data frame containing the variables. a number indicating the value around which (a-)symmetry (for one-sample or paired samples) or shift (for independent samples) is to be estimated. See stats::wilcox.test. Confidence Interval (CI) level The number of bootstrap replicates for computing confidence intervals. Only applies when ci is not NULL. If TRUE, the values of x and y are considered as paired. This produces an effect size that is equivalent to the one-sample effect size on x - y. Toggle warnings and messages on or off. Arguments passed to or from other methods. A factor vector giving the group / block for the corresponding elements of x, or a character name of one in data. Ignored if x is not a vector.

## Value

A data frame with the effect size (r_rank_biserial, rank_epsilon_squared or Kendalls_W) and its CI (CI_low and CI_high).

## Details

The rank-biserial correlation is appropriate for non-parametric tests of differences - both for the one sample or paired samples case, that would normally be tested with Wilcoxon's Signed Rank Test (giving the matched-pairs rank-biserial correlation) and for two independent samples case, that would normally be tested with Mann-Whitney's U Test (giving Glass' rank-biserial correlation). See stats::wilcox.test. In both cases, the correlation represents the difference between the proportion of favorable and unfavorable pairs / signed ranks (Kerby, 2014). Values range from -1 indicating that all values of the second sample are smaller than the first sample, to +1 indicating that all values of the second sample are larger than the first sample. (Cliff's delta is an alias to the rank-biserial correlation in the two sample case.)

The rank Epsilon squared is appropriate for non-parametric tests of differences between 2 or more samples (a rank based ANOVA). See stats::kruskal.test. Values range from 0 to 1, with larger values indicating larger differences between groups.

Kendall's W is appropriate for non-parametric tests of differences between 2 or more dependent samples (a rank based rmANOVA), where each group (e.g., experimental condition) was measured for each block (e.g., subject). This measure is also common as a measure of reliability of the rankings of the groups between raters (blocks). See stats::friedman.test. Values range from 0 to 1, with larger values indicating larger differences between groups / higher agreement between raters.

### Ties

When tied values occur, they are each given the average of the ranks that would have been given had no ties occurred. No other corrections have been implemented yet.

## Confidence Intervals

Confidence Intervals are estimated using the bootstrap method.

## References

• Cureton, E. E. (1956). Rank-biserial correlation. Psychometrika, 21(3), 287-290.

• Glass, G. V. (1965). A ranking variable analogue of biserial correlation: Implications for short-cut item analysis. Journal of Educational Measurement, 2(1), 91-95.

• Kendall, M.G. (1948) Rank correlation methods. London: Griffin.

• Kerby, D. S. (2014). The simple difference formula: An approach to teaching nonparametric correlation. Comprehensive Psychology, 3, 11-IT.

• King, B. M., & Minium, E. W. (2008). Statistical reasoning in the behavioral sciences. John Wiley & Sons Inc.

• Cliff, N. (1993). Dominance statistics: Ordinal analyses to answer ordinal questions. Psychological bulletin, 114(3), 494.

• Tomczak, M., & Tomczak, E. (2014). The need to report effect size estimates revisited. An overview of some recommended measures of effect size.

Other effect size indices: cohens_d(), effectsize(), eta_squared(), phi(), standardize_parameters()

## Examples

# \donttest{
# two-sample tests -----------------------

A <- c(48, 48, 77, 86, 85, 85)
B <- c(14, 34, 34, 77)
rank_biserial(A, B)
#> r (rank biserial) |       95% CI
#> --------------------------------
#> 0.79              | [0.25, 1.00]
x <- c(1.83, 0.50, 1.62, 2.48, 1.68, 1.88, 1.55, 3.06, 1.30)
y <- c(0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29)
rank_biserial(x, y, paired = TRUE)
#> r (rank biserial) |       95% CI
#> --------------------------------
#> 0.78              | [0.33, 1.00]
# one-sample tests -----------------------
x <- c(1.15, 0.88, 0.90, 0.74, 1.21)
rank_biserial(x, mu = 1)
#> r (rank biserial) |        95% CI
#> ---------------------------------
#> -0.07             | [-1.00, 0.87]
#>
#> - Deviation from a difference of 1.
# anova tests ----------------------------

x1 <- c(2.9, 3.0, 2.5, 2.6, 3.2) # control group
x2 <- c(3.8, 2.7, 4.0, 2.4) # obstructive airway disease group
x3 <- c(2.8, 3.4, 3.7, 2.2, 2.0) # asbestosis group
x <- c(x1, x2, x3)
g <- factor(rep(1:3, c(5, 4, 5)))
rank_epsilon_squared(x, g)
#> Epsilon2 (rank) |       95% CI
#> ------------------------------
#> 0.06            | [0.01, 0.71]
wb <- aggregate(warpbreaks$breaks, by = list( w = warpbreaks$wool,
t = warpbreaks\$tension
),
FUN = mean
)
kendalls_w(x ~ w | t, data = wb)
#> Warning: Variable x.A contains only two different values. Consider converting it to a factor.Variable x.B contains only two different values. Consider converting it to a factor.#> Warning: Variable x.A contains only two different values. Consider converting it to a factor.Variable x.B contains only two different values. Consider converting it to a factor.#> Warning: Variable x.A contains only two different values. Consider converting it to a factor.Variable x.B contains only two different values. Consider converting it to a factor.#> Kendall's W |       95% CI
#> --------------------------
#> 0.11        | [0.11, 1.00]# }