1 / 15

SAS/GRAPH

SAS/GRAPH. The Basics. Today’s Topics. GOPTIONS GPLOT GCHART GCONTOUR G3D. Getting Started in SAS/GRAPH. GOPTIONS: Similar to OPTION, but specific to SAS/GRAPH Gives instructions about appearance of graphs Applies for entire SAS session or until reset within a session

onawa
Download Presentation

SAS/GRAPH

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SAS/GRAPH The Basics

  2. Today’s Topics • GOPTIONS • GPLOT • GCHART • GCONTOUR • G3D

  3. Getting Started in SAS/GRAPH • GOPTIONS: • Similar to OPTION, but specific to SAS/GRAPH • Gives instructions about appearance of graphs • Applies for entire SAS session or until reset within a session • Can appear anywhere in program, but preferably within SAS/GRAPH procedure Example 5.1.1

  4. GPLOT:Creating a Scatter Plot • Procedure GPLOT • PROC GPLOT DATA=dataset; • PLOT y*x(=z)/options; • RUN; • QUIT; Examples 5.2.1, 5.2.2

  5. SYMBOL Statement • Controls appearance of symbols in graph • Options include: • VALUE= (V=) • INTERPOL= (I=) • COLOR= (C=) • LINE= (L=) Example 5.3.1

  6. The OVERLAY and LEGEND options • Appear after slash (/) in PLOT statement • OVERLAY used when PLOT has more than one X or Y • OVERLAY cannot be used with form y*x=z • LEGEND option causes legend to print • Legend prints automatically with y*x=z form, but not with OVERLAY option

  7. AXIS Statement • Controls appearance of axes • Define which axis with VAXIS= and HAXIS= options in PLOT statement • Some options available include: • LABEL= • ORDER= • VALUE= • MINOR= • MAJOR= Example 5.3.2

  8. GCHART • Horizontal Bar Charts (2D and 3D) • Vertical Bar Charts (2D and 3D) • Pie Charts (2D and 3D) • Block Charts • Star Charts

  9. Creating a Histogram • Use the VBAR statement • Options include: • Specifying midpoints • Changing patterns in bars Examples 5.4.1, 5.4.2

  10. Creating Horizontal and Vertical Bar Frequency Charts • Statements are VBAR and HBAR • When data are counts, use FREQ= option Example 5.4.3

  11. Cross-Classification in Charts • Classify bars by 2 variables instead of just one • List one variable in HBAR or VBAR statement • List second variable in GROUP= option Example 5.4.5

  12. Plots of 3D Data • Contour plot (Y*X=Z format) • Y-variable defines y-axis • X-variable defines x-axis • Z-variable defines levels of contours • 3-D Plot (Y*X=Z format) • Y-variable defines y-axis • X-variable defines x-axis • Z-variable defines z-axis • Scatter plot or Surface plot Examples 5.6.1, 5.6.2

  13. Contour Plots • PROC GCONTOUR • Options available include: • LEVELS: levels of contours • LLEVELS: line types of contours • HAXIS, VAXIS: same as GPLOT • HREF, VREF: draws reference lines • LEGEND: same as before

  14. 3-D Plots • PROC G3D • Surface plot: PLOT statement • Scatter plot: SCATTER statement • Options available with only the PLOT statement: • CTOP, CBOTTOM: color of top and bottom of surface • Options available with only the SCATTER statement: • SHAPE: defines shapes of symbols • COLOR: defines color of symbols

  15. Options with PLOT or SCATTER in G3D • ROTATE: rotates graph specified # of degrees • TILT: tilts graph specified # of degrees (must be between 0 and 90) • XTICKNUM, YTICKNUM: defines # of tick marks • CAXIS: color of axes • ZMAX, ZMIN: defines min and max values for z-axis • GRID: draws grid “walls” Examples 5.6.3, 5.6.4, 5.6.5

More Related