BookmarkSubscribeRSS Feed
A_pineda
Calcite | Level 5

I’m running a Wilcoxon rank sum test and I want to output a table containing the 2-sided Monte Carlo p-value (the variable name is MCP2_WIL). I don’t want to use the ODS OUTPUT statement because the result is not given in a friendly format (it looks like this: “<.0001”). I want the exact numeric value. When I use the OUTPUT OUT statement the output table is not including MCP2_WIL:

PROC NPAR1WAY DATA =WORK.test_data Wilcoxon;

CLASS group;               

VAR response;

EXACT Wilcoxon /MC;

OUTPUT OUT=WORK.Wilcoxon_output Wilcoxon;             

RUN;

Is there a way to do this?

2 REPLIES 2
PGStats
Opal | Level 21

Look for variable nValue1 in ODS output table WilcoxonTest, it contains the numerical p-value of the test. - PG

PG
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

SAS procedures have built in formats for the constants and variables that are printed. These carry over into the ods output files. But you can override these in PROC PRINT. For instance, if you saved an ods output file called test, and the p value was called p, then use:

proc print data=test;

format p 15.12;

run;

This gives you p to 12 decimal places (as an example). You can experiment with many other formats. Or to limit output just to p:

proc print data=test;

format p 15.12;

var p;

run;

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!

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
  • 2 replies
  • 1549 views
  • 0 likes
  • 3 in conversation