- Home
- Appointment Information
- Workshops
- Information for Staff
- Stats ResourcesToggle Dropdown
- Stats with SPSSToggle Dropdown
- Independent-Samples t-Test
- Paired-Samples t-Test
- Mann Whitney U-Test
- Wilcoxon Signed-Ranks Test
- One-Way Between-Subjects ANOVA
- One-Way Repeated-Measures ANOVA
- Two-Way Mixed ANOVA
- One-Way Between-Subjects ANCOVA
- Kruskal Wallis H-Test
- Friedman's ANOVA
- Pearson's 'r' Correlation
- Spearman's Rho Correlation
- Simple Linear Regression
- Multiple Linear Regression
- Chi-Squared (χ2) Test of Association
- Shapiro-Wilk Test of Normality
- Cronbach's Alpha

- Stats with R
- Stats with JamoviToggle Dropdown
- Maths ResourcesToggle Dropdown
- Numeracy ResourcesToggle Dropdown
- Stats/Maths Software
- A-Z of Terminology
- Meet the Team

A Mann-Whitney U-Test compares the means between two unrelated groups, such as comparing the difference in heights between Cats and Yorkshire Terriers.

It is considered a non-parametric test and therefore is suitable for non-parametric data. To check if your data is parametric, please check our dedicated guide: **Parametric or Not Guide (PDF)**

If your data is parametric you should consider using an** Independent-Samples t-Test**

The Mann-Whitney U test is also known as the Wilcoxon rank sum test and will be displayed as such in the R output. It is different from the Wilcoxon signed rank test, which is a test for paired samples. Both types of tests fall under the wilcox.test() function in R, with a “paired” argument denoting which of the two tests are run (FALSE/TRUE). By default, the argument is FALSE, meaning that the function will run a Mann-Whitney U.

This is used for when the data is structured using a grouping variable. A grouping variable is a categorical variable indicating which scores belong to different groups.

Data:

The first argument entered in the wilcox.test() function is a formula that takes the following structure:

dependent variable ~ independent variable

The second argument is the data frame.

`wilcox.test(Height ~ Species, pet_height1)`

```
## Warning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot
## compute exact p-value with ties
```

```
##
## Wilcoxon rank sum test with continuity correction
##
## data: Height by Species
## W = 35.5, p-value = 0.1012
## alternative hypothesis: true location shift is not equal to 0
```

This method is used when your data is structured into two separate variables. Both of your variables should be numeric.

Data:

Put both of your variables in the wilcox.test() function in any order. If you have your variables stored in a data frame, use the following structure to indicate the variable: data_frame$variable_name

`wilcox.test(pet_height2$cat_height, pet_height2$york_height)`

```
## Warning in wilcox.test.default(pet_height2$cat_height,
## pet_height2$york_height): cannot compute exact p-value with ties
```

```
##
## Wilcoxon rank sum test with continuity correction
##
## data: pet_height2$cat_height and pet_height2$york_height
## W = 35.5, p-value = 0.1012
## alternative hypothesis: true location shift is not equal to 0
```

R will generate largely the same output for both formula and variables methods.

The results of the tests will not include any descriptive statistics. As medians and inter-quartile ranges are commonly reported, please check our guide on **descriptive statistics**.

The table output shows the Mann-Whitney U statistic (W) and the p-value.

*Mdn* = 29.27) were taller than the Cats (*Mdn* = 28.00) however a Mann-Whitney U test indicated that this difference was not statistically significant, *W *(*N*_{Cats}=11, *N*_{Terriers}=11) = 35.5, *p *= .101.

- Last Updated: Jun 25, 2024 12:16 PM
- URL: https://guides.library.lincoln.ac.uk/mash
- Print Page

© University of Lincoln