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.

migrated from stackoverflow.comApr 21 '17 at 11:05

This question came from our site for professional and enthusiast programmers.

• 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. – Tim Biegeleisen Apr 21 '17 at 0:53
• Look at the Wilicoxon sign test might work in this situation. – Dave2e Apr 21 '17 at 1:55
• stats.idre.ucla.edu/other/mult-pkg/whatstat – rawr Apr 21 '17 at 2:31
• – SmallChess Apr 21 '17 at 11:56