BookmarkSubscribeRSS Feed
wilcoxon
Calcite | Level 5
I am trying to use wilcoxon rank-sum test to test median wage by foreign-born/native-born status for selected occupations. My goal is to produce a summary output.

Are there ways to output the statistics portion of proc NPAR1WAY through ODS, like how one can do in ttest?

PROC
NPAR1WAY Data=Hospy200507 WILCOXON;
CLASS
CITI;
VAR
INCWAGE_adj;
by
occ1990;
RUN
;
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
If you do this:
[pre]
ODS TRACE ON/LABEL;
PROC NPAR1WAY Data=Hospy200507 WILCOXON;
CLASS CITI;
VAR INCWAGE_adj;
by occ1990;
RUN;
ODS TRACE OFF;
[/pre]

...and then look in the SAS log, you will see the names of the output objects that are being created by your procedure. For example, NPAR1WAY would have something like this in the LOG:
[pre]
**** Note that some of the Log output was deleted here to make the
posting smaller ****
Output Added:
-------------
Name: WilcoxonScores
Label: Scores
Template: Stat.Npar1way.ClassScores
Path: Npar1way.ByGroup1.INCWAGE_adj.Wilcoxon.WilcoxonScores
-------------

Output Added:
-------------
Name: WilcoxonTest
Label: Two-Sample Test
Template: Stat.Npar1way.StatFactoid
Path: Npar1way.ByGroup1.INCWAGE_adj.Wilcoxon.WilcoxonTest
-------------

Output Added:
-------------
Name: KruskalWallisTest
Label: Kruskal-Wallis Test
Template: Stat.Npar1way.StatFactoid
Path: Npar1way.ByGroup1.INCWAGE_adj.Wilcoxon.KruskalWallisTest
-------------
**** end of by group 1

Output Added:
-------------
Name: WilcoxonScores
Label: Scores
Template: Stat.Npar1way.ClassScores
Path: Npar1way.ByGroup2.INCWAGE_adj.Wilcoxon.WilcoxonScores
-------------

Output Added:
-------------
Name: WilcoxonTest
Label: Two-Sample Test
Template: Stat.Npar1way.StatFactoid
Path: Npar1way.ByGroup2.INCWAGE_adj.Wilcoxon.WilcoxonTest
-------------

Output Added:
-------------
Name: KruskalWallisTest
Label: Kruskal-Wallis Test
Template: Stat.Npar1way.StatFactoid
Path: Npar1way.ByGroup2.INCWAGE_adj.Wilcoxon.KruskalWallisTest
-------------
**** end of by group 2
[/pre]

Then you have to decide whether you 1) want a particular statistic or set of statistics in a particular destination result file (such as only get K-W Test in ODS HTML, but none of the other output objects) OR 2) whether you want to create SAS datasets from the OUTPUT objects.

For #1, you'd use ODS SELECT to select certain output objects for certain destinations. For #2, you'd use ODS OUTPUT to create output datasets from certain output objects.

For more information, see these papers and notes:
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001806839.htm
http://www2.sas.com/proceedings/forum2008/172-2008.pdf
http://www2.sas.com/proceedings/sugi26/p058-26.pdf (pg 2 and 3)
http://support.sas.com/kb/25/390.html (ODS OUTPUT)

cynthia

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
  • 1194 views
  • 0 likes
  • 2 in conversation