LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 14 Nov 2006 17:02:12 -0500
Reply-To:     Joe Whitehurst <joewhitehurst@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Joe Whitehurst <joewhitehurst@GMAIL.COM>
Subject:      Re: Proc Greplay with by groups
Comments: To: David Schmeidler <dschmeidler@immunetolerance.org>
In-Reply-To:  <C931FD4460CD3C4CA636B2C706E419C2D01A6C@bea-exch-01.immunetolerance.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

David,

Here's an example that might help you proceed. In this case I "knew" I would have 5 plots. But I have generated 500+ panels for a Greplay template and plotted them on a huge electrostatic plotter that used a 500 feet role of paper.

*proc gdevice;run; *annomac; options orientation=portrait; goptions reset=all ftext="Times-Bold"; ods listing close; ods pdf file='c:\n0321\graphs\t4ss.pdf' startpage=never; goptions device=pdfc /*targetdevice=pdfc*/ noborder display /* gsfname=gsf gsfmode=replace*/ ftext='Times-Bold' vpos=100 hpos=100;;

data annotitle; length text $30 font $30; %dclanno; %system(1,1,1); %label(50,50,'Total 4 Symptom Scores',black,0,0,50,'Times-Bold',5); run; proc gslide anno=annotitle gout=sasuser.n00321; run; quit;

filename gsf 'c:\n0321\graphs\t4ss.pdf'; goptions rotate=portrait hby=0 vsize=1.65 aspect=0 noborder;

axis1 label=none width=1 value=(h=1 f='Times-Bold') order=(4 to 8 by 1) minor=(number=4) length=80pct;

axis2 label=none width=1 value=(h=1 f='Times-Bold') order=(4 to 8 by 1) minor=(number=4) length=80pct;

/* define horizontal-axis characteristics */ axis3 label=none value=(h=1 f='Times-Bold') major=(number=28) order=(0 to 15) minor=none length=90pct; data effeff_means2; set effeff_means; qualifyv='A'; reflective_mean=reflective_am_mean; instant_mean=instant_am_mean; output; qualifyv='P'; reflective_mean=reflective_pm_mean; instant_mean=instant_pm_mean; output; run; data effeff_means2; set effeff_means2; if qualifyv='A' then day=day-.2; if qualifyv='P' then day=day+.2; data anno; length text $30; %dclanno; set effeff_means2; by seqtrt; %system(2,1,1); %sequence(b); if qualifyv=:'A' then do; %bar(day-.2,0,day+.2,100,ywh,0,solid); %label(day,99,'AM',black,0,0,6,'Times-Bold',5); %system(2,2,1); %sequence(a); %bar(day-.18,4,day+.56,4.5,white,0,solid); %bar(day-.18,4,day+.56,4.5,black,0,e); %sequence(a); %label(day+.2,4.3,'N='||left(_freq_),black,0,0,9,'Times-Bold',5); end; %sequence(b); if qualifyv=:'P' then do; %system(2,1,1); %bar(day+.2,0,day-.2,100,bwh,0,solid); %label(day,99,'PM',black,0,0,6,'Times-Bold',5); *system(2,2,1); *sequence(a); *bar(day+.18,4,day-.52,4.5,white,0,solid); end; *system(2,2,1); *sequence(a); *bar(day-.15,4,day+.2,4.25,white,0,solid); *label(50,85,put(seqtrt,$trts.),black,0,0,.00001,'Times-Bold',5);

if first.seqtrt then do; %sequence(a); %system(1,1,1); %bar(40,95,60,80,white,0,solid); %bar(40,95,60,80,black,0,e); %label(50,90,put(seqtrt,$trts.),black,0,0,10,'Times-Bold',5); %bar(70,95,95,80,white,0,solid); %bar(70,95,95,80,black,0,e); %line(70,90,80,90,green,1,1); %label(81,89.8,'Instantaneous',green,0,0,6,'Times-Bold',C); %label(74,90,'D',green,0,0,4,marker); %label(78,90,'D',green,0,0,4,marker);

%line(70,85,80,85,red,1,1); %label(81,84.8,'Reflective',red,0,0,6,'Times-Bold',C); %label(74,85,'U',red,0,0,4,marker); %label(78,85,'U',red,0,0,4,marker);

end; run; /* data anno2; %dclanno; set effeff_means2; %system(2,2,8); %sequence(a); if qualifyv=:'A' then do; %label(day,instant_mean,'D',blue,0,0,.15,marker,5); %label(day,reflective_mean,'U',blue,0,0,.15,marker,5); end; if qualifyv=:'P' then do; %label(day,instant_mean,'D',red,0,0,.15,marker,5); %label(day,reflective_mean,'U',red,0,0,.15,marker,5); end; */ symbol1 i=jr h=.75 c=green f=marker value='D' r=1 w=2 line=1 ci=green; symbol2 i=jr h=.75 c=red f=marker value='U' r=1 w=2 line=1 ci=red;

