Quartz | Level 8

## weighted wilcoxon rank sums

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
SAS Super FREQ

## Re: weighted wilcoxon rank sums

There are many kinds of weights. What does the weight variable (z) represent? That is, what is the physical or statistical interpretation of z?

Quartz | Level 8

## Re: weighted wilcoxon rank sums

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?

Quartz | Level 8

## Re: weighted wilcoxon rank sums

That is: "the wilcoxon rank sum test should compare differences in predicted rank sums of b for the classification variable a based on the weight statement z (probability of a given c)".

Quartz | Level 8

Quartz | Level 8

## Re: weighted wilcoxon rank sums

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!

Discussion stats
• 5 replies
• 2754 views
• 0 likes
• 2 in conversation