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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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