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

Hi SAS communities, 

I am looking for a solution to print more decimals for my p-values generated via a proc freq chisq procedure. I would ideally like to have 10-12 decimals printed as I am performing bivariate analyses and need to compare highly significant values (currently all my p-values are printing <0.0001). I'm definitely open to other ways to get a p-value other than a proc freq chisq procedure, I just need to be able to test the association between two variables.

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @mlensing,

 

I mostly use an ODS output dataset if I want to see more decimals of a statistic. In your example add

ods output chisq=csq;

before (or in) the PROC FREQ step -- csq is just an arbitrary dataset name. Then use, e.g., PROC PRINT to show the values with a suitable format:

proc print data=csq;
format prob 14.12;
run;

To change the display format directly in PROC FREQ output, you would need to modify the ODS template. I recently suggested this in another thread: https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-formats-of-the-output-dataset/m-p/6... 

View solution in original post

5 REPLIES 5
FreelanceReinh
Jade | Level 19

Hi @mlensing,

 

I mostly use an ODS output dataset if I want to see more decimals of a statistic. In your example add

ods output chisq=csq;

before (or in) the PROC FREQ step -- csq is just an arbitrary dataset name. Then use, e.g., PROC PRINT to show the values with a suitable format:

proc print data=csq;
format prob 14.12;
run;

To change the display format directly in PROC FREQ output, you would need to modify the ODS template. I recently suggested this in another thread: https://communities.sas.com/t5/Statistical-Procedures/Proc-mixed-formats-of-the-output-dataset/m-p/6... 

mlensing
Obsidian | Level 7
Thank you so much!
ballardw
Super User

You will likely get some push back on "more significant" (I'm one) but  just specify a larger value for the format such as

format variablename f32.30; to display up to 30 decimals. 32 is the maximum number of digits the format supports.

So send the output of the test to data set and use another procedure to print the result.

 

Note that there is likely to be some machine precision issues with anything showing 15 or more decimal places.

 

If you didn't pick your rejection regions/ significance level before the test the values are "not more significant".

 

mkeintz
PROC Star

Are you aware of statistical analyses or reports that find justification in ranking/comparing numerous p-values, all less than <.0001?  I'd be very interested in knowing the context.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
mlensing
Obsidian | Level 7

@ballardw @mkeintz 

 

Hi all, thank you for your clarifying comments. I am needing to "compare significance" among my bivariate interactions to determine the order in which terms should be introduced into my logistic regression model to compare model fit through -2LL tests. The instructors for the course I am in that suggest this step tend to be against automated variable selection tools and so this is part of our intentional/purposeful modeling.

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2680 views
  • 3 likes
  • 4 in conversation