06-08-2012 05:24 AM
I need to create a graph like this (see attached) i.e. the mean including 95%CI using proc gplot:
I use in the SYMBOL statement i=hilot to join the lower and the upper limit but SAS always includes the "---" at the middle of the 2 values. Is that possible to do not have it? Or do you have an other method to create such output?
06-08-2012 12:02 PM
symbol1 interpol=join ^
proc gplot data=final_;
plot mean2*Visn low_up2*Visn
In Mean2 variable I have the mean per timepoint
In Low_up2, I have lower and upper CI values (it means that for the same visit, I have 2 lines : 1 line is mean + lower CI and 1 line is mean + upper CI.
06-08-2012 03:03 PM
drop the first symbol statment and change SYMBOL2 to SYMBOL1 so there is only one symbol statement
then in the PLOT statement drop the overlay and just plot the lower and upper - PLOT LOW_UP2 * VISN;
this should plot the lower and upper bound and the HILOTJ option will calculate the mean of the lower and upper and join it for each timepoint
Another option is to reshape the data so each time point has 3 observations - low, mean, high. Then plot that with one symbol statemement using HILOCTJ.
Read the documentation on HILO to understand all of the options.
Hope all that is clear. For some reason I can't paste SAS code here, otherwise I would paste a snippit for clarity.
06-09-2012 09:48 AM
hi ... I think that this is more or less what the other folks were suggesting that you try ...
* compute mean and 95% CI;
proc summary data=sashelp.class nway;
where age between 12 and 15;
output out=stats (drop=_ lclm=low mean=mean uclm=high;
* rearrange the data;
data stats (keep=age x1 x2);
x1=mean; x2=low; output;
x1=.; x2=high; output;
goptions reset=all gunit=pct ftext='calibri' htext=3;
* one symbol for the mean (dot), one symbol for the CI;
symbol1 f='wingdings' v='6c'x c=blue w=2 h=4;
symbol2 i=hilotj c=blue w=2;
axis1 minor=none offset=(5,5)pct label=('AGE');
axis2 label=(a=90 'HEIGHT');
proc gplot data=stats;
plot x1*age=1 x2*age=2 / overlay noframe haxis=axis1 vaxis=axis2;