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;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1624 views
  • 0 likes
  • 3 in conversation