on paths less trodden… excursions in sas/graph ® and proc tabulate presented by aaron rabushka ©...

81
ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

Upload: clifton-sullivan

Post on 05-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

ON PATHS LESS TRODDEN…

Excursions

in SAS/GRAPH®

and

PROC TABULATE

Presented by Aaron Rabushka

© Aaron Rabushka 2000

Page 2: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PART I:

PROC TABULATE

Page 3: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE: GENERAL

• Powerful

• Tricky– has its own book:

• The SAS Guide to TABULATE

Processing

Page 4: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE: GENERAL

• Often used as a big brother to PROC FREQ to display counts and sums that require more than two levels of nesting on a page

• Can aggregate any level of its elements’ detail – label formatting can help distinguish

aggregations of variables

Page 5: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE:TYPES OF VARIABLES

Uses two kinds of variables:– classification variables

• CLASS statement

• can be either numeric or character variables

• can be grouped with a FORMAT statement

• default statistic is N

Page 6: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

PROC TABULATE DATA=HOLDOUT.AUDIT NOSEPS;

CLASS ZONE DAYNUM SYSID;

Page 7: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE:TYPES OF VARIABLES

Uses two kinds of variables: – classification variables

• CLASS statement • can be either numeric or character variables

• can be grouped with a FORMAT statement • default statistic is N

– analysis variables• VAR statement

• must be numeric

• default statistic is SUM

Page 8: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

PROC TABULATE DATA=HOLDOUT.AUDIT NOSEPS;CLASS ZONE DAYNUM SYSID;

VAR CPUTIME EXCTIME;

Page 9: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE:

INTERRELATING VARIABLES

• CONCATENATION– can concatenate variables and statistics to each

other in any dimension

• CROSSING (nesting)– reveals much of the power of PROC

TABULATE– can cross variables and statistics with each

other and also with formats

Page 10: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE:DIMENSIONS OF DISPLAY

• Can aggregate and display the aggregations in three dimensions (in ascending order of necessity):– column– row– page

• Dimensional specifications are separated with commas and can be quite complex

Page 11: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

PROC TABULATE DATA=HOLDOUT.AUDIT;CLASS ZONE DAYNUM SYSID;VAR CPUTIME EXCTIME;

TABLES ZONE,DAYNUM*SYSID,N CPUTIME*SUM EXCTIME*SUM;

Page 12: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE:DIMENSIONS OF DISPLAY

• Can aggregate in any dimension with ALL– can use labels to distinguish levels of

aggregation

Page 13: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

PROC TABULATE DATA=HOLDOUT.AUDIT NOSEPS;CLASS ZONE DAYNUM SYSID;VAR CPUTIME EXCTIME;

TABLES ZONE,(DAYNUM='DAY' ALL='ALL DAYS')*(SYSID ALL='ALL SYSTEMS'),N=‘NUMBER OF STEPS’*F=9. CPUTIME*SUM EXCTIME*SUM;

Page 14: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 15: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 16: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 17: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE:DIMENSIONS OF DISPLAY

• Can aggregate in any dimension with ALL– can use labels to distinguish levels of

aggregation

• Can also group data over pages with a BY statement--works if there is no need to aggregate across BY groups

Page 18: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE: AVAILABLE STATISTICS

• Can display many of the statistics available through PROC MEANS

• Percentages: PCTN (the percentage a cell comprises of a count) and PCTSUM (the percentage that a cell comprises of a sum)– it is IMPERATIVE and often tricky to use the

correct denominator! – wise to test on “easy” data before applying it to the

real data

Page 19: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

PROC TABULATE DATA=HOLDOUT.AUDIT;CLASS ZONE DAYNUM SYSID;VAR CPUTIME EXCTIME;

TABLES ZONE, (DAYNUM='DAY' ALL='ALL DAYS')*(SYSID ALL='ALL SYSTEMS'),N=‘NUMBER OF STEPS’*F=9.

PCTN<SYSID ALL> CPUTIME*(SUM PCTSUM<SYSID ALL>) EXCTIME*(SUM PCTSUM<SYSID ALL>);

Page 20: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 21: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE:DOWNLOADING OUTPUT

• Transfer as text

• May help to eliminate cell separators with the NOSEPS and/or FORMCHAR – pro: this can make the output easier to work

with in a spreadsheet– con: this can make the output confusing to

interpret by obscuring inter-cell relationships

Page 22: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 23: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 24: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PROC TABULATE:LIMITATIONS

• Can consume large (perhaps excessive) amounts of CPU time

• Version 8 is the first to include an OUTput dataset

Page 25: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

PART II:

SAS/GRAPH

Page 26: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: OUTPUT

• Connects with output equipment using appropriate GOPTIONS and JCL

• Can print output directly from the mainframe or download to a PC and process with Adobe Acrobat®

• Can also output directly to Intranet/Internet

Page 27: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: COORDINATES

SAS/GRAPH measures coordinates from the upper left corner of the page

Page 28: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: TEXT

• Can control any text in the output– headings

– axes

– footnotes

– annotations

• Can control many aspects of text in the output– font

– color

– weight

