comp.soft-sys.sas - The SAS statistics package.
When creating a bar chart, how can I display the bar statistic value at the= end of the bar? I've tried the BARCHART statement's BARLABEL option, but it generates an er= ror when running PROC TEMPLATE. Thanks, Randy proc template; define statgraph b_test; begingraph / border=3Dfalse ; layout overlay / xaxisopts=3D(display=3Dnone) yaxisopts=3D(display=3D= none) WALLDISPLAY=3DNONE ; barchart x=3Dvalue / name=3D"legend" orient=3Dvertical display=3Dst= andard barlabel=3Dtrue barwidth=3D1 fillattrs=3D(color=3DRED) OUTLINEATTRS=3D(color=3Dblack); endlayout; endgraph; end; run;
Hi All, Is it possible to color only one bar out of the other in a different color?? I have all Asia pacific countries BAR, plus a AP Region bar(computed). I wann to show the AP region Bar in a Diffrent color. Also, I've arranged the BARS in ascending order. Is it possible to have all countries bars ascending , and a final bar for the AP region(irrespective of its value). any help will be helpful!! :) Thanks Easwara
Hi All, I am trying to annotate a vertical bar chart with within subgroup percentages. I have tried unsuccessfully using the INSIDE= & OUTSIDE= options within VBAR statement to get SAS to automatically print the subgroup % either inside the bars or outside. However I get an error message noting that the bar width is insufficient. I have tried different spacing criteria to no avail. This is possibly because I am graphing 11 groups with two bars within each group 9 thus a total of 22 bars on the x axis). The individual bars are further subgrouped according to another binary variable, whose % I am trying to obtain on the graph. Another approach I tried was to use the SAS ANNOTATE facility to annotate the subgroups. There is an example program on SAS website which shows how to annotate subgroups of vertical bar charts. I tried to using this example to fix my graph. However I can't get it to print the %. Instead it prints the binary value of the subgroup variable in the sub-bar ( i.e 1 or 0). I am trying to get SAS to print the percentage of 1's & 0's. Any help is appreciated. Thanks much, Jasmine Below you will find the code I am using - To create the annotate dataset : * data* barlabel; length color style $ *8*; retain color 'red' when 'a' style 'swiss' xsys ysys '2' position 'E' size *3* hsys '3'; set chart; midpoint=TRT; group = VISIT; subgroup=SCORE; /* SCORE is abinary variable 0/1 */; text=left(put(subgroup,*5.*)); -----> This just puts the value of the corresponding subgroup 0/1 in the subgroup bars ( this probably needs some tweaking inorder to get SAS to produce percentages ??? ) * run*; * proc* *gchart* data=chart; vbar TRT / discrete subgroup = SCORE group = VISIT /* specify group variable */ width = *3* /* specify bar width */ gspace = *2* /* specify space between groups */ type= pct /* specify type of statistic */ g100 /* specify within group pct calculation*/ maxis = axis1 /* assign midpoint axis options */ gaxis = axis2 /* assign group axis options */ raxis = axis3 /* assigns response axis options*/ legend = legend1 annotate = barlabel ; * run*;
Hi all, What I want to do is pretty simple, but I don't know off hand how to do it in SAS or if it can be done. I am plotting some data to go along with a simple one way ANOVA. The dep variable is on the Y axis and the treatment groups (group 1, group2,.., group 8) are on the x axis. What I want to do is to plot the means of each group with error bars above and below. On the error bars I want to put the upper and lower limits of the confidence interval for each mean. Is there any way to do this? Thanks so much for your help! Keith Dunnigan Sr. Biostatistician Mallinckrodt Medical