New Contributor
Posts: 2

# Finding difference in means using Mann Whitney Test (Weighted data)

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!

Posts: 1,123

## Re: Finding difference in means using Mann Whitney Test (Weighted data)

[ Edited ]

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 ;

New Contributor
Posts: 2

## Re: Finding difference in means using Mann Whitney Test (Weighted data)

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?

Posts: 1,123

## Re: Finding difference in means using Mann Whitney Test (Weighted data)

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.

Super User
Posts: 20,765