SAS: Introduction to ODS

Robert Parker

In this lecture, we will discuss the Output Delivery System in SAS. We will cover how to

  • Control basic graphics options
  • Save output to rtf and pdf documents
  • Select/Exclude output using ODS
  • Control the layout of output with ODS
  • Add text the the output using ODS
  • Adjust styles with ODS.

ODS Output - RTF and PDF documents

We will use the Whas500 dataset for this lecture. First, let's load this dataset into SAS and see what it looks like.

In [2]:
LIBNAME myData "H:\BiostatCourses\PublicHealthComputing\Data";

PROC CONTENTS DATA = myData.whas500;
RUN;
Out[2]:
SAS Output

SAS Output

The SAS System

The CONTENTS Procedure

The CONTENTS Procedure

MYDATA.WHAS500

Attributes

Data Set Name MYDATA.WHAS500 Observations 500
Member Type DATA Variables 20
Engine V9 Indexes 0
Created 01/24/2016 14:00:17 Observation Length 160
Last Modified 01/24/2016 14:00:17 Deleted Observations 0
Protection   Compressed NO
Data Set Type   Sorted YES
Label      
Data Representation WINDOWS_64    
Encoding wlatin1 Western (Windows)    

Engine/Host Information

Engine/Host Dependent Information
Data Set Page Size 16384
Number of Data Set Pages 6
First Data Page 1
Max Obs per Page 102
Obs in First Data Page 81
Number of Data Set Repairs 0
ExtendObsCounter YES
Filename H:\BiostatCourses\PublicHealthComputing\Data\whas500.sas7bdat
Release Created 9.0401M1
Host Created X64_S08R2

Variables

Alphabetic List of Variables and Attributes
# Variable Type Len Format Label
1 ID Num 8   Identifcation Code
20 Years Num 8   Survival Time (Years)
9 afb Num 8 YESNOFMT. Atrial Fibrillation
2 age Num 8   Age at Hospital Admission
12 av3 Num 8 YESNOFMT. Complete Heart Block
7 bmi Num 8   Body Mass Index
11 chf Num 8 YESNOFMT. Congestive Heart Complications
8 cvd Num 8 YESNOFMT. History of Cardiovascular
6 diasbp Num 8   Initial Diastolic Blood Pressure
17 dstat Num 8 CENSA. Discharge Status From Hospital
19 fstat Num 8 CENSA. Vital Status at Last Follow-up
3 gender Num 8 SEX01FT. Gender
4 hr Num 8   Initial Heart Rate
18 lenfol Num 8   Total Length of Follow-up
16 los Num 8   Length of Hospital Stay
13 miord Num 8 ORD. MI Order
14 mitype Num 8 TYPE. MI Type
10 sho Num 8 YESNOFMT. Cardiogenic Shock
5 sysbp Num 8   Initial Systolic Blood
15 year Num 8 YR. Cohort Year

Sortedby

Sort Information
Sortedby gender
Validated YES
Character Set ANSI

Notice that this dataset has some saved formats. I have not permanently saved this formats as a format file, so we will need to rerun a PROC FORMAT statement before we print this dataset.

In [3]:
PROC FORMAT;
	VALUE YesNoFmt 1="Yes"
				   0="No";
	VALUE Sex01Ft  0="Male"
				   1="Female";
	VALUE yr       1="1997"
				   2="1999"
				   3="2001";
	VALUE ord      0="First"
				   1="Recurrent";
	VALUE type     0="Non Q-wave"
				   1="Q-wave";
	VALUE censA    0="Alive"
				   1="Dead";
RUN;

PROC PRINT DATA = myData.whas500 (OBS=5);
RUN;
Out[3]:
SAS Output

SAS Output

The SAS System

The PRINT Procedure

Data Set MYDATA.WHAS500

