Compute the rankbiserial correlation (\(r_{rb}\)), Cliff's delta (\(\delta\)), rank epsilon squared (\(\varepsilon^2\)), and Kendall's W effect sizes for nonparametric (rank sum) tests.
rank_biserial(
x,
y = NULL,
data = NULL,
mu = 0,
ci = 0.95,
alternative = "two.sided",
paired = FALSE,
verbose = TRUE,
...,
iterations
)
cliffs_delta(
x,
y = NULL,
data = NULL,
mu = 0,
ci = 0.95,
alternative = "two.sided",
verbose = TRUE,
...
)
rank_epsilon_squared(
x,
groups,
data = NULL,
ci = 0.95,
alternative = "greater",
iterations = 200,
...
)
kendalls_w(
x,
groups,
blocks,
data = NULL,
ci = 0.95,
alternative = "greater",
iterations = 200,
verbose = TRUE,
...
)
x  Can be one of:


y  An optional numeric vector of data values to compare to 
data  An optional data frame containing the variables. 
mu  a number indicating the value around which (a)symmetry (for onesample or paired samples) or shift (for independent samples) is to be estimated. See stats::wilcox.test. 
ci  Confidence Interval (CI) level 
alternative  a character string specifying the alternative hypothesis;
Controls the type of CI returned: 
paired  If 
verbose  Toggle warnings and messages on or off. 
...  Arguments passed to or from other methods. 
iterations  The number of bootstrap replicates for computing confidence
intervals. Only applies when 
groups, blocks  A factor vector giving the group / block for the
corresponding elements of 
A data frame with the effect size (r_rank_biserial
,
rank_epsilon_squared
or Kendalls_W
) and its CI (CI_low
and
CI_high
).
The rankbiserial correlation is appropriate for nonparametric 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
matchedpairs rankbiserial correlation) and for two independent samples
case, that would normally be tested with MannWhitney's U Test (giving
Glass' rankbiserial 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
rankbiserial correlation in the two sample case.)
The rank epsilon squared is appropriate for nonparametric 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 nonparametric 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.
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 for the rankbiserial correlation (and Cliff's delta)
are estimated using the normal approximation (via Fisher's transformation).
Confidence intervals for rank Epsilon squared, and Kendall's W are
estimated using the bootstrap method (using the {boot}
package).
Cureton, E. E. (1956). Rankbiserial correlation. Psychometrika, 21(3), 287290.
Glass, G. V. (1965). A ranking variable analogue of biserial correlation: Implications for shortcut item analysis. Journal of Educational Measurement, 2(1), 9195.
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, 11IT.
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()
# \donttest{
data(mtcars)
mtcars$am < factor(mtcars$am)
mtcars$cyl < factor(mtcars$cyl)
# Rank Biserial Correlation
# =========================
# Two Independent Samples 
rank_biserial(mpg ~ am, data = mtcars)
#> r (rank biserial)  95% CI
#> 
#> 0.66  [0.84, 0.36]
# Same as:
# rank_biserial("mpg", "am", data = mtcars)
# rank_biserial(mtcars$mpg[mtcars$am=="0"], mtcars$mpg[mtcars$am=="1"])
# More options:
rank_biserial(mpg ~ am, data = mtcars, mu = 5)
#> r (rank biserial)  95% CI
#> 
#> 0.21  [0.56, 0.20]
#>
#>  Deviation from a difference of 5.
# One Sample 
rank_biserial(wt ~ 1, data = mtcars, mu = 3)
#> r (rank biserial)  95% CI
#> 
#> 0.21  [0.18, 0.54]
#>
#>  Deviation from a difference of 3.
# same as:
# rank_biserial("wt", data = mtcars, mu = 3)
# rank_biserial(mtcars$wt, mu = 3)
# Paired Samples 
dat < data.frame(Cond1 = c(1.83, 0.5, 1.62, 2.48, 1.68, 1.88, 1.55, 3.06, 1.3),
Cond2 = c(0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29))
(rbs < rank_biserial(Pair(Cond1, Cond2) ~ 1, data = dat, paired = TRUE))
#> r (rank biserial)  95% CI
#> 
#> 0.78  [0.30, 0.94]
# same as:
# rank_biserial(dat$Cond1, dat$Cond2, paired = TRUE)
interpret_rank_biserial(0.78)
#> [1] "very large"
#> (Rules: funder2019)
#>
interpret(rbs, rules = "funder2019")
#> r (rank biserial)  95% CI  Interpretation
#> 
#> 0.78  [0.30, 0.94]  very large
#>
#> (Interpretation rule: funder2019)
# Rank Epsilon Squared
# ====================
rank_epsilon_squared(mpg ~ cyl, data = mtcars)
#> Epsilon2 (rank)  95% CI
#> 
#> 0.83  [0.78, 1.00]
#>
#>  Onesided CIs: upper bound fixed at (1).
# Kendall's W
# ===========
dat < data.frame(cond = c("A", "B", "A", "B", "A", "B"),
ID = c("L", "L", "M", "M", "H", "H"),
y = c(44.56, 28.22, 24, 28.78, 24.56, 18.78))
(W < kendalls_w(y ~ cond  ID, data = dat, verbose = FALSE))
#> Kendall's W  95% CI
#> 
#> 0.11  [0.11, 1.00]
#>
#>  Onesided CIs: upper bound fixed at (1).
interpret_kendalls_w(0.11)
#> [1] "slight agreement"
#> (Rules: landis1977)
#>
interpret(W, rules = "landis1977")
#> Kendall's W  95% CI  Interpretation
#> 
#> 0.11  [0.11, 1.00]  slight agreement
#>
#>  Onesided CIs: upper bound fixed at (1).
#> (Interpretation rule: landis1977)
# }