BookmarkSubscribeRSS Feed
amoreau1
Calcite | Level 5

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?

Thanks,


Example.bmp
4 REPLIES 4
ballardw
Super User

It would be helpful to post the code, at least the symbol statemenst and plot procedure code you are trying.

amoreau1
Calcite | Level 5

 

symbol1 interpol=join ^

     c=black

     line=1

     width=2;

symbol2 interpol=hilot

     c=black

     cv=black

     line=1

     ci=black

     width=2;

 

proc gplot data=final_;

plot mean2*Visn low_up2*Visn

/

overlay

haxis=axis1

vaxis=axis2

legend=legend1;

run;

quit;

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.

Thanks.

sunnyrj
Calcite | Level 5

Try  this:

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.


Renee

MikeZdeb
Rhodochrosite | Level 12

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;

class age;

var height;

output out=stats (drop=_:) lclm=low mean=mean uclm=high;

run;

* rearrange the data;

data stats (keep=age x1 x2);

set stats;

x1=mean; x2=low; output;

x1=.; x2=high; output;

run;

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;

run;

quit;


plot.png

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 1529 views
  • 0 likes
  • 4 in conversation