לעיתים קרובות מאוד (תמיד?) הדרך הטובה ביותר לנתח ולהבין נתונים מספריים מתחילה בהצגה שלהם בצורה גרפית. הגרף המתאים מאפשר לנו לזהות בקלות תבניות, מגמות וחריגים ומציף מיד בעיות או חוסרים בנתונים.
ל -SAS יש מודול יעודי עבור יצירת גרפים בשם SAS/GRAPH אבל גם ה – SAS הבסיסי (SAS Base) כולל בתוכו יכולות גרפיות מרשימות ביותר המרוכזות תחת מספר proc-ים של משפחת ה – ODS Graphics.
ה – proc המרכזי שמאפשר לנו לייצר מגוון רחב של גרפים הוא sgplot כגון קו, עמודות, פאי ועוד רבים. ניתן, כמובן, לשלוט כמעט על כל מאפיין ועיצוב של הגרפים וגם לשלב מספר גרפים זה על גבי זה כדי לקבל תוצאות מרשימות ביותר בלי הרבה מאמץ.
נתחיל במשהו פשוט:
proc sgplot data=sashelp.steel;
series x=date y=steel;
run;
כדי לשלוט על המאפיינים הגלובלים של כל הגרפים, כמו למשל גודל או פורמט, יש לעשות שימוש בפקודה ods graphics:
ods graphics/width=1200px height=600px imagefmt=png;
proc sgplot data=sashelp.steel;
series x=date y=steel;
run;
וכדי לשלוט על המאפיינים הספציפיים של כל גרף יש מגוון אופציות נוספות התלויות בסוג הגרף:
proc sgplot data=sashelp.steel;
series x=date y=steel/lineattrs=(thickness=3px color=red pattern=shortdash)
markers markerattrs=(color=blue symbol=asterisk);
xaxis display=(nolabel) grid fitpolicy=rotatethin notimesplit;
yaxis grid label='ייצוא ברזל במיליוני טונות';
run;
חגי