Date: Tue, 21 Jul 2009 13:05:56 -0500
Reply-To: Robin R High <rhigh@UNMC.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Robin R High <rhigh@UNMC.EDU>
Subject: Re: Sample Size in GChart Legend
In-Reply-To: <200907211717.n6LAlNeb020176@malibu.cc.uga.edu>
Content-Type: text/plain; charset="US-ASCII"
Jon,
It's not clear if this is what you have in mind, though could play around
with making a format that includes the sample size for each arm and then
apply it to the variable name in GCHART:
proc means data=sashelp.class noprint nway;
class sex;
var height;
output out=nn(keep=sex n) n=n;
run;
DATA f; set nn;
rename sex = start; length label $12;
IF sex='M' then label = CATS("Male (n=",n,')') ;
IF sex='F' then label = CATS("Female (n=",n,')') ;
retain fmtname '$gnd' type 'c';
run;
proc print; run;
proc format cntlin=f;
run;
proc print data=nn; format sex $gnd. ; run;
goptions reset=all htext=1;
proc gchart data=sashelp.class;
vbar sex / noframe discrete width=12 space=2 type=freq;
format sex $gnd. ;
run; quit;
Robin High
UNMC
Jon Britt <jonathan_britt@BAXTER.COM>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
07/21/2009 12:32 PM
Please respond to
Jon Britt <jonathan_britt@BAXTER.COM>
To
SAS-L@LISTSERV.UGA.EDU
cc
Subject
Sample Size in GChart Legend
I have created bar graph with different color bars for different arms of
the
study (variable name = ARM). I want to put the individual sample sizes for
each arm in the legend. Is there a way to write a macro to do this?
Thanks!