*** ORIGINAL FORMAT ***; goptions reset=all; title; goptions cback=white ctext=black gsfmode=replace ftitle=swissb ftext=swissb fby=swissb htitle=3 htext=2 gsfname=plot device=gif; axis1 color=black w=3 label=(h=2 'Dose Level'); axis2 color=black w=3 label=(h=2 a=90 'Percent of Trials as Target Level'); axis3 w=3 order=(0 to 200 by 50) label=('Prostate Size (gm)') minor=none; axis4 w=3 order=(0 to 1 by .25) label=(a=90 'Risk of Heterologous Transfusion'); axis5 c=black label=none value=none; pattern1 v=solid c=grey; filename plot "final1.gif"; proc gchart data=crm.final; vbar3d final / pct type=pct discrete maxis=axis1 raxis=axis2 cfr=white shape=cylinder width=10; run; quit; symbol1 c=black i=join l=1 value=none w=5 r=1; symbol2 c=black i=join l=2 value=none w=5 r=1; symbol3 c=black i=join l=3 value=none w=5 r=1; symbol4 c=black i=join l=4 value=none w=5 r=1; legend1 across=1 position=(top left inside) mode=protect offset=(0.2cm,-0.2cm) label=none value=(h=1.5 justify=left 'General/Combo - No hormones' 'General/Combo - Hormones' 'Epidural - No hormones' 'Epidural - Hormones'); filename plot "fig1bw.gif"; proc gplot data=fig1; plot prob*glandweight=epid_ht / vaxis=axis4 haxis=axis3 frame legend=legend1; title "Predicted Heterologous Transfusion"; title2 h=3 f=swissb "Rate by Prostate Size"; run; quit; axis6 color=black w=3 label=('Hours of Vigorous Activity'); axis7 color=black w=3 label=('DHEAS quartiles'); symbol1 w=3 r=1 c=black; filename plots 'Vigorhrs_boxplot.gif'; proc boxplot data=analdataener; plot vigorhrs*qdheas / boxstyle=schematic idsymbol=star cboxes=black vaxis=axis6 haxis=axis7; run; quit; ___________________________________________________________________________________________ ___________________________________________________________________________________________ *** EXPLAINED FORMAT ***; goptions reset=all; Resets all previous goptions title; Erases all previously declared titles ___________________________________________________________________________________________ goptions cback=white ctext=black gsfmode=replace ftitle=swissb ftext=swissb fby=swissb htitle=3 htext=2 gsfname=plot device=gif; CBACK=WHITE Sets background color to white CTEXT=BLACK Sets foreground color to black GSFMODE=REPLACE Replaces output file with new graph APPEND Appends graphs to end of output file FTITLE=SWISSB Sets the font for TITLE1 to Swiss Bold FTEXT=SWISSB Sets the font for text and subtitles to Swiss Bold FBY=SWISSB Sets the font for bylines to Swiss Bold HTITLE=3 Sets the height of titles to 3 cells HTEXT=2 Sets the height of text to 3 cells GSFNAME=PLOT Sets graphs to go in FILENAME PLOT DEVICE=GIF Makes output into a GIF plot PS Makes output into a PS plot ___________________________________________________________________________________________ axis1 color=black w=3 label=(h=2 'Dose Level'); Makes the first axis have color black, line width of 3 (on 1-5 scale), and have label with size of 2 axis2 color=black w=3 label=(h=2 a=90 'Percent of Trials as Target Level'); Same as above but with label turned 90 degress counter-clockwise; makes it flush with line axis3 w=3 order=(0 to 200 by 50) label=('Prostate Size (gm)') minor=none; axis3 w=3 order=(0,50,100,150,200) label=('Prostate Size (gm)') minor=none; Same as axis1 but with 5 major tick marks at 0, 50, 100, 150, and 200 and no minor tick marks in between axis4 w=3 order=(0 to 1 by .25) label=(a=90 'Risk of Heterologous Transfusion'); Similar to axis3 but with the turned label; good for vertical axis axis5 c=black label=none value=none; Black line with no labels or values printed; useful if only trend visualization is wanted ___________________________________________________________________________________________ pattern1 v=solid c=grey; pattern2 value=x1 c=red; COLOR=GREY Makes the fill color of the bars grey C=GREY V=SOLID Makes the fill pattern a solid color S V=EMPTY Makes an empty fill E VALUE=X1 Creates a crosshatch fill pattern with line density 1 (can range from 1-5) V=X1 V=L1 Makes the fill pattern have top-left to bottom-right lines with density 1 V=R1 Makes the fill pattern have top-right to bottom-left lines with density 1 ___________________________________________________________________________________________ filename plot "final1.gif"; Assigns the SAS name PLOT to the output file 'final1.gif' ___________________________________________________________________________________________ proc gchart data=crm.final; vbar3d final / pct type=pct discrete maxis=axis1 raxis=axis2 cfr=white shape=cylinder width=10; run; quit; VBAR3D FINAL Makes a 3D vertical bar chart of variable FINAL PERCENT Prints the percentage of total above each bar PCT FREQ frequency CFREQ cumulative frequency CPERCENT cumulative percentage SUM sum of SUMVAR (also have SUMVAR=varx option) MEAN mean of SUMVAR DISCRETE Makes a separate bar for each unique level of FINAL MAXIS=AXIS1 Assigns AXIS1 to the midpoint axis (horizontal axis) RAXIS=AXIS2 Assigns AXIS2 to the response axis (vertical axis) CFR=WHITE Sets the background color to white SHAPE=CYLINDER Sets shape of the bars to be cylinders BLOCK HEXAGON PRISM STAR WIDTH=10 Specifies that the bars should be 10 cells wide ___________________________________________________________________________________________ ___________________________________________________________________________________________ symbol1 c=black i=join l=1 value=none w=5 r=1; symbol2 c=black i=join l=2 value=none w=5 r=1; symbol3 c=black i=join l=3 value=none w=5 r=1; symbol4 c=black i=join l=4 value=none w=5 r=1; symbol6 c=red i=r l=1 value=dot w=3 r=1; C=BLACK Sets color of lines or shapes to be black C=RED red I=JOIN Connects the dots I=NONE No lines I=R Overlays a regression line over the points I=STEPLJ Interpolation in stepped lines. J joins the steps. L makes pt on left of step. STEPCJ C makes point in center of step STEPRJ R makes point on right of step (Previous 3 can also be run without the J, which means no vertical line connects the steps) L=# Line style choice; ranges from 1-46; 1 is solid; others are combinations of dashes and dots W=# Width of line; ranges from 1-5 R=# How many times symbol set is repeated VALUE=DOT Places a dot at each graph point CIRCLE circle PLUS plus sign ___________________________________________________________________________________________ legend1 across=1 position=(top left inside) mode=protect offset=(0.2cm,-0.2cm) label=none value=(h=1.5 justify=left 'General/Combo - No hormones' 'General/Combo - Hormones' 'Epidural - No hormones' 'Epidural - Hormones'); ACROSS=1 Makes the legend entries have 1 column DOWN=2 Makes the legend entries have 2 rows (Use only 1 of ACROSS or DOWN) MODE=PROTECT Protects the legend from the graphic symbols and lines OFFSET=(0.2CM,-0.2CM) Slides the legend over slightly from the left axis and down slightly from the top axis LABEL=NONE Specifies that the legend values have no header VALUE=(H=1.5 J=LEFT... Sets value height to 1.5, left-justified, with specified value labels CENTER center RIGHT right POSITION=(TOP LEFT INSIDE) Chooses the location of the legend; choose only 1 from MIDDLE CENTER OUTSIDE each column. BOTTOM RIGHT ___________________________________________________________________________________________ filename plot "fig1bw.gif"; Assigns the SAS name PLOT to the output file 'fig1bw.gif' ___________________________________________________________________________________________ proc gplot data=fig1; plot prob*glandweight=epid_ht / vaxis=axis4 haxis=axis3 frame legend=legend1; title "Predicted Heterologous Transfusion"; title2 h=3 f=swissb "Rate by Prostate Size"; run; quit; PLOT A*B=C Plots the variable A in the Y-dimension, variable B in the X-dimension, with different symbols for different values of variable C PLOT A*B C*D / OVERLAY Plots A by B and C by D on the same plot VAXIS=AXIS4 Sets AXIS4 to be the vertical axis HAXIS=AXIS3 Sets AXIS3 to be the horizontal axis FRAME Adds a frame around the graphics area; adds top and right axis LEGEND=LEGEND1 Sets LEGEND1 to be the legend for this plot ___________________________________________________________________________________________ ___________________________________________________________________________________________ axis6 color=black w=3 label=('Hours of Vigorous Activity'); Note for boxplots that vertical axis does NOT need the a=90 option for the label axis7 color=black w=3 label=('DHEAS quartiles'); symbol1 w=3 r=1 c=black; filename plots 'Vigorhrs_boxplot.gif'; ___________________________________________________________________________________________ proc boxplot data=analdataener; plot vigorhrs*qdheas / boxstyle=schematic idsymbol=star cboxes=black vaxis=axis6 haxis=axis7; run; quit; PLOT VIGORHRS*QDHEAS Makes boxplots of VIGORHRS for each value of QDHEAS BOXSTYLE=SCHEMATIC Draws whiskers only to values within 1.5IQR of lower/upper values; values outside this range will get special symbol SKELETAL Whiskers are drawn to the extreme values IDSYMBOL=STAR Chooses symbol for extreme values under BOXSTYLE=SCHEMATIC option CBOXES=BLACK Sets box lines to be black VAXIS=AXIS6 Sets AXIS6 as the vertical axis HAXIS=AXIS7 Sets Axis7 as the horizontal axis