Obs ID age gender hr sysbp diasbp bmi cvd afb sho chf av3 miord mitype year los dstat lenfol fstat Years
1 1 83 Male 89 152 78 25.5405 Yes Yes No No No Recurrent Non Q-wave 1997 5 Alive 2178 Alive 5.96304
2 2 49 Male 84 120 60 24.0240 Yes No No No No First Q-wave 1997 5 Alive 2172 Alive 5.94661
3 4 70 Male 65 123 76 26.6319 Yes No No Yes No First Q-wave 1997 10 Alive 297 Dead 0.81314
4 5 70 Male 63 135 85 24.4126 Yes No No No No First Q-wave 1997 6 Alive 2131 Alive 5.83436
5 6 70 Male 76 83 54 23.2424 Yes No No No Yes First Non Q-wave 1997 1 Dead 1 Dead 0.00274

In SAS 9.3 and later, ODS GRAPHICS is on by default, so we don't need to run ODS GRAPHICS ON; to use it. First, let's duscuss some basic graphics options.

ODS GRAPHICS ;

  • ODS GRAPHICS statement can be used to adjust different graphical parameters such as height and width of plots.
  • OPTIONS
    • HEIGHT - height of output image
    • WIDTH - width of output image
    • IMAGENAME - specify the name of the output image for saving
    • OUTPUTFMT - graph format (e.g. BMP GIF JPEG PDF PNG PS SVG TIFF)
    • RESET - reset options to their default
In [3]:
ODS LISTING GPATH = "H:\BiostatCourses\PublicHealthComputing\Lectures\Week3ODS_EDA\SAS\img";

ODS GRAPHICS / IMAGENAME = "PanelPlots" OUTPUTFMT = PDF;
PROC SGPANEL DATA = myData.whas500;
 TITLE "Scatterplot of Systolic vs Diastolic by Gender";
 PANELBY gender;
 SCATTER X = diasbp Y = sysbp;
RUN;
TITLE; *Clear the title for future output;

ODS LISTING CLOSE;
Out[3]:
SAS Output

SAS Output

The SGPANEL Procedure

The SGPanel Procedure

The SGPanel Procedure

The GPATH option specifies the folder on your computer in which to save the output image. This code above will create a plot called PanelPlots.pdf in the img folder. The width and height options can be used to control the width and height of the output image.

In [4]:
ODS LISTING GPATH = "H:\BiostatCourses\PublicHealthComputing\Lectures\Week3ODS_EDA\SAS\img";

ODS GRAPHICS / Height = 2in Width = 2in IMAGENAME = "PanelPlotsSmall" OUTPUTFMT = PDF; *Change the height and width of the output image;
PROC SGPANEL DATA = myData.whas500;
 TITLE "Scatterplot of Systolic vs Diastolic by Gender with Different Width and Height";
 PANELBY gender;
 SCATTER X = diasbp Y = sysbp;
RUN;
TITLE;

ODS LISTING CLOSE;
ODS GRAPHICS / RESET = ALL; * Reset all graphics options to their default.;
Out[4]:
SAS Output

SAS Output

The SGPANEL Procedure

The SGPanel Procedure

The SGPanel Procedure

Above we used the listing option. We can save ouput to the rtf and pdf destinations as well. The defualt destination is the html destination, which is the output that you normally see inside SAS.

RTF stands for Rich Text Format and is similar to a Word document. When using ODS RTF there are a few common options

  • FILE - Specifies the location and name of the output file
  • BODYTITLE - puts titles and footnotes in the main part of the document and not in the header
  • COLUMNS = n - creates a column formatted output file with n columns
  • SASDATE - date and time appear at top of document
  • STARTPAGE = value - Determines page breaks in the output file. (NO = no page break, NOW = pagebreak at that point)
  • STYLE = style-name - style template for output

The ODS PDF destination saves the output into a pdf document. The most common options are shared with ODS RTF including FILE, COLUMNS, STARTPAGE, and STYLE.

In [5]:
ODS RTF FILE = "H:\BiostatCourses\PublicHealthComputing\Lectures\Week3ODS_EDA\SAS\ODS_RTF_Basics1.rtf";

