BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
csetzkorn
Lapis Lazuli | Level 10

I am using this code:

 

PROC NPAR1WAY data=Temp wilcoxon median;
Class Group;
Var POwnPriceElasticity;
output out=NPAR1WAY; 
Run;

to compare the medians of 2 groups. Just curious, if I have a value for PL_MED or PR_MED, how do I know the directionallity of this? Does SAS base this on the alphabetic order of the groups? Hope this makes sense ...

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Not the alphabetic order is relevant, but the size of the groups (smaller group prioritized) and in case of equal group sizes the observation order in the input dataset.

 

To quote the documentation:

"To compute the linear rank statistic S, PROC NPAR1WAY sums the scores of the observations in the smaller of the two samples. If both samples have the same number of observations, PROC NPAR1WAY sums those scores for the sample that appears first in the input data set."

 

(The decision between left- and right-sided test is, of course, based on whether S is greater than (--> right-sided) or less than (--> left-sided) its expected value under the null hypothesis; in case of equality: left-sided test.)

 

Edit: Just to avoid any misconceptions: The abovementioned "decision between left- and right-sided test" refers to which of the two variables PL_MED and PR_MED in the output dataset is populated, not to the appropriateness of these statistical tests.

View solution in original post

1 REPLY 1
FreelanceReinh
Jade | Level 19

Not the alphabetic order is relevant, but the size of the groups (smaller group prioritized) and in case of equal group sizes the observation order in the input dataset.

 

To quote the documentation:

"To compute the linear rank statistic S, PROC NPAR1WAY sums the scores of the observations in the smaller of the two samples. If both samples have the same number of observations, PROC NPAR1WAY sums those scores for the sample that appears first in the input data set."

 

(The decision between left- and right-sided test is, of course, based on whether S is greater than (--> right-sided) or less than (--> left-sided) its expected value under the null hypothesis; in case of equality: left-sided test.)

 

Edit: Just to avoid any misconceptions: The abovementioned "decision between left- and right-sided test" refers to which of the two variables PL_MED and PR_MED in the output dataset is populated, not to the appropriateness of these statistical tests.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 959 views
  • 1 like
  • 2 in conversation