| Date: | Wed, 19 Sep 2007 16:48:35 -0400 |
| Reply-To: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Subject: | Re: help with proc gchart |
|
Does the following at least approximate that which you are trying to do?
data x;
input visit @10 PERCENT @21 P_value @31 legg $1. @43 treatment $1.;
cards;
1 5.0 0.700 a
1 3.22 0.700 b
2 10.25 0.600 a
2 12.67 0.600 b
3 32.48 0.300 a
3 20.05 0.300 b
4 36.78 0.067 a
4 25.78 0.067 b
5 38 0.252 a
5 40 0.252 b
6 42.67 0.252 a
6 35.00 0.252 b
7 40.67 0.252 a
7 37.00 0.252 b
8 49.00 0.020 * a
8 27.33 0.020 * b
;
DATA ANNO;
length color style $ 8;
retain color 'green' when 'a' style 'swissb'
xsys ysys '2' position 'E' size 4 hsys '3';
SET x;
group=visit;
subgroup=treatment;
midpoint=treatment;
text='*';
y=percent+5;
if p_value lt .05;
RUN;
goptions reset = all;
axis1 label=none value=none;
axis2 label=(a=90) order=(0 to 60 by 10) minor=(number=1);
axis3 label=('Week' j = left) nobrackets offset = (1,1);
pattern1 v=solid color=cxbd0026; /* reddish color */
pattern2 v=solid color=cx43a2ca; /* mild blue color*/
proc gchart data = x;
vbar treatment/discrete
ANNOTATE = ANNO
type = sum
group = visit
width = 4
sumvar = percent
space = 0
subgroup = treatment
maxis = axis1
raxis = axis2
gaxis = axis3
;
run;
quit;
Art
-------
On Wed, 19 Sep 2007 13:38:11 -0000, sassql@GMAIL.COM wrote:
>On Sep 19, 3:12 am, gerhard.hellrie...@T-ONLINE.DE (Gerhard
>Hellriegel) wrote:
>> another idea is to use GPLOT. You can draw thick lines to the points
which
>> look like bars.
>>
>> On Tue, 18 Sep 2007 20:23:30 -0400, Arthur Tabachneck
>>
>>
>>
>> <art...@NETSCAPE.NET> wrote:
>> >Can't that be done with annotate? See, e.g.,
>> >http://math.yorku.ca/SCS/Courses/grcat/grc6.html
>>
>> >HTH,
>> >Art
>> >-------
>> >On Tue, 18 Sep 2007 15:46:07 -0700, sas...@GMAIL.COM wrote:
>>
>> >>Dear all,
>>
>> >>The earlier question that i had asked to produce the bar chart. I have
>> >>produced the bar chart. The problem is i have to display an asterik on
>> >>the top of the bar at which the pvalue < 0.05. I am not sure how can i
>> >>do this using proc gchart. I know we can use pointlabel option in proc
>> >>gplot and i have done the same thing in proc gplot using pointlabel
>> >>option. However can someone tell me how can i put this asterik on the
>> >>top of the bar using proc gchart.
>>
>> >>Here is the data.
>>
>> >>visit PERCENT P_value legg treatment
>> >>1 5.0 0.700 a
>> >>1 3.22 0.700 b
>> >>2 10.25 0.600 a
>> >>2 12.67 0.600 b
>> >>3 32.48 0.300 a
>> >>3 20.05 0.300 b
>> >>4 36.78 0.067 a
>> >>4 25.78 0.067 b
>> >>6 42.67 0.252 a
>> >>6 35.00 0.252 b
>> >>8 49.00 0.020 * a
>> >>8 27.33 0.020 * a
>>
>> >>If you look in the above dataset variable legg has an asterik for
>> >>visit 8. So i want to display this asterik for visit 8 on the top of
>> >>the bar.
>>
>> >>Can someone tell me how to do this?
>> >>Regards,- Hide quoted text -
>>
>> - Show quoted text -
>
>Dear all,
>
>This is what i tried to do and it gives me following error and i am
>not quite sure why it is doing that.
>
>%ANNOMAC;
>DATA ANNO;
> SET x;
> %SYSTEM(2,2);
> IF LEGG = '*' THEN DO;
> %LABEL(TREATRCH, PERCENT, '*', BLACK, 0, 0, 1, ZAPF, E);
> END;
>RUN;
>
>goptions reset = all;
>axis1 label=none value=none;
>axis2 label=(a=90) order=(0 to 60 by 10) minor=(number=1);
>axis3 label=('Week' j = left) nobrackets offset = (1,1);
>/* pattern v=solid color=red; */
>pattern1 v=solid color=cxbd0026; /* reddish color */
>pattern2 v=solid color=cx43a2ca; /* this is the hex rgb color for
>mild blue */
>
>proc gchart data = x ANNOTATE = ANNO;
> vbar treatment/discrete
> type = sum group = visit
> width = 5
> sumvar = percent
> space = 0
> subgroup = treatment
> maxis = axis1
> raxis = axis2
> gaxis = axis3
> ; ;
>run;
>quit;
>
>This was the error that i got.
>
>ERROR DETECTED IN ANNOTATE= DATASET WORK.ANNO.
> USE THE XC VARIABLE FOR DATA VALUES WHEN TYPE IS CHARACTER
>NOTE: ERROR LIMIT REACHED IN ANNOTATE PROCESS.
>NOTE: PROCESSING TERMINATED BY INDIVIDUAL ERROR COUNT.
>NOTE: 1 TOTAL ERRORS.
>WARNING: Specified placement options have caused legend to extend
>beyond normal boundaries.
>653 quit;
>
>Can someone help me to make this code work?
>
>Regards,
|