Title: ODS Statistical Graphics
1ODS Statistical Graphics
November 10, 2004 Linda Atkinson
2Overview
- ODS for Statistical Graphics
- enables you to create statistical graphics as
automatically as tables are currently created - provides commonly used displays, including
scatter plots, histograms, box-and-whisker plots,
and contour plots, in ODS output - is experimental in SAS 9.1
3Procedures
- Procedures supporting ODS Graphics in SAS 9.1
- Base SAS ? TIMESERIES
- CORR ? UCM
- SAS/ETS ? VARMAX
- ARIMA ? X12
- AUTOREG SAS High-Performance Forecasting
- ENTROPY ? HPF
- EXPAND
- MODEL
- SYSLIN
4Procedures (cont.)
- SAS/STAT
- ANOVA ? LOGISTIC
- CORRESP ? MI
- GAM ? MIXED
- GENMOD ? PHREG
- GLM ? PRINCOMP
- KDE ? PRINQUAL
- LIFETEST ? REG
- LOESS ? ROBUSTREG
5A Simple Example
ods html ods graphics on proc reg
datasashelp.class model weightheight run qu
it ods graphics off ods html close
6Regression diagnostics
7Specifying a Destination
- ods pdf file'd\odsdemo\diagnostics.pdf'
- ods graphics on
- proc reg datasashelp.class
- model weightheight
- run
- quit
- ods graphics off
- ods pdf close
8Destinations Supported by ODS Graphics
9Changing style
ods pdf file'd\odsdemo\diagnostics.pdf'
styleanalysis ods graphics on proc reg
datasashelp.class model weightheight run qu
it ods graphics off ods pdf close
10Recommended styles
- Four SAS-supplied styles are recommended for use
with ODS Graphics - Analysis
- Default
- Journal
- Statistical
11 Default Style
Journal Style
Analysis Style
Statistical Style
12Selecting graphs
ods html styledefault ods graphics on ods
trace on / Lists the output objects created by
ODS. / proc reg datasashelp.class
plots(unpack) / UNPACK option displays
plots individually instead of in a
panel. / model weightheight run quit ods
graphics off ods html close ods trace off
13Trace output
Output Added ------------- Name
ResidualHistogram Label Residual
Histogram Template Stat.REG.Graphics.ResidualHi
stogram Path Reg.MODEL1.ObswiseStats.Weight
.DiagnosticPlots.ResidualHistogram -------------
Output Added ------------- Name
ResidualByPredicted Label Residual By
Predicted Template Stat.REG.Graphics.ResidualBy
Predicted Path Reg.MODEL1.ObswiseStats.Weig
ht.DiagnosticPlots.ResidualByPredicted -----------
--
14Selecting graphs (cont.)
ods html styledefault ods graphics on ods
select residualhistogram proc reg
datasashelp.class plots(unpack) model
weightheight run quit ods graphics off ods
html close
15Selected output created
16Procedure graph info
17Graph specification example
ods html ods graphics on proc lifetest
dataBMT time T Status(0) survival
plots(survival, hwb) strata Group run ods
graphics off ods html close
18Can copy and paste graphics
19Changing image file type
ods html ods graphics on / imagefmtjpeg
proc lifetest dataBMT time T Status(0)
survival plots(survival, hwb) strata
Group run ods graphics off ods html close
20 21Image Types
22 Creating graphs with tool tips
ods html file'd\odsdemo\boxplots.html'
gpath'd\odsdemo' / gpath option specifies
where to store graphics image files /
ods graphics on / imagefmtstaticmap /
staticmap option generates image map of
coordinates for tool tips / proc
mixed datapr methodml boxplot(npanel15)
class Person Gender model y Gender Age
GenderAge random intercept Age / typeun
subjectPerson run ods graphics off
ods html close
23Graph with tool tips
24Customizing Graphs
ods html ods graphics on proc robustreg
datagrowth plotresqqplot model GDP
LFG GAP EQP NEQ run ods graphics off ods
html close
25 26Edit the template
27Edit ENTRYTITLE
28Run Template Definition and Create New Graph
29Reverting to Default Templates
- Customized templates are stored in
Sasuser.Templat or in user-defined template
stores. The default templates provided by SAS are
saved in the read-only template store
Sashelp.Tmplmst. Consequently, if you have
modified any of the default templates and you
want to create ODS Graphics with the original
default templates, one way to do so is by
changing your ODS path as follows. - ods path sashelp.tmplmst(read)
- sasuser.templat(update)
30Modifying Styles
proc template define style styles.DemoStyle
parentstyles.Default replace StatGraphFitLine
/ linestyle2 end run ods html
styleDemoStyle ods graphics on proc robustreg
datagrowth plotresqqplot model GDP
LFG GAP EQP NEQ run ods graphics off ods html
close
31Graph with customized style
32 33 34PROC KDE Examples
35PROCs GLM, Model
36PROC TIMESERIES
37References
An Introduction to ODS for Statistical Graphics
in SAS 9.1, Robert N. Rodriguez, SUGI 29
Conference Proceedings, SAS Institute Inc.,
2004. http//www2.sas.com/proceedings/sugi29/204-2
9.pdf Statistical Graphics Using ODS
(Experimental), SAS/STAT Users Guide, SAS 9.1
online documentation TEMPLATE Procedure
Creating ODS Statistical Graphics Output
(Experimental) and ODS Statistical Graphics
(Experimental) and ODS Styles Usage and
Reference, all at http//support.sas.com/rnd/base
/topics/statgraph/
38Additional Papers
Thumbs Up for ODS Graphics, But Dont Throw Out
All Your SAS/GRAPH Programs!, Rick M Mitchell,
SUGI 29 Conference Proceedings, SAS Institute
Inc., 2004. http//www2.sas.com/proceedings/sugi29
/083-29.pdf Let the Data Speak New Regression
Diagnostics Based on Cumulative Residuals,
Gordon Johnston and Ying So, SUGI 28 Conference
Proceedings, SAS Institute Inc.,
2003. http//www2.sas.com/proceedings/sugi28/255-2
8.pdf