FOCUS AREAS

Graphics

adverse events graph
Base SAS: Graph Template Language

%let gpath='.';
%let dpi=100;

ods escapechar="^";

data adverseEvents;
  attrib aedecod length=$46 label='Dictionary-Derived Term';
  attrib arm length=$20 label='Description of Planned Arm';
  attrib COUNT length=8 label='Frequency Count';
  attrib PERCENT length=8 label='Percent of Total Frequency';

  infile datalines dsd;
  input aedecod arm COUNT PERCENT ;

datalines4;
PRURITUS,Placebo,11,0.00923593618807
PRURITUS,Drug A,38,0.03190596137699
PRURITUS,Drug B,35,0.02938706968933
APPLICATION SITE PRURITUS,Placebo,10,0.00839630562552
APPLICATION SITE PRURITUS,Drug A,35,0.02938706968933
APPLICATION SITE PRURITUS,Drug B,33,0.02770780856423
ERYTHEMA,Placebo,13,0.01091519731318
ERYTHEMA,Drug A,22,0.01847187237615
ERYTHEMA,Drug B,24,0.02015113350125
APPLICATION SITE ERYTHEMA,Placebo,3,0.00251889168765
APPLICATION SITE ERYTHEMA,Drug A,23,0.0193115029387
APPLICATION SITE ERYTHEMA,Drug B,20,0.01679261125104
RASH,Placebo,9,0.00755667506297
RASH,Drug A,18,0.01511335012594
RASH,Drug B,18,0.01511335012594
APPLICATION SITE IRRITATION,Placebo,7,0.00587741393786
APPLICATION SITE IRRITATION,Drug A,16,0.01343408900083
APPLICATION SITE IRRITATION,Drug B,18,0.01511335012594
APPLICATION SITE DERMATITIS,Placebo,9,0.00755667506297
APPLICATION SITE DERMATITIS,Drug A,12,0.01007556675062
APPLICATION SITE DERMATITIS,Drug B,15,0.01259445843828
DIZZINESS,Placebo,3,0.00251889168765
DIZZINESS,Drug A,18,0.01511335012594
DIZZINESS,Drug B,13,0.01091519731318
SKIN IRRITATION,Placebo,4,0.0033585222502
SKIN IRRITATION,Drug A,8,0.00671704450041
SKIN IRRITATION,Drug B,13,0.01091519731318
SINUS BRADYCARDIA,Placebo,2,0.0016792611251
SINUS BRADYCARDIA,Drug A,12,0.01007556675062
SINUS BRADYCARDIA,Drug B,10,0.00839630562552
DIARRHOEA,Placebo,10,0.00839630562552
DIARRHOEA,Drug A,4,0.0033585222502
DIARRHOEA,Drug B,7,0.00587741393786
HEADACHE,Placebo,8,0.00671704450041
HEADACHE,Drug A,9,0.00755667506297
HEADACHE,Drug B,4,0.0033585222502
NASOPHARYNGITIS,Placebo,4,0.0033585222502
NASOPHARYNGITIS,Drug A,8,0.00671704450041
NASOPHARYNGITIS,Drug B,9,0.00755667506297
NAUSEA,Placebo,3,0.00251889168765
NAUSEA,Drug A,13,0.01091519731318
NAUSEA,Drug B,5,0.00419815281276
COUGH,Placebo,4,0.0033585222502
COUGH,Drug A,7,0.00587741393786
COUGH,Drug B,9,0.00755667506297
UPPER RESPIRATORY TRACT INFECTION,Placebo,12,0.01007556675062
UPPER RESPIRATORY TRACT INFECTION,Drug A,5,0.00419815281276
UPPER RESPIRATORY TRACT INFECTION,Drug B,2,0.0016792611251
HYPERHIDROSIS,Placebo,2,0.0016792611251
HYPERHIDROSIS,Drug A,10,0.00839630562552
HYPERHIDROSIS,Drug B,5,0.00419815281276
MYOCARDIAL INFARCTION,Placebo,4,0.0033585222502
MYOCARDIAL INFARCTION,Drug A,8,0.00671704450041
MYOCARDIAL INFARCTION,Drug B,4,0.0033585222502
VOMITING,Placebo,3,0.00251889168765
VOMITING,Drug A,9,0.00755667506297
VOMITING,Drug B,4,0.0033585222502
APPLICATION SITE VESICLES,Placebo,2,0.0016792611251
APPLICATION SITE VESICLES,Drug A,6,0.00503778337531
APPLICATION SITE VESICLES,Drug B,5,0.00419815281276
;;;;

proc template;
  define statgraph Top20AdverseEvents;
    begingraph;
      entrytitle "Percent of Top Twenty Adverse Events";
      layout lattice;
        layout overlay / yaxisopts=(reverse=true tickvalueattrs=(size=6pt)
            display=( tickvalues line)
            discreteOpts=(colorBands=even colorBandsAttrs=(transparency=0.3)))
            xaxisopts=(display=(ticks tickvalues line) tickvalueattrs=(size=6pt));
          scatterplot y=aedecod x=percent / group=arm name='scatter'
            markerattrs=(size=9 weight=bold);
          discretelegend 'scatter' / down=1;
        endlayout;
      endlayout;
    endgraph;
  end;
run;

ods _all_ close;
ods listing gpath=&gpath image_dpi=&dpi;

ods graphics / reset imagename="Top20AdverseEvents" width=6.93in height=3.15in;

proc sgrender data=adverseEvents template=Top20AdverseEvents;
run;

ods _all_ close;