This function performs a MannWhitneyUTest (or Wilcoxon rank sum test,
see wilcox.test
and wilcox_test
)
for x
, for each group indicated by grp
. If grp
has more than two categories, a comparison between each combination of
two groups is performed.
The function reports U, p and Zvalues as well as effect size r
and grouprankmeans.
mwu(
data,
x,
grp,
distribution = "asymptotic",
out = c("txt", "viewer", "browser"),
encoding = "UTF8",
file = NULL
)
mannwhitney(
data,
x,
grp,
distribution = "asymptotic",
out = c("txt", "viewer", "browser"),
encoding = "UTF8",
file = NULL
)
data  A data frame. 

x  Bare (unquoted) variable name, or a character vector with the variable name. 
grp  Bare (unquoted) name of the crossclassifying variable, where

distribution  Indicates how the null distribution of the test statistic should be computed.
May be one of 
out  Character vector, indicating whether the results should be printed
to console ( 
encoding  Character vector, indicating the charset encoding used
for variable and value labels. Default is 
file  Destination file, if the output should be saved as file.
Only used when 
(Invisibly) returns a data frame with U, p and Zvalues for each groupcomparison as well as effectsize r; additionally, grouplabels and groups' n's are also included.
This function calls the wilcox_test
with formula. If grp
has more than two groups, additionally a KruskalWallisTest (see kruskal.test
)
is performed.
Interpretation of effect sizes, as a ruleofthumb:
small effect >= 0.1
medium effect >= 0.3
large effect >= 0.5
data(efc)
# MannWhitneyUTests for elder's age by elder's dependency.
mwu(efc, e17age, e42dep)
#>
#> # MannWhitneyUTest
#>
#> Groups 1 = independent (n = 65)  2 = slightly dependent (n = 224):
#> U = 7635.000, W = 5490.000, p = 0.003, Z = 3.020
#> effectsize r = 0.178
#> rankmean(1) = 117.46
#> rankmean(2) = 152.99
#>
#> Groups 1 = independent (n = 65)  3 = moderately dependent (n = 304):
#> U = 8692.000, W = 6547.000, p < .001, Z = 4.273
#> effectsize r = 0.222
#> rankmean(1) = 133.72
#> rankmean(3) = 195.96
#>
#> Groups 1 = independent (n = 65)  4 = severely dependent (n = 297):
#> U = 7905.500, W = 5760.500, p < .001, Z = 5.096
#> effectsize r = 0.268
#> rankmean(1) = 121.62
#> rankmean(4) = 194.60
#>
#> Groups 2 = slightly dependent (n = 224)  3 = moderately dependent (n = 304):
#> U = 54664.500, W = 29464.500, p = 0.008, Z = 2.647
#> effectsize r = 0.115
#> rankmean(2) = 244.04
#> rankmean(3) = 279.58
#>
#> Groups 2 = slightly dependent (n = 224)  4 = severely dependent (n = 297):
#> U = 51007.500, W = 25807.500, p < .001, Z = 4.386
#> effectsize r = 0.192
#> rankmean(2) = 227.71
#> rankmean(4) = 286.11
#>
#> Groups 3 = moderately dependent (n = 304)  4 = severely dependent (n = 297):
#> U = 87819.500, W = 41459.500, p = 0.083, Z = 1.732
#> effectsize r = 0.071
#> rankmean(3) = 288.88
#> rankmean(4) = 313.41
#>
#> # KruskalWallisTest
#>
#> chisquared = 38.476
#> df = 3
#> p < .001***