# which non parametric test is best for ordinal data?

I want to to do the test where i have to check if first column which is income, and 1 shows < 500, 2 = 1000, 3 = 2000 income values from the data, and which the other column which is a dependent variable like a question like yes/no, may, maybe not, others. where i have to find if there is a significant difference comparing, earlier i was doing wilcox but it says it should have two levels, since my independent variable has three levels, question: which test is better for this?

• We do not have sufficient information to answer your question. Is it a random sample? Are the rows independent? Is the independent variable norminal? If the answer to all these questions is "yes", then the Kruskal-Wallis test is a candidate. Feb 4, 2023 at 6:46
• @MichaelM The data is survey data hence random, rows entries are dependent on each other which mean one is independent and second is dependent on that, I'm not sure how to interpret that. and why would you recommend Kruskal-Wallis test?
– none
Feb 4, 2023 at 9:04
• It is not very clear what the data structure is here. Also, survey data is not inherently random, not if, for example, you chose to survey all people living in a poor suburb, or, conversely, a rich suburb - nothing random about that. I think this question needs considerably more clarity. I wanted to try and help edit the question but impossible to know where to start. Feb 4, 2023 at 11:21
• @Trypanosoma I want to to do the test where i have to check if first column which is income, and 1 shows < 500, 2 = 1000, 3 = 2000 income values from the data, and which the other column which is a dependent variable like a question like yes/no, may, maybe not, others. where i have to find if there is a significant difference comparing, earlier i was doing wilcox but it says it should have two levels, since my independent variable has three levels, question: which test is better for this?
– none
Feb 4, 2023 at 12:43
• The title question is unanswerable without an explicit definition of best (what are your criteria for one test being better than another?). Indeed even with an explicit definition more information would almost certainly be needed to give an answer (e.g. if you define best in terms of power, we would need to think about what specific alternatives power is being compared on). This is why the answers focus on possible tests, not "the best". Feb 5, 2023 at 8:30

Since there are two categorical variables that can both be treated as ordinal, there are several hypothesis tests are likely to appropriate to test for an association.

These include linear-by-linear test (ordinal chi-square), Kendall’s tau correlation (tau-c in this case), Jonckheere–Terpstra or Cuzick tests.

Ordinal regression could also be used.

If the independent variable is to be treated as nominal categorical, Kruskal-Wallis with a Dunn (1964) post-hoc test could be used. Or ordinal regression.

It's best to start by plotting the data. A spine plot may be helpful.

• Which of these are nonparametric? Feb 4, 2023 at 18:25
• @dimitriy , I think all of these tests would traditionally be considered nonparametric, with the exception of ordinal regression. Feb 4, 2023 at 18:32
• @SalMangiafico would you suggest kruskal- wallis test for that data?
– none
Feb 4, 2023 at 18:52
• @none , Kruskal-Wallis will treat your independent variable as nominal categorical. This may be desirable, particularly if the trend across the independent variable categories isn't monotonic. That is, if the dependent variable is low at Income1, high at Income2, and low again at Income3. Feb 4, 2023 at 19:18
• @SalMangiafico what would you suggest if they are monotonic, the data is survey data and ordinal, dependent variable is monotonic as far as i can see very entry has different response.
– none
Feb 4, 2023 at 19:55