Help using Base SAS procedures

Kruskal Wallis

Reply
N/A
Posts: 0

Kruskal Wallis

Does anyone know how to do a Kruskal Wallis test in SAS with TWO independent variables instead of just one?
Super Contributor
Posts: 260

Re: Kruskal Wallis

I haven't checked what test KW is exactly, but from what I remember, it is like an analysis of variance on ranks, isn't it ?
If so, just compute ranks with PROC RANK and then proceed with PROC GLM.
Am I correct ?
N/A
Posts: 0

Re: Kruskal Wallis

Thanks. Yes, it is based on rank as far as I can tell. It seems to be a nonparametric equivalent of ANOVA and you can use proc npar1way, but now I want to add a second independent variable. It doesn't seem to allow this and the only thing I could find when I googled it was some talk of macros that created a multivariate KW, but couldn't actually get to the macro itself.
Frequent Contributor
Frequent Contributor
Posts: 76

Re: Kruskal Wallis

You can use proc npar1way to do a Kruskal-Wallis (Wilcoxen)


From Documentation....
The Nonparametric One-Way ANOVA task enables you to perform nonparametric tests for location and scale when you have a continuous dependent variable and a single independent classification variable. You can perform a nonparametric one-way ANOVA using Wilcoxon (Kruskal-Wallis), median, Van der Waerden,.....
Trusted Advisor
Posts: 2,113

Re: Kruskal Wallis

Just rank the dependent variable and then run the two way ANOVA via GLM.

Generally, you can do any rank-based analysis using the normal theory equivalent procedure in SAS. However, you are relying on the Central Limit Theorem to get the p-values, so you may need substantial sample sizes for this to work. [That's what Wilcoxon was doing when he developed the Rank-Sum test; he was looking for an easier way to do a t-test (think hand calculation!).]
Ask a Question
Discussion stats
  • 4 replies
  • 347 views
  • 0 likes
  • 4 in conversation