PROC GLM DATA = myData.whas500 PLOTS = ALL;
	MODEL diasbp = sysbp;
RUN;
QUIT;

ODS RTF CLOSE;
Out[5]:
SAS Output

SAS Output

The GLM Procedure

The GLM Procedure

Data

Number of Observations

Number of Observations Read 500
Number of Observations Used 500

The GLM Procedure

Dependent Variable: diasbp Initial Diastolic Blood Pressure

Analysis of Variance

diasbp

Overall ANOVA

Source DF Sum of Squares Mean Square F Value Pr > F
Model 1 86450.7150 86450.7150 296.54 <.0001
Error 498 145184.9070 291.5360    
Corrected Total 499 231635.6220      

Fit Statistics

R-Square Coeff Var Root MSE diasbp Mean
0.373219 21.81589 17.07442 78.26600

Type I Model ANOVA

Source DF Type I SS Mean Square F Value Pr > F
sysbp 1 86450.71495 86450.71495 296.54 <.0001

Type III Model ANOVA

Source DF Type III SS Mean Square F Value Pr > F
sysbp 1 86450.71495 86450.71495 296.54 <.0001

Solution

Parameter Estimate Standard
Error
t Value Pr > |t|
Intercept 19.28921615 3.50895136 5.50 <.0001
sysbp 0.40756844 0.02366804 17.22 <.0001

Diagnostics Panel

Panel of Fit Diagnostics for diasbp, which displays scatter plots of residuals, absolute residuals, studentized residuals, and observed responses by predicted values, studentized residuals by leverage, Cook's D by observation, a Q-Q plot of residuals, a residual histogram, and a residual-fit spread plot.

Residual Plots

sysbp

Plot of Residual by sysbp for diasbp

Fit Plot

Fit Plot for diasbp by Initial Systolic Blood

The next example outputs the same linear regression results as above, but with different page breaks and no dates or page numbers.

In [6]:
PTIONS NODATE NONUMBER;
ODS RTF FILE = "H:\BiostatCourses\PublicHealthComputing\Lectures\Week3ODS_EDA\SAS\ODS_RTF_Basics2.rtf" 
    STARTPAGE = NO BODYTITLE STYLE = JOURNAL;

PROC GLM DATA = myData.whas500 PLOTS = ALL;
	MODEL diasbp = sysbp;
RUN;
QUIT;

ODS RTF CLOSE;
Out[6]:
SAS Output

SAS Output

The GLM Procedure

The GLM Procedure

Data

Number of Observations

Number of Observations Read 500
Number of Observations Used 500

The GLM Procedure

Dependent Variable: diasbp Initial Diastolic Blood Pressure

Analysis of Variance

diasbp

Overall ANOVA

Source DF Sum of Squares Mean Square F Value Pr > F
Model 1 86450.7150 86450.7150 296.54 <.0001
Error 498 145184.9070 291.5360    
Corrected Total 499 231635.6220      

Fit Statistics

R-Square Coeff Var Root MSE diasbp Mean
0.373219 21.81589 17.07442 78.26600

Type I Model ANOVA

Source DF Type I SS Mean Square F Value Pr > F
sysbp 1 86450.71495 86450.71495 296.54 <.0001

Type III Model ANOVA

Source DF Type III SS Mean Square F Value Pr > F
sysbp 1 86450.71495 86450.71495 296.54 <.0001

Solution

Parameter Estimate Standard
Error
t Value Pr > |t|
Intercept 19.28921615 3.50895136 5.50 <.0001
sysbp 0.40756844 0.02366804 17.22 <.0001

Diagnostics Panel

Panel of Fit Diagnostics for diasbp, which displays scatter plots of residuals, absolute residuals, studentized residuals, and observed responses by predicted values, studentized residuals by leverage, Cook's D by observation, a Q-Q plot of residuals, a residual histogram, and a residual-fit spread plot.

