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

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