Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- weighted wilcoxon rank sums

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 04-05-2019 03:58 AM
(2753 views)

Hi,

I want to test differences in predicted rank sum using proc npar1way like this:

proc npar1way data=have wilcoxon;

class a;

var b;

weight z;

run;

However, by default this is not possible in SAS: ERROR 180-322: Statement is not valid or it is used out of proper order.

I can get the the differences in predicted means using ttest and the same code:

proc ttest data=have;

class a;

var b;

weight z;

run;

But I am interested in the differences in the predicted rank sum values. Any help would be greatly appreciated.

Thanks,

Anders

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

z is the probability of being in group a (my class variable in proc npar1way which has the values 0 or 1) given c.

proc logistic data=have namelen=32 plots=roc;

model a(event='1') = c / stb;

output out=want prob=z;

run;

My question relates to this paper: https://www.nejm.org/doi/full/10.1056/nejmoa1110717

The authors state that they used wilcoxon rank sum tests to compare differences in two treatment regiments weighted by the probability of receiving one of the treatments (same as I am doing above). I don't understand the next step - how is it possible to weight the wilcoxon rank sum test by the probability of the observed level of the classification variable?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Rick, sorry to be bugging you about this. It seems there is no easy way to do a test for differences in predicted rank sum values.

So, what do you think about a weighted jonckheere-terpstra test instead? b is continuous non-normal - but from what I can find on the internet, the current version of proc freq with a jt option can handle ties.

proc freq data=have;

table a*b / jt;

weight z;

run;

Thanks!

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 25. Read more here about **why** you should contribute and **what is in it** for you!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.