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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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