Hi,
I have the dataset `outfreq' as follows:
nocturnal_
Obs asthma COUNT PERCENT group prop std
1 0 28 19.3103 1 0.19310 3.27808
2 1 87 60.0000 1 0.60000 4.06838
3 2 29 20.0000 1 0.20000 3.32182
4 3 1 0.6897 1 0.00690 0.68727
5 0 110 75.8621 2 0.75862 3.55368
6 1 32 22.0690 2 0.22069 3.44399
7 2 3 2.0690 2 0.02069 1.18210
I have written the following SAS code:
axis1 order=(0 to 100 by 10)
label=(angle=90 height=1.2 justify=center 'Percentage of patients')
split='_' length=30 cells
major=(height=3 width=2)
minor=(number=6 color=red height=2 width=1);
axis2 order=(0 to 4 by 1)
label=(angle=0 height=1.5 justify=center 'Nocturnal Asthma Score')
value=(h=0.5 width=3);
legend1 cborder=black
label=('Quarter:')
position=(middle left outside)
mode=protect
across=1
;
pattern1 value = X3 color = BLACK ;
pattern2 value = R5 color = BLACK;
legend1 frame
position=(inside right top)
label=(c=green 'Legend')
mode=protect
cborder=black
across=1
;
proc format;
value base 1='Base' 2='Final';
value score 0='None' 1='once' 2='twice' 3='Thrice' 4='>3';
run;
data anno;
set freqout;
length function $ 8. text $ 45.;
retain xsys ysys '2' color 'red' width 2;
function='move'; y=percent; midpoint=nocturnal_asthma; when='a'; output;
function='draw'; xsys='9'; y=percent+std*2; when='a'; output;
function='draw'; xsys='9'; y=percent-std*2; when='a'; output;
run;
proc gchart data=freqout;
vbar group /sumvar=percent group=nocturnal_asthma midpoints=1 2 outside=sum inside=freq
coutline=blue cframe=white space=0 raxis=axis1 maxis=axis2
legend=legend1 PATTERNID=MIDPOINT anno=anno;
format nocturnal_asthma score.;
format group base.;
run;
quit;
Unfortunately I am getting the output as I desire. I want to have bar diagram along with confidence intervals. If you run the pogram then you can understand what I want. I guess the problem is in the midpoint= statement in the `anno' data step. Or anywhere else...
Another problem is that in my program legend statement is not working.
Please help me.
Thanks in advance.
Regards,
Madan Gopal Kundu