Dear all,
I have a graph showing the mean ages in different diagnosis years. I wish to add standard errors to this plot. Is it right to do that with proc means like below and then deduct or add these values from/to the maen ages to get the upper and lower limits. Or do I say lower= mean_age- 2*stderr ,
and upper= mean_age+2*stderr. Why is this standard error important?
proc means data=mydata noprint; var age; class year sex; output out = myoutdat mean=mean_age stderr=stderr ; run;
Thanks, I just wanted to know which solution is better, is it better using the LCLM and UCLM in proc means or using mean_age +/- 2*stderr to get the confident intervals
@Anita_n wrote:
Thanks, I just wanted to know which solution is better, is it better using the LCLM and UCLM in proc means or using mean_age +/- 2*stderr to get the confident intervals
Compare the two values for some data. See which makes sense for your purpose. There's also CLM that you could add/subtract from the mean to get a limit to display.
Sometimes one of the limits may not make sense and needs to be censored. For instance if your data relates to patient weight and you get a LCLM of -5 (pounds or kilograms) does that make sense? A weight for a person in the negative range is highly problematic (and likely would come from data with extreme values, small sample and possibly a mix of adults and children).
So "best" comes from "know your data" and making decisions to show the story you intend.
@ballardw yes, you are right I compared the values and realised they are very similar, there just very very small differences. In my case there were no negative values for the mean ages. I think I will just choose one of the methods
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.