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

Hi I am trying to get the output as Mean (95% CI) instead of Mean (SE), but I am struggling with how to edit the code. Please help!

data test;set tt; if domain="zone=1";
Mean_SE = compress(put(round(Estimate, 0.001),8.3)) || " (" || compress(put(round(StdErr, 0.001), 8.3)) || ")";
proc print data=test;
var year Estimate stderr mean_se;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I think you are making your life difficult by trying to do these calculations inside a text string. Assuming you have a simple T-test here:

 

lcl=estimate-1.96*stderr;
ucl=estimate+1.96*stderr;

Then you have three variables, ESTIMATE, LCL and UCL that you can print or format any way you want.

--
Paige Miller

View solution in original post

2 REPLIES 2
Jagadishkatam
Amethyst | Level 16
You can just use the below code

Mean = compress(put(round(Estimate, 0.001),8.3)) ;
Thanks,
Jag
PaigeMiller
Diamond | Level 26

I think you are making your life difficult by trying to do these calculations inside a text string. Assuming you have a simple T-test here:

 

lcl=estimate-1.96*stderr;
ucl=estimate+1.96*stderr;

Then you have three variables, ESTIMATE, LCL and UCL that you can print or format any way you want.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 933 views
  • 0 likes
  • 3 in conversation