Residual Plots

sysbp

Plot of Residual by sysbp for diasbp

Fit Plot

Fit Plot for diasbp by Initial Systolic Blood

The NOTOC option prevents a table of contents from being generated in the pdf output.

In [7]:
ODS PDF FILE = "H:\BiostatCourses\PublicHealthComputing\Lectures\Week3ODS_EDA\SAS\ODS_PDF_Basics2.pdf" 
    STARTPAGE = NO NOTOC STYLE = JOURNAL;

PROC GLM DATA = myData.whas500 PLOTS = ALL;
	MODEL diasbp = sysbp;
RUN;
QUIT;

ODS PDF CLOSE;
Out[7]:
SAS Output

SAS Output

The GLM Procedure

The GLM Procedure

Data

Number of Observations

Number of Observations Read 500
Number of Observations Used 500

The GLM Procedure

Dependent Variable: diasbp Initial Diastolic Blood Pressure

Analysis of Variance

diasbp

Overall ANOVA

Source DF Sum of Squares Mean Square F Value Pr > F
Model 1 86450.7150 86450.7150 296.54 <.0001
Error 498 145184.9070 291.5360    
Corrected Total 499 231635.6220      

Fit Statistics

R-Square Coeff Var Root MSE diasbp Mean
0.373219 21.81589 17.07442 78.26600

Type I Model ANOVA

Source DF Type I SS Mean Square F Value Pr > F
sysbp 1 86450.71495 86450.71495 296.54 <.0001

Type III Model ANOVA

Source DF Type III SS Mean Square F Value Pr > F
sysbp 1 86450.71495 86450.71495 296.54 <.0001

Solution

Parameter Estimate Standard
Error
t Value Pr > |t|
Intercept 19.28921615 3.50895136 5.50 <.0001
sysbp 0.40756844 0.02366804 17.22 <.0001

Diagnostics Panel

Panel of Fit Diagnostics for diasbp, which displays scatter plots of residuals, absolute residuals, studentized residuals, and observed responses by predicted values, studentized residuals by leverage, Cook's D by observation, a Q-Q plot of residuals, a residual histogram, and a residual-fit spread plot.

Residual Plots

sysbp

Plot of Residual by sysbp for diasbp

Fit Plot

Fit Plot for diasbp by Initial Systolic Blood

ODS SELECT and EXCLUDE

By now you have probably noticed that SAS by default gives lots of output even if we may only want a single graph or table. Using ODS SELECT or EXCLUDE allows us to choose what output we want to see in our results. In order to select a certain table or graph, we will need to know its name. We can find the name of output tables and graphs in the SAS documentation or by using ODS TRACE.

In [ ]:
ODS TRACE ON;
PROC GLM DATA = myData.whas500 PLOTS(UNPACK) = ALL;
	MODEL diasbp = sysbp;
RUN;
QUIT;
ODS TRACE OFF;

We get the following in our log file.

Output Added:
-------------
Name:       NObs
Label:      Number of Observations
Template:   STAT.GLM.NObsNotitle
Path:       GLM.Data.NObs
-------------

Output Added:
-------------
Name:       OverallANOVA
Label:      Overall ANOVA
Template:   stat.GLM.OverallANOVA
Path:       GLM.ANOVA.diasbp.OverallANOVA
-------------

Output Added:
-------------
Name:       FitStatistics
Label:      Fit Statistics
Template:   stat.GLM.FitStatistics
Path:       GLM.ANOVA.diasbp.FitStatistics
-------------

Output Added:
-------------
Name:       ModelANOVA
Label:      Type I Model ANOVA
Template:   stat.GLM.Tests
Path:       GLM.ANOVA.diasbp.ModelANOVA
-------------

Output Added:
-------------
Name:       ModelANOVA
Label:      Type III Model ANOVA
Template:   stat.GLM.Tests
Path:       GLM.ANOVA.diasbp.ModelANOVA
-------------