– slant

Page 29: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: ANNOTATIONS

• Add text to the outputs from SAS/GRAPH PROCs

• Stored in a SAS dataset that includes – text of the annotation – a value to link it to the input for the PROC– formatting information

Page 30: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: COLORS

• Can control colors of many elements of output, including– text– figures– borders

• Realization is device-dependent--colors may show up differently on (e.g.,) monitors and printers

• SAS can assign a default sequence of colors, or programmers can select sequences that they want

Page 31: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: COLORS

Can use several naming schemes:– SAS idiomatic color names

• eight pages of choices in the Version 6 manual

– RGB (RED/GREEN/BLUE) scheme– HLS (HUE/LIGHTNESS/SATURATION)

scheme– grey-scale scheme

Page 32: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PATTERNS

• SAS can assign a default sequence or programmers can determine a sequence

• Pattern designations other than SOLID and EMPTY depend on the direction and density of their lines and sometimes on the type of output

Page 33: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

* ASSIGN SOME PATTERNS AND COLORS;* SOLID FILLS: ;PATTERN1 VALUE=SOLID COLOR=PAB;PATTERN2 VALUE=SOLID COLOR=BLUE;PATTERN3 VALUE=SOLID COLOR=GREEN;* SLANTED LINES: ;PATTERN4 VALUE=L2 COLOR=DER;* CROSS-HATCHING: ;PATTERN5 VALUE=X4 COLOR=ORANGE;

Page 34: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: AXES

• Can create individual definitions of axes, then assign them in SAS/GRAPH PROCs

• Similar to creating SAS TITLEs• Can assign attributes including length, scale,

color, tick-markings, and attributes of text• Vertical or horizontal status is assigned in the

PROCs rather than the AXIS definitions

Page 35: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

* AXIS DEFINITIONS;AXIS1 LABEL=('MAINFRAME PRINTERS' HEIGHT=3) VALUE=(HEIGHT=1) ORDER='TPK' '3800' 'PRT' 'PAYR' 'STP' 'OTH';

AXIS2 ORDER=(O TO &MAXPAGES BY 20000) LABEL=(' ') VALUE=(HEIGHT=1);

Page 36: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: LEGENDS

• SAS/GRAPH has its own legend facility

• Can also use FOOTNOTEs as legends– can string SPECIAL-font K’s (case-sensitive)

together to produce color bands

Page 37: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

FOOTNOTE1 HEIGHT=1 BOX=3FONT=SPECIAL COLOR=VIR 'KKK 'FONT=SWISSB COLOR=BLACK 'TOPEKA 'FONT=SPECIAL COLOR=MOR 'KKK 'FONT=SWISSB COLOR=BLACK '3800 'FONT=SPECIAL COLOR=GREEN 'KKK 'FONT=SWISSB COLOR=BLACK 'OTHER';

Page 38: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: THE G-PREFIX

• All SAS/GRAPH PROCs begin with G-

• Requires a special set of SAS options--GOPTIONS

Page 39: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GSLIDE

Great for text screens

Page 40: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 41: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GSLIDE

Great for text screens– every element may need an observation in an

ANNOTATE dataset

Page 42: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

*BUILD AN ANNOTATION DATASET FOR A SLIDE: ;

DATA NOTES; SET ALLDAY;*OUTPUT THE DATE: ;X = 40; Y = 55 - (_N_ * 5);FUNCTION='LABEL'; COLOR = 'BLACK'; STYLE = 'SWISSB';TEXT=PUT(DATE,WORDDATE18.);OUTPUT;

Page 43: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE (cntd.)

* OUTPUT THE NUMBER OF PAGES: ;X=90; Y=55 - (_N_ - 5); FUNCTION='LABEL';IF COUNT >= 100000 THEN COLOR='RED'; ELSE COLOR='GREEN';

STYLE='SWISSB'; TEXT=PUT(COUNT,COMMA9.);OUTPUT;

Page 44: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE (cntd.)

* TEXT SLIDE FROM THE PRECEDING ANNOTATIONS: ;

PROC GSLIDE ANNOTATE=NOTES GOUT=PANELS;

TITLE1 HEIGHT=3 'PAGES PRINTED, BY DAY';

Page 45: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 46: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

–SAS/GRAPH: PROC GSLIDE

• Great for text screens – every element may need an observation in an ANNOTATE dataset

– also generates some graphics of its own (e.g., bar charts)

Page 47: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GCHART

Provides many standard graphing capabilities:– star charts– block charts– pie charts

Page 48: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 49: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GCHART

Provides many standard graphing capabilities:– star charts– block charts– pie charts– bar charts

Page 50: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GCHART

BAR CHARTS– horizontal bars (HBAR)

Page 51: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 52: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GCHART

BAR CHARTS– horizontal bars (HBAR)– vertical bars (VBAR)

Page 53: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 54: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLEPROC GCHART DATA=PRINTOUT;VBAR DEVNAME /

ANNOTATE=LABELS SUMVAR=PAGES

PATTERNID=MIDPOINT

AUTOREF MAXIS=AXIS1 RAXIS=AXIS2 CFRAME=LIGR COUTLINE=DAPB;

