Learn R Programming

sjmisc (version 1.0.2)

mwu: Performs a Mann-Whitney-U-Test

Description

This function performs a Mann-Whitney-U-Test (or Wilcoxon rank sum test, see wilcox.test and wilcox_test) for the variable var, which is divided into groups indicated by grp (so the formula var ~ grp is used). If grp has more than two categories, a comparison between each two groups is performed. The function reports U, p and Z-values as well as effect size r and group-rank-means.

Usage

mwu(var, grp, distribution = "asymptotic", weights = NULL)

Arguments

var
A numeric vector / variable, where the Mann-Whitney-U-Test should be applied to.
grp
The grouping variable indicating the groups that should be used for comparison.
distribution
indicates how the null distribution of the test statistic should be computed. Mey be one of exact, approximate or asymptotic (default). See wilcox_test for det
weights
defining integer valued weights for the observations. By default, this is NULL.

Value

  • (Invisibly) returns a data frame with U, p and Z-values for each group-comparison as well as effect-size r; additionally, group-labels and groups' n's are also included.

Examples

Run this code
data(efc)
# Mann-Whitney-U-Tests for elder's age by elder's dependency.
mwu(efc$e17age, efc$e42dep)

Run the code above in your browser using DataLab