proc gplot data=effeff_means2(where=(seqtrt='1')) gout=sasuser.n00321;* anno=anno; by seqtrt; plot instant_mean*day=1 reflective_mean*day=2 / overlay anno=anno vaxis=axis1 haxis=axis3 autohref; plot2 instant_mean*day=1 reflective_mean*day=2 / overlay vaxis=axis2 haxis=axis3 autohref;

run; quit;

goptions vsize=0in border cback=white /* targetdevice=win*/ device=pdfc /*targetdevice=win*/ gsfname=gsf gsfmode=replace rotate=portrait;

proc greplay nofs; igout sasuser.n00321; tc sasuser.t00321n; template sixplot; treplay 1:gslide 2:gplot 3:gplot1 4:gplot2 5:gplot3 6:gplot4; run; run; quit;

/* proc format; value $trts '1'='PBO' '2'='EFZ 7 mg' '3'='EFZ 10 mg' '4'='EFZ 15 mg' '5'='EFZ 35 mg'; run; */ run; run; run; run; data anno2; length text $30; %dclanno; set effeff_means; by seqtrt; %system(2,1,1); %sequence(b); %system(2,2,1); %sequence(a); %bar(day-.18,4,day+.54,4.5,white,0,solid); %sequence(a); %label(day,4.3,'N='||left(_freq_),black,0,0,10,'Times-Bold',5); if first.seqtrt then do; %sequence(a); %system(1,1,1); %bar(40,95,60,75,white,0,solid); %bar(40,95,60,75,black,0,e); %label(50,85,put(seqtrt,$trts.),black,0,0,9,'Times-Bold',5);

%bar(70,98,95,78,white,0,solid); %line(70,95,80,95,green,1,1); %label(81,94.8,'Instantaneous PM',green,0,0,6,'Times-Bold',C); %label(74,95,'D',green,0,0,4,marker); %label(78,95,'D',green,0,0,4,marker);

%line(70,90,80,90,red,1,1); %label(81,89.8,'Reflective PM',red,0,0,6,'Times-Bold',C); %label(74,90,'U',red,0,0,4,marker); %label(78,90,'U',red,0,0,4,marker);

%line(70,85,80,85,blue,1,1); %label(81,84.8,'Instantaneous AM',blue,0,0,6,'Times-Bold',C); %label(74,85,'D',blue,0,0,4,marker); %label(78,85,'D',blue,0,0,4,marker);

%line(70,80,80,80,magenta,1,1); %label(81,79.8,'Reflective AM',magenta,0,0,6,'Times-Bold',C); %label(74,80,'U',magenta,0,0,4,marker); %label(78,80,'U',magenta,0,0,4,marker);

end;

goptions rotate=portrait hby=0 vsize=1.65 aspect=0 noborder; symbol1 i=j h=.75 c=green f=marker value='D' r=1 w=2 line=1 ci=green; symbol2 i=j h=.75 c=red f=marker value='U' r=1 w=2 line=1 ci=red;

symbol3 i=j h=.75 c=blue f=marker value='D' r=1 w=2 line=1 ci=blue; symbol4 i=j h=.75 c=magenta f=marker value='U' r=1 w=2 line=1 ci=magenta;

proc gplot data=effeff_means gout=sasuser.n00321;* anno=anno; by seqtrt; plot instant_pm_mean*day=1 reflective_pm_mean*day=2 instant_am_mean*day=3 reflective_am_mean*day=4 / overlay anno=anno2 vaxis=axis1 haxis=axis3 autohref; plot2 instant_pm_mean*day=1 reflective_pm_mean*day=2 instant_am_mean*day=3 reflective_am_mean*day=4 / overlay vaxis=axis2 haxis=axis3 autohref;

run; quit; goptions vsize=0in; proc greplay igout=sasuser.n00321 tc=sasuser.t00321n template=sixplot; run;

On 11/14/06, David Schmeidler <dschmeidler@immunetolerance.org> wrote: > > Thanks, Joe. > > > > Can I output a differently named plot for each by group processed? > > > > Or do I need to use a macro, loop once for each by group, subset my > dataset by each group, and so run Proc Gplot once for each by group and > output a graph to the catalog once per loop? > > > > Best, > > David > > > ------------------------------ > > *From:* Joe Whitehurst [mailto:joewhitehurst@gmail.com] > *Sent:* Tuesday, November 14, 2006 3:51 PM > *To:* David Schmeidler > *Cc:* SAS(r) Discussion > *Subject:* Re: Proc Greplay with by groups > > > > First, make the unknown known, then use this now known information to > control the generation of the panels for the Proc Greplay template. I > believe you can create up to 999 panels for a template, but you might need > a very large display device to be able to see the plots. > > On 11/14/06, *David* <dschmeidler@immunetolerance.org> wrote: > > Has anyone had experience greplay using by group processing with Proc > Gplot? I am trying to print multiple graphs per page. > > I've been searching the archives here and I see ways to do this if you > have a known number of plots, but what if there are an unknown number of > by groups? > > Thanks in advance for any help. > > >


Back to: Top of message | Previous page | Main SAS-L page