Learn R Programming

rcompanion (version 2.4.36)

wilcoxonOR: Agresti's Generalized Odds Ratio for Stochastic Dominance

Description

Calculates Agresti's Generalized Odds Ratio for Stochastic Dominance (OR) with confidence intervals by bootstrap

Usage

wilcoxonOR(
  formula = NULL,
  data = NULL,
  x = NULL,
  y = NULL,
  ci = FALSE,
  conf = 0.95,
  type = "perc",
  R = 1000,
  histogram = FALSE,
  digits = 3,
  reportIncomplete = FALSE,
  verbose = FALSE,
  ...
)

Value

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

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.

reportIncomplete

If FALSE (the default), NA will be reported in cases where there are instances of the calculation of the statistic failing during the bootstrap procedure.

verbose

If TRUE, reports the proportion of ties and the proportions of (Ya > Yb) and (Ya < Yb).

...

Additional arguments, not used.

Author

Salvatore Mangiafico, mangiafico@njaes.rutgers.edu

Details

OR is an effect size statistic appropriate in cases where a Wilcoxon-Mann-Whitney test might be used.

OR is defined as P(Ya > Yb) / P(Ya < Yb).

OR can range from 0 to infinity. An OR of 1 indicates stochastic equality between the two groups. An OR greater than 1 indicates that the first group dominates the second group. An OR less than 1 indicates that the second group dominates the first.

Be cautious with this interpretation, as R will alphabetize groups in the formula interface if the grouping variable is not already a factor.

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.

With a small sample size, or with an OR near its extremes, the confidence intervals determined by this method may not be reliable, or the procedure may fail.

References

Grissom, R.J. and J.J. Kim. 2012. Effect Sizes for Research. 2nd ed. Routledge, New York.

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

See Also

wilcoxonPS

Examples

Run this code
data(Catbus)
wilcoxonOR(Steps ~ Gender, data=Catbus, verbose=TRUE)

Run the code above in your browser using DataLab