Previous Page | Next Page

Statistical Graphics Using ODS

Example 21.2 Creating Graphs for a Presentation

The RTF destination provides the easiest way to create ODS graphs for inclusion into a paper or presentation. You can specify the ODS RTF statement to create a file that is easily imported into a document (such as Microsoft Word or WordPerfect) or a presentation (such as Microsoft PowerPoint).

The following statements simulate 100 observations from the model , where and has a normal distribution with mean 0 and variance 1:

data one;
   do x = 1 to 100;
      y = log(x) + normal(104);

The following statements request a loess fit and save the output in the file loess.rtf:

ods listing close;
ods rtf file="loess.rtf";
ods graphics on;

proc loess data=one;
   model y = x / clm residual;

ods rtf close;
ods listing;

The output file includes various tables and the following plots: a plot of the selection criterion versus smoothing parameter, a fit plot with confidence bands, a plot of residual by regressors, and a diagnostics panel. The fit plot is produced with the RTF style and is shown in Output 21.2.1.

Output 21.2.1 Loess Fit Plot with the RTF Style
Loess Fit Plot with the RTF Style

If you are running SAS in the Windows operating system, you can open the RTF file in Microsoft Word and simply copy and paste the graphs into Microsoft PowerPoint. In general, RTF output is convenient for exchange of graphical results between Windows applications through the clipboard.

Alternatively, if you request ODS Graphics with the LISTING or HTML destinations, then your individual graphs are created as PNG files by default. You can insert these files into a Microsoft PowerPoint presentation. See the sections Naming Graphics Image Files and Saving Graphics Image Files for information about how the image files are named and saved.

Previous Page | Next Page | Top of Page