Pairwise Vargha and Delaney's A and Cliff's delta
multiVDA.RdCalculates Vargha and Delaney's A (VDA), Cliff's delta (CD), and the Glass rank biserial coefficient, rg, for several groups in a pairwise manner.
Usage
multiVDA(
formula = NULL,
data = NULL,
x = NULL,
g = NULL,
statistic = "VDA",
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.
- g
If no formula is given, the grouping variable.
- statistic
One of
"VDA","CD", or"rg". This determines which statistic will be evaluated to determine the comparison with the most divergent groups.- digits
The number of significant digits in the output.
- ...
Additional arguments passed to the
wilcox.testfunction.
Value
A list containing a data frame of pairwise statistics, and the comparison with the most extreme value of the chosen statistic.
Details
VDA and CD are effect size statistic appropriate in cases where a Wilcoxon-Mann-Whitney test might be used. Here, the pairwise approach would be used in cases where a Kruskal-Wallis test might be used. VDA ranges from 0 to 1, with 0.5 indicating stochastic equality, and 1 indicating that the first group dominates the second. CD ranges from -1 to 1, with 0 indicating stochastic equality, and 1 indicating that the first group dominates the second. rg ranges from -1 to 1, depending on sample size, with 0 indicating no effect, and a positive result indicating that values in the first group are greater than in the second.
Be cautious with this interpretation, as R will alphabetize groups in the formula interface if the grouping variable is not already a factor.
In the function output,
VDA.m is the greater of VDA or 1-VDA.
CD.m is the absolute value of CD.
rg.m is the absolute value of rg.
The function calculates VDA and Cliff's delta from the "W"
U statistic from the
wilcox.test function.
Specifically, VDA = U/(n1*n2); CD = (VDA-0.5)*2.
rg is calculated as 2 times the difference of mean of ranks for each group divided by the total sample size. It appears that rg is equivalent to Cliff's delta.
The input should include either formula and data;
or var, and group.
Currently, the function makes no provisions for NA
values in the data. It is recommended that NAs be removed
beforehand.
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
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
Examples
data(PoohPiglet)
multiVDA(Likert ~ Speaker, data=PoohPiglet)
#> $pairs
#> Comparison VDA CD rg VDA.m CD.m rg.m
#> 1 Piglet - Pooh 0.05 -0.90 -0.90 0.95 0.90 0.90
#> 2 Piglet - Tigger 0.07 -0.86 -0.86 0.93 0.86 0.86
#> 3 Pooh - Tigger 0.58 0.16 0.16 0.58 0.16 0.16
#>
#> $comparison
#> Comparison
#> "Piglet - Pooh"
#>
#> $statistic
#> VDA
#> 0.05
#>
#> $statistic.m
#> VDA.m
#> 0.95
#>