Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Test for median difference

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 08-22-2023 06:43 PM
(420 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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:

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.

1 REPLY 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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:

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 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

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.