cliffDelta {rcompanion} | R Documentation |
Cliff's delta
Description
Calculates Cliff's delta with confidence intervals by bootstrap
Usage
cliffDelta(
formula = NULL,
data = NULL,
x = NULL,
y = NULL,
ci = FALSE,
conf = 0.95,
type = "perc",
R = 1000,
histogram = FALSE,
reportIncomplete = FALSE,
brute = FALSE,
verbose = FALSE,
digits = 3,
...
)
Arguments
formula |
A formula indicating the response variable and the independent variable. e.g. y ~ group. |
data |
The data frame to use. |
x |
If no formula is given, the response variable for one group. |
y |
The response variable for the other group. |
ci |
If |
conf |
The level for the confidence interval. |
type |
The type of confidence interval to use.
Can be any of " |
R |
The number of replications to use for bootstrap. |
histogram |
If |
reportIncomplete |
If |
brute |
If |
verbose |
If |
digits |
The number of significant digits in the output. |
... |
Additional arguments passed to the |
Details
Cliff's delta is an effect size statistic appropriate in cases where a Wilcoxon-Mann-Whitney test might be used. It ranges from -1 to 1, with 0 indicating stochastic equality, and 1 indicating that the first group dominates the second. It is linearly related to Vargha and Delaney's A.
By default, the function calculates Cliff's delta from the "W"
U statistic from the
wilcox.test
function.
Specifically, VDA = U/(n1*n2); CD = (VDA-0.5)*2
.
The input should include either formula
and data
;
or x
, and y
. If there are more than two groups,
only the first two groups are used.
Currently, the function makes no provisions for NA
values in the data. It is recommended that NA
s be removed
beforehand.
When the data in the first group are greater than in the second group, Cliff's delta is positive. When the data in the second group are greater than in the first group, Cliff's delta is negative.
Be cautious with this interpretation, as R will alphabetize groups in the formula interface if the grouping variable is not already a factor.
When Cliff's delta is close to 1 or close to -1, or with small sample size, the confidence intervals determined by this method may not be reliable, or the procedure may fail.
Value
A single statistic, Cliff's delta. Or a small data frame consisting of Cliff's delta, and the lower and upper confidence limits.
Note
The parsing of the formula is simplistic. The first variable on the left side is used as the measurement variable. The first variable on the right side is used for the grouping variable
Author(s)
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
References
https://rcompanion.org/handbook/F_04.html
See Also
Examples
data(Catbus)
cliffDelta(Steps ~ Gender, data=Catbus)