Grissom and Kim's Probability of Superiority (PS)
wilcoxonPS.RdCalculates Grissom and Kim's Probability of Superiority (PS) with confidence intervals by bootstrap
Usage
wilcoxonPS(
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,
...
)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 toboot.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),NAwill 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.
Value
A single statistic, PS. Or a small data frame consisting of PS, and the lower and upper confidence limits.
Details
PS 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.
PS is defined as P(Ya > Yb), with no provision made for tied values across groups.
If there are no tied values, PS will be equal to VDA.
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, PS is greater than 0.5. When the data in the second group are greater than in the first group, PS 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 PS 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.
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.
References
Grissom, R.J. and J.J. Kim. 2012. Effect Sizes for Research. 2nd ed. Routledge, New York.
Author
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
Examples
data(Catbus)
wilcoxonPS(Steps ~ Gender, data=Catbus, verbose=TRUE)
#>
#> Statistic Value
#> 1 Proportion Ya > Yb 0.697
#> 2 Proportion Ya < Yb 0.152
#> 3 Proportion ties 0.152
#>
#> PS
#> 0.697