wilcoxonRG: Glass rank biserial correlation coefficient

wilcoxonRGR Documentation

Glass rank biserial correlation coefficient

Description

Calculates Glass rank biserial correlation coefficient effect size for Mann-Whitney two-sample rank-sum test, or a table with an ordinal variable and a nominal variable with two levels; confidence intervals by bootstrap.

Usage

wilcoxonRG(
  x,
  g = NULL,
  group = "row",
  ci = FALSE,
  conf = 0.95,
  type = "perc",
  R = 1000,
  histogram = FALSE,
  digits = 3,
  reportIncomplete = FALSE,
  verbose = FALSE,
  na.last = NA,
  ...
)

Arguments

x

Either a two-way table or a two-way matrix. Can also be a vector of observations.

g

If x is a vector, g is the vector of observations for the grouping, nominal variable. Only the first two levels of the nominal variable are used.

group

If x is a table or matrix, group indicates whether the "row" or the "column" variable is the nominal, grouping variable.

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, prints information on factor levels and ranks.

na.last

Passed to rank. For example, can be set to TRUE to assign NA values a minimum rank.

...

Additional arguments passed to rank

Details

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.

NA values can be handled by the rank function. In this case, using verbose=TRUE is helpful to understand how the rg statistic is calculated. Otherwise, it is recommended that NAs be removed beforehand.

When the data in the first group are greater than in the second group, rg is positive. When the data in the second group are greater than in the first group, rg is negative.

Be cautious with this interpretation, as R will alphabetize groups if g is not already a factor.

When rg is close to extremes, or with small counts in some cells, the confidence intervals determined by this method may not be reliable, or the procedure may fail.

Value

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

Author(s)

Salvatore Mangiafico, mangiafico@njaes.rutgers.edu

References

King, B.M., P.J. Rosopa, and E.W. Minium. 2011. Statistical Reasoning in the Behavioral Sciences, 6th ed.

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

See Also

wilcoxonR

Examples

data(Breakfast)
Table = Breakfast[1:2,]
library(coin)
chisq_test(Table, scores = list("Breakfast" = c(-2, -1, 0, 1, 2)))
wilcoxonRG(Table)

data(Catbus)
wilcox.test(Steps ~ Gender, data = Catbus)
wilcoxonRG(x = Catbus$Steps, g = Catbus$Gender)

### Example from King, Rosopa, and Minium
Criticism = c(-3, -2, 0, 0, 2, 5, 7, 9)
Praise = c(0, 2, 3, 4, 10, 12, 14, 19, 21)
Y = c(Criticism, Praise)
Group = factor(c(rep("Criticism", length(Criticism)),  
                rep("Praise", length(Praise))))
wilcoxonRG(x = Y, g = Group, verbose=TRUE)


rcompanion documentation built on May 29, 2024, 8:42 a.m.