Great Using Proc Sgplot, Proc Sgscatter, And ODS For SAS .

2y ago
61 Views
2 Downloads
633.27 KB
40 Pages
Last View : 3d ago
Last Download : 3m ago
Upload by : Grady Mosby
Transcription

Great Graphics Using Proc Sgplot,Proc Sgscatter, and ODS Graphics forSAS /Stat ProceduresKathy WelchCSCARThe University of MichiganMSUG Meeting, Tuesday April 27, 2010

What we will Cover Introduction to Statistical Graphics Procedures– Proc Sgplot– Proc Sgscatter– Proc Sgpanel Editing ODS graphics files Examples of ODS graphics with Statistical Procedures––––Proc ttestProc RegProc GLMProc Logistic

Statistical Graphics Using Proc Sgplot,Proc Sgscatter and Proc Sgpanel Statistical graphics plots use ODS (outputdelivery system) graphics Statistical graphics are easy to produce, looknice, and are more intuitive than traditionalSAS/Graph graphics Statistical Graphics can be edited (to someextent) interactively

Where are my graphs? Graphs created with ODS graphics will be inResults Window, not in Graph Window Double‐click on the graphics icon to view thefile, using local windows graphics viewer. Graphs will be automatically be saved as .pngfiles in current SAS folder png (portable network graphics) files are– Raster graphics– Compact format– Usable in most windows applications

Getting Started2. Double-click on graphicsfile icon to view graph1. Set the current folder

Boxplotsproc sgplot data mylib.employee;vbox salary; run;

Boxplots for Categoriesproc sgplot data mylib.employee;vbox salary/ category gender; run;

Paneled Boxplotsproc sgpanel data mylib.employee;panelby jobcat / rows 1 columns 3 ;vbox salary / category gender; run;

Barchartsproc sgplot data mylib.employee;vbar jobcat ; run;

Stacked Barchartsproc sgplot data mylib.employee;vbar jobcat /group Gender; run;

Barcharts with Means and Error Barsproc sgplot data mylib.employee;vbar jobcat / response salary limitstat stddevlimits upper stat mean; run;

Barcharts of Proportionsproc sgplot data afifi;vbar shoktype / response died stat mean;format shoktype shokfmt.; run;

Paneled Barchartsproc sgpanel data mylib.employee;panelby gender ;vbar jobcat / response salary limitstat stddevlimits upper stat mean; run;

Histogramsproc sgplot data mylib.employee;histogram salary ;density salary;density salary / type kernel;keylegend / location inside position topright;

Overlaid Histogramsproc sgplot data mylib.employee;histogram salbegin ;histogram salary / transparency .5; run;Note: Transparency 0 is opaque. Transparency 1.0 is fully transparent.

Scatterplotsproc sgplot data mylib.employee;scatter x salbegin y salary /group gender; run;

Scatterplot with Regression Lineproc sgplot data mylib.employee;where jobcat 1;scatter x prevexp y salary / group gender ;reg x prevexp y salary / cli clm nomarkers; run;

Regression Lines for Subgroupsproc sgplot data mylib.employee;where jobcat 1;reg x prevexp y salary / group gender; run;

Paneled Scatterplot with Loess Fitproc sgpanel data mylib.employee;panelby jobcat / columns 3;scatter x jobtime y salary / group gender;loess x jobtime y salary nomarkers; run;

Scatterplot Matrixproc sgscatter data mylib.employee;where jobcat 1;matrix salbegin salary jobtime prevexp / group genderdiagonal (histogram kernel); run;

SeriesPlotsproc sgpanel data autism;panelby sicdegp /columns 3;series x age y vsae / group Childidmarkers legendlabel " " lineattrs (pattern 1color black);

Generate Meansproc sort data autism;by sicdegp age;run;proc means data autism noprint;by sicdegp age;output out meandat mean(VSAE) mean VSAE;run;data autism2;merge autism meandat(drop type freq );by sicdegp age;run;

Mean Plots Overlaid on Raw Dataproc sgplot data autism2;series x age y mean VSAE / group SICDEGP;scatter x age y VSAE ; run;

Formats Make Graphs More Readableproc format;value jobcat 1 "Clerical"2 "Custodial"3 "Manager";value Gender "f" "Female""m" "Male";run;

Formats Make Graphs MoreReadable2proc sgpanel data mylib.employee;panelby jobcat / rows 1 columns 3 novarname;vbox salary / category gender ;format gender gender. jobcat jobcat; run;

Editing ODS Graphics Use “sgedit”, or “sgedit on” to enable ODSgraphics editor– Submit in command dialog box Two outputs will be created for each graph.– .png file– .sge (SAS Graphics Editor) file Edit the .sge file, and save as a .png to use inother applications.

Some of the Things you can Edit withthe ODS Graphics Editor Title, footnote Axis labels, colors, fonts, symbols, text boxes Graph Style (Try them)– Listing (the default, colors)– Analysis (color scheme)– Journal (grayscale)– Journal2 (black and white)– Statistical (color scheme)

