BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
iuri_leite
Fluorite | Level 6

Dear All,

I am running a test for median differences among three countries:

ODS GRAPHICS ON;
PROC NPAR1WAY WILCOXON MEDIAN;
CLASS Country;
VAR time;
RUN;

 

In the results I do not get the results for Median two-way  analysis, but for Median one-way analysis.

Median One-Way AnalysisChi-Square DF Pr > ChiSq

 

Could anyone tel me how a can obtain the Median Two-way results?

Best regards;

Iuri

 


 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Are you sure the data used was the correct set? Your code did not show a Data= so the last data set created would be the default set used by the procedure.

 

From the documentation of the option:

WILCOXON

requests an analysis of Wilcoxon scores. When there are two classification levels (samples), this option produces the Wilcoxon rank-sum test. For any number of classification levels, this option produces the Kruskal-Wallis test.

Since your data has 3 levels of the class variable then output should be from the Kruskal-Wallis test which is a test for equality of means (medians) across all of the classes. That should have appeared under the "Wilcoxon Scores" table in the output.

 

If by "Median Two-way results" you mean the results comparing 2 levels of the class variable then you need to subset your data to 2 levels (3 sets of tests) which will raise some concerns about repeated tests from the same data. The "Median Two Sample Test" table will only appear with exactly two levels of the class variable.

 

 

 

View solution in original post

1 REPLY 1
ballardw
Super User

Are you sure the data used was the correct set? Your code did not show a Data= so the last data set created would be the default set used by the procedure.

 

From the documentation of the option:

WILCOXON

requests an analysis of Wilcoxon scores. When there are two classification levels (samples), this option produces the Wilcoxon rank-sum test. For any number of classification levels, this option produces the Kruskal-Wallis test.

Since your data has 3 levels of the class variable then output should be from the Kruskal-Wallis test which is a test for equality of means (medians) across all of the classes. That should have appeared under the "Wilcoxon Scores" table in the output.

 

If by "Median Two-way results" you mean the results comparing 2 levels of the class variable then you need to subset your data to 2 levels (3 sets of tests) which will raise some concerns about repeated tests from the same data. The "Median Two Sample Test" table will only appear with exactly two levels of the class variable.

 

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 266 views
  • 0 likes
  • 2 in conversation