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;
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.
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.
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.
Ready to level-up your skills? Choose your own adventure.