%let gpath='.';
ods html close;
%let dpi=200;
ods listing gpath=&gpath image_dpi=&dpi;
/*--Format for tumor growth--*/
proc format;
value $growth
'Ongoing' = 'Treatment Ongoing'
'GrowthT' = 'Growth in target lesions'
'GrowthNT' = 'Growth in non target lesions'
;
run;
/*--Create some data--*/
data spider;
label Change='Change From Baseline, %';
input Subject $1-6 Week Change WeekS RGroup $25-45 TGroup $50-60;
change=change*100;
weeks=weeks+2;
datalines;
. . . Complete Response
. . . Partial Response
. . . Progressive Disease
101810 0 0.0 . Complete Response
101810 8 -0.60 . Complete Response
101810 16 -0.70 . Complete Response
101810 24 -0.70 . Complete Response
101810 32 -0.70 . Complete Response
101810 40 -0.70 . Complete Response
101810 48 -0.65 . Complete Response
101810 56 -0.70 56 Complete Response Ongoing
103101 0 0.0 . Progressive Disease
103101 8 0.5 . Progressive Disease
103101 16 0.7 16 Progressive Disease GrowthT
103105 0 0.0 . Progressive Disease
103105 8 0.3 . Progressive Disease
103105 16 0.4 . Progressive Disease
103105 24 0.6 24 Progressive Disease GrowthT
103201 0 0.0 . Partial Response
103201 8 -0.1 . Partial Response
103201 16 -0.3 . Partial Response
103201 24 -0.2 . Partial Response
103201 32 -0.4 . Partial Response
103201 40 -0.5 40 Partial Response GrowthNT
103205 0 0.0 . Partial Response
103205 8 -0.4 . Partial Response
103205 16 -0.5 . Partial Response
103205 24 -0.55 . Partial Response
103205 32 -0.55 . Partial Response
103205 40 -0.40 . Partial Response
103205 48 -0.70 . Partial Response
103205 58 -0.80 58 Partial Response Ongoing
;
run;
/*--Draw Spider Plot--*/
ods listing image_dpi=&dpi;
title "Tumor Response by Week";
ods graphics / reset width=5in height=3in imagename='Spider';
proc sgplot data=spider noborder tmplout='c:\spider.sas';
format tgroup $growth.;
symbolchar name=ongoing char='2192'x / scale=1;
symbolchar name=growtht char='2020'x / scale=1;
symbolchar name=growthnt char='2021'x / scale=1;
styleattrs datacontrastcolors=(green gold red)
datasymbols=(ongoing growtht growthnt );
refline 0 / lineattrs=(pattern=shortdash);
series x=week y=change / group=subject grouplc=rgroup groupmc=rgroup
markers markerattrs=(symbol=circlefilled)
lineattrs=(thickness=2 pattern=solid) name='a';
scatter x=weekS y=change / group=TGroup markerattrs=(size=16 color=black)
nomissinggroup name='b';
keylegend 'a' / title='Response' type=linecolor valueattrs=(size=7)
location=inside position=topright across=1 opaque;
keylegend 'b' / valueattrs=(size=7) noborder;
xaxis label='Week';
run;