BookmarkSubscribeRSS Feed
greveam
Quartz | Level 8

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

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

greveam
Quartz | Level 8

 

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?

greveam
Quartz | Level 8

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)".

greveam
Quartz | Level 8

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!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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