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.
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;
Hi @Pyruvate
You can use the ALPHA= option in the PROC TABULATE statement to specify a confidence level.
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.
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;
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!
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.