BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Pyruvate
Calcite | Level 5

Hi everyone,

 

I'm outputting some data with proc tabulate, and I'm adding some P-values, which I've formatted with pvalue8.2. This reports 

significant results as <.01. Is there a different format or a way to have significant results formatted as <.05? 

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

The PVALUE format is described in the article "Formats for p-values and odds ratios in SAS."

 

The PVALUEw.d format will use the "less than" sign to display values smaller than 1e-d. It does not support arbitrary cutoff points such as multiples of 5. However, you can use PROC FORMAT to define your own format that does what you want:

 

/* use MyPVal. format instead of PVALUE8.2 */
proc format;
value MyPVal
      low - 0.05 = '< 0.05'
      Other = [pvalue8.2];
run;


data FmtExample(drop=d);
format x BEST8. xPval PVALUE6.4 xNewPVal MYPVAL.;
do d = -3 to -2;
   do n = 1 to 9;
      x        = n*10**d;
      xPval    = x;
      xNewPval = x;
      output;
   end;
end;
run;
 
proc print noobs; run;

View solution in original post

3 REPLIES 3
ed_sas_member
Meteorite | Level 14

Hi @Pyruvate 

You can use the ALPHA= option in the PROC TABULATE statement to specify a confidence level.

Pyruvate
Calcite | Level 5

Thanks @ed_sas_member , but when I use that I get the error message:
ERROR 180-322: Statement is not valid or it is used out of proper order.

The pvalues i'm using are not calculated in proc tabulate, they have been calculated in a previous datastep and merged with the data I'm using for the output.

Rick_SAS
SAS Super FREQ

The PVALUE format is described in the article "Formats for p-values and odds ratios in SAS."

 

The PVALUEw.d format will use the "less than" sign to display values smaller than 1e-d. It does not support arbitrary cutoff points such as multiples of 5. However, you can use PROC FORMAT to define your own format that does what you want:

 

/* use MyPVal. format instead of PVALUE8.2 */
proc format;
value MyPVal
      low - 0.05 = '< 0.05'
      Other = [pvalue8.2];
run;


data FmtExample(drop=d);
format x BEST8. xPval PVALUE6.4 xNewPVal MYPVAL.;
do d = -3 to -2;
   do n = 1 to 9;
      x        = n*10**d;
      xPval    = x;
      xNewPval = x;
      output;
   end;
end;
run;
 
proc print noobs; run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 4769 views
  • 2 likes
  • 3 in conversation