TITLE1 "PAGES PRINTED BY DEVICE FROM &FMDATE TO &TODATE";

FOOTNOTE1…

Page 55: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 56: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GCHART

BAR CHARTS– horizontal bars (HBAR)– vertical bars (VBAR)– can group bars with a GROUP statement and

stack them with a SUBGROUP statement

Page 57: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 58: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 59: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GCHART

Interesting use of the term “midpoint” to mean “category”– not used in its strict mathematical sense to

mean the half-way point between the two ends of a quantitative continuum

– can be used for any value, grouped or elemental, of a numeric or character variable

Page 60: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GPLOT

Cannot connect valuesin PROC

GCHART-- need to use GPLOT

Page 61: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GPLOT

• Can use SAS’s default symbols, or programmers can select which to use

• Can assign SYMBOL definitions comparably to AXIS or TITLE definitions

• Can use some pre-defined SAS symbols (e.g., DOT, SQUARE, DIAMOND) or can use letters, including their analogues in SPECIAL and MARKER fonts

Page 62: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GPLOT

Joining symbols: INTERPOLATION options

– no joining required

Page 63: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 64: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GPLOT

Joining symbols: INTERPOLATION options

– no joining required– lines (straight lines)

Page 65: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 66: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GPLOT

Joining symbols: INTERPOLATION options

– no joining required – lines (straight lines)

– splines (curved lines)– needles

• join symbols to the x-axis rather than to each other• can be made to look like bars on a bar graph

Page 67: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 68: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLESYMBOL1 VALUE=NONE WIDTH=90 INTERPOL=NEEDLE

COLOR=RED; SYMBOL2 VALUE=N HEIGHT=2 FONT=MARKER INTERPOL=JOIN

COLOR=ORANGE; SYMBOL3 VALUE=O HEIGHT=2 FONT=MARKER INTERPOL=JOIN

COLOR=VIR; SYMBOL4 VALUE=P HEIGHT=2 FONT=MARKER INTERPOL=JOIN

COLOR=MOR; PROC GPLOT DATA=TRNSDATE GOUT=PANELS;

PLOT (PRT STP TOP _3800)*ENDDATE / HAXIS=AXIS1 VAXIS=AXIS2 OVERLAY;

TITLE1…; TITLE2…; FOOTNOTE1…;

Page 69: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GPLOT

Several plots on a single graph– OVERLAY option: several plots keyed to a

single set of axes– PLOT2 option: one or more plots keyed to the

same x-axis as the first set of plots and to a second y-axis printed on the graph’s right

Page 70: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GREPLAY

Great for presenting output from several SAS/GRAPH procedures as panels on a single page

Page 71: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GREPLAY

Use a template partly generated through PROC GSLIDE and assigned in PROC GREPLAY

Page 72: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GREPLAY

Requires an internal (to the SAS job) catalog of output from preceding procedures– created by GOUT (graph output) clauses in

preceding procedures

Page 73: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

PROC GSLIDE GOUT=PANELS; TITLE1 HEIGHT=3 "THREE PANELS ON A PAGE"; RUN;

Page 74: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GREPLAY

Requires an interior (to the SAS job) catalog of output from preceding procedures– created by GOUT (graph output) clauses in

preceding procedures– referenced in GREPLAY with the IGOUT

(input graph output catalog)

Page 75: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE

PROC GSLIDE GOUT=PANELS; TITLE1 HEIGHT=3 "THREE PANELS ON A PAGE"; RUN; PROC GREPLAY IGOUT=PANELS TC=TEMPCAT NOFS;

Page 76: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

SAS/GRAPH: PROC GREPLAY

Need to assign proper co-ordinates for each corner of each panel

Page 77: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE (cntd.)

* DEFINE A TEMPLATE;

TDEF THREEPAN DES='THREE PANELS'

/* PANEL 1--UPPER HALF */ 1/ LLX=0 LLY=50 ULX=0 ULY=95 URX=100

URY=95 LRX=100 LRY=50

/* PANEL 2--LOWER LEFT */ 2/ LLX=0 LLY=0 ULX=0 ULY=50

URX=50 URY=50 LRX=50 LRY=0

/* PANEL 3--LOWER RIGHT */ 3/ LLX=50 LLY=0 ULX=50 ULY=50 URX=100 URY=50 LRX=100 LRY=0

/* PANEL 4--FOR FRAMING THE REST */ 4/ LLX=0 LLY=0 ULX=0 ULY=100 LRX=100 LRY=0 URX=100 URY=100;

Page 78: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

CODE EXAMPLE (cntd.)

* ASSIGN THE PRECEEDING TEMPLATE FOR USE.; TEMPLATE=THREEPAN;

* REPLAY PRECEDING OUTPUT INTO THE TEMPLATE'S PANELS.;

TREPLAY 1:GSLIDE 2:GCHART 3:GCHART1 4:GSLIDE1;

Page 79: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000
Page 80: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

OUTPUT EXAMPLES SCANNED

BY MAURA SCHREIER-FLEMING

Page 81: ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000

QUESTIONS?