Output Added:
-------------
Name:       ParameterEstimates
Label:      Solution
Template:   stat.GLM.Estimates
Path:       GLM.ANOVA.diasbp.ParameterEstimates
-------------

Output Added:
-------------
Name:       ResidualByPredicted
Label:      Residual by Predicted
Template:   Stat.GLM.Graphics.ResidualByPredicted
Path:       GLM.ANOVA.diasbp.DiagnosticPlots.ResidualByPredicted
-------------

Output Added:
-------------
Name:       RStudentByPredicted
Label:      RStudent by Predicted
Template:   Stat.GLM.Graphics.RStudentByPredicted
Path:       GLM.ANOVA.diasbp.DiagnosticPlots.RStudentByPredicted
-------------

Output Added:
-------------
Name:       RStudentByLeverage
Label:      RStudent by Leverage
Template:   Stat.GLM.Graphics.RStudentByLeverage
Path:       GLM.ANOVA.diasbp.DiagnosticPlots.RStudentByLeverage
-------------

Output Added:
-------------
Name:       QQPlot
Label:      Q-Q Plot
Template:   Stat.GLM.Graphics.QQ
Path:       GLM.ANOVA.diasbp.DiagnosticPlots.QQPlot
-------------

Output Added:
-------------
Name:       ObservedByPredicted
Label:      diasbp by Predicted
Template:   Stat.GLM.Graphics.ObservedByPredicted
Path:       GLM.ANOVA.diasbp.DiagnosticPlots.ObservedByPredicted
-------------

Output Added:
-------------
Name:       CooksDPlot
Label:      Cook's D Plot
Template:   Stat.GLM.Graphics.CooksD
Path:       GLM.ANOVA.diasbp.DiagnosticPlots.CooksDPlot
-------------

Output Added:
-------------
Name:       ResidualHistogram
Label:      Residual Histogram
Template:   Stat.GLM.Graphics.ResidualHistogram
Path:       GLM.ANOVA.diasbp.DiagnosticPlots.ResidualHistogram
-------------

Output Added:
-------------
Name:       RFPlot
Label:      RF Plot
Template:   Stat.GLM.Graphics.RF
Path:       GLM.ANOVA.diasbp.DiagnosticPlots.RFPlot
-------------

Output Added:
-------------
Name:       ResidualPlots
Label:      sysbp
Template:   Stat.GLM.Graphics.Residual
Path:       GLM.ANOVA.diasbp.ResidualPlots.ResidualPlots
-------------

Output Added:
-------------
Name:       FitPlot
Label:      Fit Plot
Template:   Stat.GLM.Graphics.Fit
Path:       GLM.ANOVA.diasbp.FitPlot
-------------

For this example, let's only keep

  • OverallANOVA table
  • ParameterEstimates table
  • ResidualByPredicted
  • FitPlot
In [4]:
ODS PDF FILE = "H:\BiostatCourses\PublicHealthComputing\Lectures\Week3ODS_EDA\SAS\ODS_PDF_Select.pdf" STARTPAGE = NO NOTOC STYLE = JOURNAL;
ODS GRAPHICS / HEIGHT = 3in WIDTH = 4in;

PROC GLM DATA = myData.whas500 PLOTS(UNPACK) = ALL;
	MODEL diasbp = sysbp;
	ODS SELECT OverallANOVA ParameterEstimates ResidualByPredicted FitPlot; * ONly output the selected object. Could have also excluded all the unwanted objects.;
RUN;
QUIT;

ODS PDF CLOSE;
ODS GRAPHICS / RESET = ALL;
Out[4]:
SAS Output

SAS Output

The SAS System

The GLM Procedure

Dependent Variable: diasbp Initial Diastolic Blood Pressure

The GLM Procedure

Analysis of Variance

diasbp

Overall ANOVA

Source DF Sum of Squares Mean Square F Value Pr > F
Model 1 86450.7150 86450.7150 296.54 <.0001
Error 498 145184.9070 291.5360    
Corrected Total 499 231635.6220      

