Hi , I tried Robert's Confidence Interval code(posted on this link: https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/Drawing-confidence-intervals-in-gplot-using-annotate/td-p/11544 on my code to get the confidence bands on GPLOT but these are not working because there are some Y axis / Y axis changes that are required(according to robert). Can you please help me out with this? Also I have one more general question. I have to plot 3 variables in scatter plot all on the same Y axis but 2 of them would have confidence bands. Is that possible ? If yes, then does anyone have such a code? I am working on SAS Enterprise Guide(7.1) Here is the code: data a;
input ACCOUNT$ POST_QUOTES PRE_ACTUAL PRE_ERROR POST_ACTUAL POST_ERROR POST_ESTIMATE ;
datalines;
N 389 1546 30 1695 98 1648
Y 547 1177 16 1098 53 1166
;
run;
data a(drop= post_error pre_error);
set a;
LOWERCI_PRE = PRE_ACTUAL-PRE_ERROR;
UPPERCI_PRE = PRE_ACTUAL+PRE_ERROR;
LOWERCI_POST = POST_ACTUAL-POST_ERROR;
UPPERCI_POST = POST_ACTUAL+POST_ERROR;
run;
symbol1 value=none INTERPOL=needle color=gray width=50 ;
symbol2 height=0.17 in value=dot color=black INTERPOL=none l=1;
symbol3 height=0.17 in value=CIRCLE color=DARKRED INTERPOL=none l=1;
symbol4 height=0.17 in value=circlefilled color=DARKRED INTERPOL=none l=1;
axis1 label=(height=0.17 in f=triplex "Account credit") value=(height=0.135 in
f=triplex) offset=(25);
axis2 label=(height=0.17 in a=90 f=triplex "Estimates") minor=none order=(1000
to 1800 by 100) offset=(5 pct) value=(height=0.135 in f=triplex);
axis3 label=(height=0.17 in a=270 f=triplex "Volume") minor=none
order=(10 to 1000 by 100) offset=(5 pct) value=(height=0.135 in f=triplex);
data anno_pre;
length function color $8;
retain /*xsys ysys '2'*/ when 'a';
set A;
/****/
/* Draw the horizontal line from lower_limit to upper_limit */
function='move'; yc=PRE_ACTUAL; xsys='2'; ysys='2'; x=LOWERCI_PRE; color='red'; output;
function='draw'; x=UPPERCI_PRE; size=1; output;
/* Draw the tick line for the lower_limit value */
function='move'; xsys='2'; ysys='2'; yc=PRE_ACTUAL; y=.; x=LOWERCI_PRE; color='red'; output;
function='draw'; x=LOWERCI_PRE; y=+1; ysys='9'; size=1; output;
function='draw'; x=LOWERCI_PRE; y=-2; size=1; output;
/*function=''; output;*/
/* Draw the tick line for the upper_limit value */
function='move'; xsys='2'; ysys='2'; yc=PRE_ACTUAL; y=.; x=UPPERCI_PRE; color='red'; output;
function='draw'; x=UPPERCI_PRE; y=+1; ysys='9'; size=1; output;
function='draw'; x=UPPERCI_PRE; y=-2; size=1; output;
run;
data anno_post;
length function color $8;
retain /*xsys ysys '2'*/ when 'a';
set A;
/****/
/* Draw the horizontal line from lower_limit to upper_limit */
function='move'; yc=post_ACTUAL; xsys='2'; ysys='2'; x=LOWERCI_post; color='orange'; output;
function='draw'; x=UPPERCI_post; size=1; output;
/* Draw the tick line for the lower_limit value */
function='move'; xsys='2'; ysys='2'; yc=post_ACTUAL; y=.; x=LOWERCI_post; color='orange'; output;
function='draw'; x=LOWERCI_post; y=+1; ysys='9'; size=1; output;
function='draw'; x=LOWERCI_post; y=-2; size=1; output;
/*function=''; output;*/
/* Draw the tick line for the upper_limit value */
function='move'; xsys='2'; ysys='2'; yc=post_ACTUAL; y=.; x=UPPERCI_post; color='orange'; output;
function='draw'; x=UPPERCI_post; y=+1; ysys='9'; size=1; output;
function='draw'; x=UPPERCI_post; y=-2; size=1; output;
run;
proc gplot data=a;
plot POST_QUOTES*Account/ overlay noframe nolegend haxis=axis1 vaxis=axis3;
plot2 (Pre_Actual ) *Account / annotate=anno_pre overlay noframe nolegend haxis=axis1 vaxis=axis2;
title1 h=0.17 in f=triplex "THE GRAPHICAL DISPLAY:";
title3 h=0.17 in f=triplex "Post Quotes as bar , Pre Actual , Post Actual and Post Estimated as Scatter Plots";
footnote1 j=c h=0.15 in f=triplex "Legends will go here";
run;
quit;
... View more