BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Andrea_Peng
Obsidian | Level 7

Hi all,

 

I want to graph a scatter plot overlayed by 95%CI, 99%CI and mean value (all three are lines). My code is

 

 

goptions reset=all;
goptions device=sasemf xmax=15cm ymax=8cm xpixels=1600 ypixels=800 hsize=15cm vsize=8cm cback='00000000' ctext=black rotate=landscape;
 
symbol1 interpol=join colour=lightgreen width=3;
symbol2 interpol=join colour=orange width=3; 
symbol3 interpol=join colour=red width=3; 
symbol4 interpol=none value=dot colour=black width=3; 
symbol5 interpol=none value=dot colour=blue width=3;
 
axis1 label=(C=black 'Total Number of Procedures' ) order=(50 to 650 by 50) ;
axis2 label=(a=90 r=0 C=black 'Standardised Proportion') order=(0 to 0.16 by 0.02) ;

legend1 order=('overall_rate' 'upper_95' 'upper_99') value=('Overall Proportion' '95% Confidence Limit' '99.5% Confidence Limit') label=none position=(top right inside) down=4 mode=protect ;
proc gplot data=graph;
plot (overall_rate upper_95 upper_99 rratio1 rratio2)*total / overlay legend=legend1 haxis=axis1 vaxis=axis2 noframe areas=1;
run;
quit;

 

 
The graph I get is:
gplot3.bmp
 
The data is
totaloverall_rateupper_95upper_99rratio1rratio2
500.0279240.0735920.0880380.042229 
510.0279240.0731420.0874460.080207 
510.0279240.0731420.087446 0.038715
510.0279240.0731420.0874460.038715 
510.0279240.0731420.087446 0
510.0279240.0731420.0874460 
510.0279240.0731420.0874460.021527 
520.0279240.0727060.086871 0.03728
520.0279240.0727060.0868710.03728 
520.0279240.0727060.0868710.039238 
530.0279240.0722810.0863120 
530.0279240.0722810.086312 0.019855
530.0279240.0722810.0863120.038966 
550.0279240.0714670.085241 0.036494
550.0279240.0714670.0852410.036494 
550.0279240.0714670.085241 0.018893
550.0279240.0714670.0852410.018893 
560.0279240.0710770.084727 0.036774
560.0279240.0710770.084727 0.110384
560.0279240.0710770.0847270.110384 
560.0279240.0710770.0847270.018116 
580.0279240.0703260.0837390 
580.0279240.0703260.083739 0.035404
590.0279240.0699650.0832640.018158 
600.0279240.0696130.0828010 
600.0279240.0696130.0828010.142068 
600.0279240.0696130.0828010.050821 
610.0279240.069270.082349 0.032482
 
 
 
 

It seems like only symbol1 statement does not work, other four are alright.  Anyone know the problem?

 

Thanks,

Andrea

 

1 ACCEPTED SOLUTION

Accepted Solutions
Andrea_Peng
Obsidian | Level 7

Hi, 

 

This correct answer is deleting area=1. Hope this is helful.

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Its very hard to say.  Have you tried changing those symbol things and seeing if the colors and such like actually change.  Just thinking it may be using the defaults and looks like its working?  Anyways, I would really suggest moving to sgplot/graph template language, you get a whole load more functionality and options.  For instance, you can do 95% CI directly with one extract option.  See:

http://blogs.sas.com/content/graphicallyspeaking/2012/01/12/custom-confidence-intervals/

For an example, and:

http://blogs.sas.com/content/graphicallyspeaking/

For a whole load of examples in various methoeds.

Andrea_Peng
Obsidian | Level 7

Hi Esteemed,

The mean value (symbol1) should be a straight line and it could not be covered by 95%CI or 99%CI lines, both of which are curve. I tried only define symbol1. It still comes out a purple box instead of a line. 

 

95%CI and 99%CI is not directly from the data. It is calculated by expectations. So I have to keep it in a dataset and use gplot to graph them.

 

I will have a try sgplot later see if it works for my ideas.

 

By the way, COLOUR does work. 🙂 

 

Andrea

Andrea_Peng
Obsidian | Level 7

Hi, 

 

This correct answer is deleting area=1. Hope this is helful.

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!

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
  • 3 replies
  • 963 views
  • 0 likes
  • 2 in conversation