Solution

Parameter Estimate Standard
Error
t Value Pr > |t|
Intercept 19.28921615 3.50895136 5.50 <.0001
sysbp 0.40756844 0.02366804 17.22 <.0001

Diagnostic Plots

Residual by Predicted

Plot of Residual by Predicted for diasbp

Fit Plot

Fit Plot for diasbp by Initial Systolic Blood

ODS OUTPUT

The ODS OUTPUT statement allows us to save the output tables from a procedure as a SAS dataset for us to work with, say for example if we want to extract p-values.

In [6]:
PROC GLM DATA = myData.whas500;
	MODEL diasbp = sysbp;
    ODS SELECT ParameterEstimates;
	ODS OUTPUT ParameterEstimates = parEst;
RUN;
QUIT;

PROC PRINT DATA = parEst;
RUN;
Out[6]:
SAS Output

SAS Output

The SAS System

The GLM Procedure

Dependent Variable: diasbp Initial Diastolic Blood Pressure

The GLM Procedure

Analysis of Variance

diasbp

Solution

Parameter Estimate Standard
Error
t Value Pr > |t|
Intercept 19.28921615 3.50895136 5.50 <.0001
sysbp 0.40756844 0.02366804 17.22 <.0001

The SAS System

The PRINT Procedure

Data Set WORK.PAREST

Obs Dependent Parameter Estimate StdErr tValue Probt
1 diasbp Intercept 19.28921615 3.50895136 5.50 <.0001
2 diasbp sysbp 0.40756844 0.02366804 17.22 <.0001

Many procedures also have calculated results that can be output using the OUTPUT statement. This statement will add the selected output along with your current dataset into a new datasets specified in the OUT = statement. For example, let's get the residuals and predicted values.

In [10]:
PROC GLM DATA = myData.whas500;
	MODEL diasbp = sysbp;
    ODS SELECT _NONE_;
	OUTPUT OUT = resAndPred PREDICTED = pred RESIDUAL = resid;
RUN;
QUIT;

PROC PRINT DATA = resAndPred (OBS = 5);
VAR pred resid;
RUN;
Out[10]:
SAS Output

SAS Output

The SAS System

The PRINT Procedure

Data Set WORK.RESANDPRED

Obs pred resid
1 81.2396 -3.2396
2 68.1974 -8.1974
3 69.4201 6.5799
4 74.3110 10.6890
5 53.1174 0.8826

ODS TEXT and LAYOUT

ODS text can be used to add text in your output and ODS LAYOUT can be used to control appearance such as making a two column layout for plots.

In [11]:
PROC TRANSPOSE DATA = parEst OUT = parEstWide;
	ID Parameter;
	VAR Estimate;
RUN;

PROC PRINT DATA = parEstWide;
RUN;

ODS PDF FILE = "H:\BiostatCourses\PublicHealthComputing\Lectures\Week3ODS_EDA\SAS\ODS_PDF_Out.pdf" STARTPAGE = NO NOTOC STYLE = JOURNAL;
ODS GRAPHICS / HEIGHT = 3in WIDTH = 4in;
PROC GLM DATA = myData.whas500 PLOTS(UNPACK) = ALL;
	MODEL diasbp = sysbp;
	ODS SELECT OverallANOVA ParameterEstimates; * ONly output the selected object. Could have also excluded all the unwanted objects.;
RUN;
QUIT;

*PROC ODSTEXT can be used to write text and make lists in your output;
PROC ODSTEXT DATA = parEstWide;
p "The least squares regression equation is y = "|| put(intercept,5.4) || " + " || put(sysbp,5.4)|| "x" / style = {just = c};
RUN;

PROC GLM DATA = myData.whas500 PLOTS(UNPACK) = ALL;
	MODEL diasbp = sysbp;
	ODS SELECT ResidualByPredicted FitPlot; * Only output the selected object. Could have also excluded all the unwanted objects.;
