BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Does anyone know how to do a Kruskal Wallis test in SAS with TWO independent variables instead of just one?
4 REPLIES 4
Olivier
Pyrite | Level 9
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 ?
deleted_user
Not applicable
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.
LAP
Quartz | Level 8 LAP
Quartz | Level 8
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,.....
Doc_Duke
Rhodochrosite | Level 12
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!).]

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1711 views
  • 0 likes
  • 4 in conversation