130 likes | 268 Views
Introduction to ODS Graphics. Katherine Nicholas. Outline:. What is ODS Basic syntax Saving output to files Built-in graphics Identifying objects in output Outputting to datasets Closing remarks/troubleshooting. What is ODS?. ODS stands for output delivery system
E N D
Introduction to ODS Graphics Katherine Nicholas
Outline: • What is ODS • Basic syntax • Saving output to files • Built-in graphics • Identifying objects in output • Outputting to datasets • Closing remarks/troubleshooting
What is ODS? • ODS stands for output delivery system • It is still experimental, so be careful! • This is SAS’s attempt to match the graphing capacities of other packages like R
Basic Syntax: ods html; ods trace on/listing; ods graphics on; proc ods graphics off; ods trace off; ods html close;
Saving output to a file: ods rtf file=‘complete path’; Proc ods rtf close; Alternatives to rtf: ods document ods html ods latex ods listing ods pcl ods pdf ods ps
Styles: http://stat.lsu.edu/SAS_ODS_styles/SAS_ODS_styles.htm
Built in graphics: Example: Proc reg with iris data SAS automatically creates most of what you need to assess the validity of model assumptions, so don’t recreate the wheel! *Disclaimer: ODS graphics is a tool, and not a means to an end. Never publish a graph that you didn’t make!
Identifying Objects: You can pull out only the object that you want if you know what it’s called. ODS trace ODS select
Outputting to a dataset: output out=name var1=name var2=name; Now you have the raw data and can create any graphic or conduct any test that you want!
Need more info? • Check it out in your favorite procs, but not all of them are compatible with ods graphics. • Visit support.sas.com • Read the sugi papers.
Which procs are compatible? • CORR • FREQ • UNIVARIATE • ANOVA • BOXPLOT • CALIS • CLUSTER • CORRESP • FACTOR • GAM • GENMOD • GLM • GLIMMIX • GLMSELECT • KDE • LIFEREG • LOESS • LOGISTIC • MDS • MI • MIXED • MULTTEST • NPAR1WAY • PHREG • PLS • PRINCOMP • PRINQUAL • QUANTREG • REG • ROBUSTREG • RSREG • TRANSREG • TTEST
Closing Remarks/Troubleshooting: • All ODS statements need to be turned on/open and turned off/closed • ODS will not run if you are missing a “quit” or an “end” • SAS will not overwrite a file if it is open • SAS saves graphics options, so try “goptions reset=all” if you are having problems • SAS 9.2 has some issues under a 64-bit operating system – try “options helpbrowser=sas” if you are having problems • ODS produces a lot of files (especially ODS html), so delete what you don’t need after each use