RUN;
QUIT;

ODS PDF CLOSE;
ODS GRAPHICS / RESET = ALL;
Out[11]:
SAS Output

SAS Output

The SAS System

The PRINT Procedure

Data Set WORK.PARESTWIDE

Obs _NAME_ Intercept sysbp
1 Estimate 19.28921615 0.40756844

The SAS System

The GLM Procedure

Dependent Variable: diasbp Initial Diastolic Blood Pressure

The GLM Procedure

Analysis of Variance

diasbp

Overall ANOVA

Source DF Sum of Squares Mean Square F Value Pr > F
Model 1 86450.7150 86450.7150 296.54 <.0001
Error 498 145184.9070 291.5360    
Corrected Total 499 231635.6220      

Solution

Parameter Estimate Standard
Error
t Value Pr > |t|
Intercept 19.28921615 3.50895136 5.50 <.0001
sysbp 0.40756844 0.02366804 17.22 <.0001

The ODSTEXT Procedure

WORK_PARESTWIDE

The least squares regression equation is y = 19.29 + .4076x


The SAS System

The GLM Procedure

Dependent Variable: diasbp Initial Diastolic Blood Pressure

The GLM Procedure

Analysis of Variance

diasbp

Diagnostic Plots

Residual by Predicted

Plot of Residual by Predicted for diasbp

Fit Plot

Fit Plot for diasbp by Initial Systolic Blood

ODS LAYOUT has two main options

  • Absolute - specify exact location of elements on the page
  • Gridded - specify rows and columns

We will only look at gridded output as an example of what you can do.

In [15]:
ODS GRAPHICS / WIDTH = 3.25in HEIGHT = 2.25in;
ODS PDF FILE = "H:\BiostatCourses\PublicHealthComputing\Lectures\Week3ODS_EDA\SAS\ODS_PDF_Layout.pdf" 
    STARTPAGE = NO NOTOC STYLE = JOURNAL;
ODS LAYOUT GRIDDED COLUMNS = 2 WIDTH = 7in COLUMN_GUTTER = 0.15in;
ODS REGION;

ODS ESCAPECHAR = "^";
ODS PDF TEXT = "^{style [FONT_WEIGHT = BOLD] Column} ^{style [FONT_STYLE = ITALIC] 1 of gridded layout}";
PROC GLM DATA = myData.whas500 PLOTS(UNPACK)=ALL;
	MODEL diasbp = sysbp;
	ODS SELECT ResidualByPredicted RStudentByPredicted RStudentByLeverage;
RUN;
QUIT;

ODS REGION;

ODS PDF TEXT = "Column 2 of gridded layout";
PROC GLM DATA = myData.whas500 PLOTS(UNPACK)=ALL;
	MODEL diasbp = sysbp;
	ODS SELECT QQPlot ResidualHistogram RFPlot;
RUN;
QUIT;
TITLE;
ODS LAYOUT END;
ODS PDF CLOSE;
ODS GRAPHICS / RESET = ALL;
Out[15]:
SAS Output

SAS Output

The GLM Procedure

Dependent Variable: diasbp Initial Diastolic Blood Pressure

The GLM Procedure

Analysis of Variance

diasbp

Diagnostic Plots

Residual by Predicted

Plot of Residual by Predicted for diasbp

RStudent by Predicted

Plot of RStudent by Predicted for diasbp

RStudent by Leverage

Plot of RStudent by Leverage for diasbp

The GLM Procedure

Dependent Variable: diasbp Initial Diastolic Blood Pressure

The GLM Procedure

Analysis of Variance

diasbp

Diagnostic Plots

Q-Q Plot

Q-Q Plot of Residuals for diasbp.

Residual Histogram

Histogram of Residuals for diasbp with normal and kernel densities overlaid.

RF Plot

Residual-Fit Spread Plot for diasbp. This plot displays two uniform Q-Q plots that show the spread in the fitted values about their mean and the spread in the residuals.
In [ ]: