wilcoxonRG {rcompanion} | R 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 |
group |
If |
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 |
digits |
The number of significant digits in the output. |
reportIncomplete |
If |
verbose |
If |
na.last |
Passed to |
... |
Additional arguments passed to |
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 NA
s 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
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)