BookmarkSubscribeRSS Feed
vaishak123
Calcite | Level 5

I am trying to find the difference in means in my two samples. The distribution is not normal hence I have to resort to Mann Whitney test. Now, the data is weighted. In proc t-test, there is an option of mentioning weight in the command, like this:

 

proc ttest data=input;
var variable_x;
class variable_y;
weight weight;
run 

 Is there a similar thing for  Mann Whitney test in npar1way procedure? Thanks!

5 REPLIES 5
mkeintz
PROC Star

There is no WEIGHT statement, but there is a FREQ statement.

 

If you have a variable, say NSUBJECTS, that gives an integer number of subjects providing the actual frequency of occurance of the with the corresponding value of the test variable, then you can use this:

 

  FREQ nsubjects ;

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
vaishak123
Calcite | Level 5

Actually, I am using a non-parametric test after doing a case control matching. My case control matching is 1:N in nature, and hence I get weights for each control and case observation. Now, having this information, do you think if I include my matching weights in FREQ option, it would suffice?

mkeintz
PROC Star

No, I do not think FREQ would suffice instead of WEIGHJT

 

In most parametric tests, FREQ will increase the degrees of freedom, since it is specifying an actual count of cases observed.  WEIGHT can control your estimate of a statistic, but since it is more like a sampling fraction concept, it should not (as I understand it) change the degrees of freedom.  There's a FREQ statement in TTEST, as well as a WEIGHT statement - pretty direct evidence that they are NOT substituable.  Try your ttest twice, once using WEIGHT, once using FREQ.

 

I suspect the same considerations are true for non-parametric tests.  If one wanted to provide a WEIGHT statement in PROC NPAR1WAY, how would the procedure calculate the weighted statistic?

 

This is all from my ancient and only partially-remembered grad student days when I had a share of statistics classes.  Given how ancient that time is, you should probably give a relatively low "weight" to this response, until somebody more knowledgeable replies.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
mkeintz
PROC Star

Thank you @Reeza

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

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 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
  • 2118 views
  • 3 likes
  • 3 in conversation