# How many « degrees of freedom » should a Wilcoxon rank-sum test have?

I would like to perform a Mann-Whitney U Test (also called Wilcoxon rank-sum test) on a weighted sample in R. Such a non-parametric test is required, as neither of the two variables used follow normal distribution. The sample is weighted: a variable assigns a given weight to each row. The weights are numbers with decimals.

The built-in wilcox.test argument in R does not take weights into account. The '[survey]' package does offer a Wilcoxon test for weighted data but I am puzzled by the “degree of freedom” value I get upon performing it. Here is an example, with data formatted like my actual data:

install.packages(‘survey’)
library(survey)
ordinal = c(4, 1, 1, 2, 3, 6, 5, 7, 6, 1) #outcome variable: ordinal variable with 7 levels
groups = c(1, 1, 2, 2, 2, 2, 2, 1, 1, 2) #groups variable: factor with 2 levels
w = c(1.3, 1.3, 0.7, 0.5, 1.5, 1.6, 1.6, 0.4, 0.4, 0.7) #weights
data = data.frame(ordinal, groups, w)