Dear all,
I am using PROC SGRENDER in order to create a barchart of two groups at eight different time points. At the top of each bar I want to show the confidence intervals.
My dataset contains 16 records with the value of each bar ("a_rate") for each of the two groups ("group_id") at each time point ("period") already calculated. It also contains the values for the error bars ( "ll_ci", "ul_ci" ) as well as a variable "g_order" with values from 1 to 16 according to the data ordering (=_n_).
I am using the following code:
proc template;
define statgraph gns_bar;
begingraph;
entrytitle halign=left "Barchart";
layout overlay / walldisplay=(fill)
xaxisopts=(linearopts=(TICKVALUEFITPOLICY=STAGGER) LABELATTRS=())
yaxisopts =(linearopts=(tickvaluesequence=(start=0 end=0.5 increment=0.02)));
barchartparm x=g_order y=a_rate / group=group_id
errorlower=ll_ci errorupper=ul_ci;
endlayout;
endgraph;
end;
run;
proc sgrender data=a_bar template=gns_bar;
run;
The problem is that in the options of the barchartparm statement, it seems that the options "group=…" and "errorlower=… errorupper=…" cannot work simultaneously.
If I use only the "group=group_id" option then the bars are displayed in two separate colors according to their grouping ("group_id" variable).
If I use only the "errorlower=… errorupper=…" options, I get the error bars displayed for each bar.
But if I use both options then only the "group=…" option seems to work since the error bars are not displayed at all.
Also, is there a way of defining the space between the bars of the same group as well as the space between bars of different time points? (what I want to do is to have at each time point the 2 bars together – no space – but a small gap between the bars of different time points).
I hope it makes sense.
Thank you,
George