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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.