SAS Graphics Editor Window

Creating PDF Output Send output to a pdf file Similar for HTML or rtf file outputods pdf style journal2;ods pdf file "testing.pdf";ods listing close;title "PDF Output";proc sgpanel data mylib.employee;panelby jobcat;scatter x jobtime y salary / group gender;loess x jobtime y salary / nomarkers ; run;ods pdf close;ods listing;

PDF Output will be in the ResultsViewer Window

Where to Get Help for StatisticalGraphics Procedures SAS Help and Documentation Contents SAS Products SAS/Graph SAS/Graph 9.2Statistical Procedures Guide SAS/GraphStatistical Graphics Procedures Once you find it, it’s really helpful.

ODS Graphics in SAS/Stat Procedures ODS graphics are available for statisticalprocedures Submit “ods graphics on;” before the procedure Submit “ods graphics off;” after the procedure Graphs are .png files, as for Proc Sgplot, Sgscatterand Sgpanel. ODS graphics show up after “drilling down” in theResults window for the procedure. Check SAS documentation for available ODSgraphics for each procedure

Proc ttestods graphics on;proc ttest data mylib.afifi;class survive;var sbp1;run;ods graphics off;

Proc Regods graphics on;title "Regression with Default Plots";proc reg data mylib.afifi;model sbp2 sbp1 sex age/partial;run; quit;ods graphics off;

Proc Reg Unpack Graphicsproc reg plots(only) DiagnosticsPanel(unpack);

Proc GLMods graphics on;title "Anova with Plots";proc glm data mylib.afifi;class shoktype ;model sbp1 shoktype;lsmeans shoktype / pdiff adjust tukey;run; quit;ods graphics off;

Proc GLM DiffPlot

Proc Logisticods graphics on;proc logistic data mylib.afifi descendingplots(only) (effect roccurve) ;class shoktype;model survive sbp1 shoktype;output out preddat p predict reschi rchiresdev rdevh leverage;run; quit;ods graphics off;

Proc Logistic ROC Curve and Effect Plot

Thank you! Try some of these graphs using your data. They’re easy and fun!

Great Graphics Using Proc Sgplot, Proc Sgscatter, and ODS Graphics for SAS /Stat Procedures Kathy Welch CSCAR The Un

Related Documents:

proc gplot, proc sgplot, proc sgscatter, proc sgpanel, . In SAS/Graph: proc gcontour, proc gchart, proc g3d, proc gmap, Stat 342 Notes. Week 12 Page 26 / 58. KDE stands for Kernel Density Estimation. It's used to make a smooth estimation of the probability density of a distribution from the points in a data set.

Getting Started with the SGPLOT Procedure Joshua M. Horstman, Nested Loop Consulting ABSTRACT Do you want to create highly-customizable, publication-ready graphics in just minutes using SAS? This workshop will introduce the SGPLOT procedure, which is part of the ODS Statistical Graphics package included in Base SAS.

Using SAS 9.2 and 9.3 This handout introduces the use of the SAS statistical graphics procedures: Proc Sgplot Proc Sgpanel Proc Sgscatter These are stand-alone procedures that create high quality graphs using a few simple SAS commands. These procedures can create boxplots, barcharts, histograms, scatterplots, line plots,

2. proc sql statement 1 ; 3. proc sql statement 2 ; 4. quit; /* required */ Lines 2, 3: all of the examples in the e-Guide are expected to be embedded between lines 1 and 4. SAS accepts one or more PROC SQL statements within each PROC SQL block of code. Eight common benefits for using PROC SQL:

Joshua M. Horstman, Nested Loop Consulting ABSTRACT Once you’ve mastered the fundamentals of using the SGPLOT procedure to generate high-quality graphics, you’ll certainly want to delve in to the extensive array of customizations available. This workshop will move beyond t

Great Great DVD Player. Manual & Auto. Great Sound System. Great Warranty. Great Dual Airbags. Great Roadside Assist Programme. Great Leather trim. Great Torque on Demand. Great Reversing camera. Great Bluetooth. . Great Wall H5 X200 Brochure Created Date: 5/8/2013 1:12:41 PM .

inventories' historical data from the U.S. Census Bureau's office of Manufacturers' Shipments, Inventories, and Orders' (M3) , we can create a graphical representation of two time series with PROC GPLOT and map out reported and expected results. By combining this output with results from PROC REG, we are able to highlight problem areas

Software Development , Scrum [11] [12], Scrumban [Ladas 2009 and several va-riant methods of agile]. The agile methodology is based on the “iterative enhancement” [13] technique [14]. As a iteration based methodology, each iteration in the agile methodology represents a small scale and selfcontained Software Development Life Cycle - (SDLC) by itself . Unlike the Spiral model [1] , agile .