LOG-FILE TO GIVE THE BASICS OF DRAWING GRAPHS & CHARTS =============================================== 9/11/06 libname home "."; data pima ; * Data example as in class & Script3.Log; set home.pima; run; * Look at first 10 records ; proc print data=pima (obs=10); run; options linesize = 70 nodate; proc plot data=pima (obs=50); title "Low quality scatterplot, 50 Pima obs"; PLOT diastolic*bmi ; run; GOPTIONS HSIZE=7 VSIZE=7; * default units are INCHES ; proc gplot data=pima ; title "High quality plot, 768 Pima obs"; PLOT diastolic*bmi ; run; * plots default + symbols ; *#### NOTE to save the postscript plots so that they look good enough to be worth sftp'ing and printing, you shoulds specify the size of the graph that you want, using GOPTIONS as above, and then print to file, with Postscript (I used Postscript level 2 with good results), and then specify the file you want to save to in your home WAM directory, somethoing like Graphout.ps. ######### ; proc chart data = pima ; title "Crude Histogram, Glucose"; vbar glucose / type = pct; run; * Actually not too bad !! But to get more detail, we will do a GCHART version, this time showing cumulative pct */ Crude Histogram, Glucose 5 Percentage | ** | ** 20 + ** | ** | ** ** | ** ** | ** ** ** 15 + ** ** ** | ** ** ** | ** ** ** ** | ** ** ** ** | ** ** ** ** 10 + ** ** ** ** | ** ** ** ** ** | ** ** ** ** ** | ** ** ** ** ** | ** ** ** ** ** ** ** 5 + ** ** ** ** ** ** ** ** | ** ** ** ** ** ** ** ** | ** ** ** ** ** ** ** ** ** | ** ** ** ** ** ** ** ** ** | ** ** ** ** ** ** ** ** ** ** ** ----------------------------------------------------------- 0 15 30 45 60 75 90 105 120 135 150 165 180 195 glucose Midpoint proc gchart data = pima ; title "Cumulative Histogram, Glucose"; vbar glucose / type = cpct; run; * compare the resulting histogram with ; proc univariate data=pima plot; var glucose; run; Crude Histogram, Glucose 9 The UNIVARIATE Procedure Variable: glucose Histogram # Boxplot 195+****** 18 | .********** 28 | .********* 25 | .*********** 31 | .************** 41 | .****************** 54 +-----+ .********************* 61 | | .********************************** 102 | + | .******************************** 94 *-----* .*************************************** 117 | | .******************************* 93 +-----+ .********************* 63 | .********* 25 | .*** 7 | .* 3 | .* 1 | . . . 5+** 5 0 ----+----+----+----+----+----+----+---- * may represent up to 3 counts