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

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!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 537 views
  • 0 likes
  • 3 in conversation