BookmarkSubscribeRSS Feed
ttuske
Calcite | Level 5

Hello, 

 I am running a proc ttest and getting great output. But It isn't exactly what I want. 

 

This is the output I currently haveThis is the output I currently have

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This is what I want (DIFFERENCES HIGHLIGHTED)This is what I want (DIFFERENCES HIGHLIGHTED)

I want the output to show an * or similar symbol(checkmark or x) when the p-value is greater

(could work with less then as well)

than my alpha level.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

My code is:

 

proc ttest data = work.t_test;
class ax_mcell_email_ibs_pm933;
var ct_bert1_score ;
run;

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I think the easiest and fastest way to get this done is to use a text editor, as you seem to have done.

 

To make it work inside a program, you'd probably have to change the template used by PROC TTEST, and that's not something worth doing here, in my opinion.

--
Paige Miller
Reeza
Super User

Why?

I would recommend not doing this, it isn't worth the effort. The method as mentioned would require you to modify the template and if you changed options in the t-test it may break the template. Also, modifying templates is not an easy task...definitely doable just not recommended. I usually pipe my results into tables and then customize the output for journals and push it straight to PDF or Word. 

 

Here's some instructions and explanations on how to capture output that is shown.
https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods...

 


@ttuske wrote:

Hello, 

 I am running a proc ttest and getting great output. But It isn't exactly what I want. 

 

This is the output I currently haveThis is the output I currently have

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This is what I want (DIFFERENCES HIGHLIGHTED)This is what I want (DIFFERENCES HIGHLIGHTED)

I want the output to show an * or similar symbol(checkmark or x) when the p-value is greater

(could work with less then as well)

than my alpha level.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

My code is:

 

proc ttest data = work.t_test;
class ax_mcell_email_ibs_pm933;
var ct_bert1_score ;
run;

 


If you really want to mess around with the templates, here's an example of PROC FREQ modifications. 

https://support.sas.com/resources/papers/proceedings17/SAS0404-2017.pdf


You would need to do something similar for the PROC TTEST templates. If you go down this route, make sure to back up a copy of the template otherwise you'll have destroyed it and all further output could be incorrect.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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