rcompanion (version 2.2.2)

vda: Vargha and Delaney's A

Description

Calculates Vargha and Delaney's A (VDA) with confidence intervals by bootstrap

Usage

vda(formula = NULL, data = NULL, x = NULL, y = NULL, ci = FALSE,
  conf = 0.95, type = "perc", R = 1000, histogram = 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 TRUE, returns confidence intervals by bootstrap. May be slow.

conf

The level for the confidence interval.

type

The type of confidence interval to use. Can be any of "norm", "basic", "perc", or "bca". Passed to boot.ci.

R

The number of replications to use for bootstrap.

histogram

If TRUE, produces a histogram of bootstrapped values.

digits

The number of significant digits in the output.

...

Additional arguments passed to the wilcox.test function.

Value

A single statistic, VDA. Or a small data frame consisting of VDA, and the lower and upper confidence limits.

Details

VDA is an effect size statistic appropriate in cases where a Wilcoxon-Mann-Whitney test might be used. It ranges from 0 to 1, with 0.5 indicating stochastic equality, and 1 indicating that the first group dominates the second.

The function calculates VDA from the "W" U statistic from the wilcox.test function. Specifically, VDA = U/(n1*n2).

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

When the data in the first group are greater than in the second group, vda is greater than 0.5. When the data in the second group are greater than in the first group, vda is less than 0.5. Be cautious with this interpretation, as R will alphabetize groups in the formula interface if the grouping variable is not already a factor.

When VDA is close to 0 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.

References

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

See Also

cliffDelta, multiVDA

Examples

Run this code
# NOT RUN {
data(Catbus)
vda(Steps ~ Sex, data=Catbus)

# }

Run the code above in your browser using DataCamp Workspace