# R which test to use?

I have my data in CSV file for a survey response. Gender is a non ordered factor with two levels (Male and Female) and Rating is an ordinal factor (1-5)

Gender Rating
M      1
M      2
F      5
M      4
F      3
and so on


I want to find out if there is a statistically significant difference in the ratings between Males and Females for the survey.

I have trying to figure out what type of tests to use when my dependent variable is multilevel ordinal data and the independent variable is categorical.

Any help here with some sample code is appreciated.

From what I have read, wilcoxon.test seems to be the way, but not sure.

• You can start by creating box plots for ratings, for each of the two genders. Right away, you may see a difference in trends and you can go from there. Apr 21, 2017 at 0:53
• Look at the Wilicoxon sign test might work in this situation. Apr 21, 2017 at 1:55
• stats.idre.ucla.edu/other/mult-pkg/whatstat
– rawr
Apr 21, 2017 at 2:31
• Apr 21, 2017 at 11:56

## 1 Answer

Wilcoxon Rank-Sum Test (aka Mann-Whitney) is what you want. However, if a) your ratings are approximately normally distributed in the population or b) you can sum ratings together for an aggregate scale, you could justify using an independent samples t-test.

The first case is ok because you're assuming there is a real variable underlying your scale. e.g. "Enough public money is spent on education" is the item and your scale is 1-5 (strongly disagree to strongly agree). There is an actual level of disagreement/agreement present in the person you are asking that only gets binned into 1-5 because that's how you asked the question. This is maybe an extreme example but think about age, age in surveys is often recorded and analysed in years using parametric methods. We all have an exact age (in seconds say) and the binning doesn't change that, it just determines the shape of the histogram. Back to your survey, if a normal variable with say mean = 3 and sd = 1 binned into whole numbers is not significantly different to your observed scores (tested using Kolmogorov-Smirnov), you effectively have a variable that is normally distributed and the answers you get with parametric tests are valid.

The second case works because of the central limit theorem but again you need to check your distributions because if there is a high correlation between certain items, it may not end up normal. It will however be something you can transform to normal, which is just as good.

Unless you have done some matching procedure between Males and Females, do not use the Wilcoxon Signed-Rank Test (or paired samples t-test) as those are for paired/matched samples.