PROC SGPLOT does not have a QQPLOT statement like the one available in PROC UNIVARIATE, but you can use the SCATTER statement to create normal quantile-quantile plots after first computing the normal quantiles of your data.
The example titled "Creating a Normal Quantile Plot" in the Examples section of the UNIVARIATE documentation includes the following data set. An engineer is analyzing the distribution of distances between holes cut in steel sheets. The following statements save measurements of the distance between two holes cut into 50 steel sheets as values of the variable Distance in the data set Sheets:
A normal quantile plot is a plot of the ordered data values against their normal quantiles. Normal quantiles are computed as recommended by Blom (1958):
The Blom scores for the Distance variable can be computed and saved using the NORMAL=BLOM option in PROC RANK:
The SCATTER statement in PROC SGPLOT produces a Q-Q plot for Distance using the original data values and their normal quantiles:
You can use the LINEPARM statement to add a straight reference line whose slope and intercept are the scale and location parameters of the theoretical distribution. First, compute and save the parameters in an output data set using PROC UNIVARIATE.
This PROC SQL step reads the parameter values and stores them in macro variables named Loc and Scale.
The following statements produce the Q-Q plot with an added reference line.
Note that if there are ties in the data, then the PROC RANK normal scores also contain ties. To match the Q-Q plot in PROC UNIVARIATE exactly, you can use a DATA step to compute the normal scores from the order statistics.
First, store the number of nonmissing values in a macro variable:
The following steps compute the Blom scores using the order statistics:
The same PROC SGPLOT code from above can be used to generate the Q-Q plot.
Reference:
Blom, G. (1958), Statistical Estimates and Transformed Beta Variables, New York: John Wiley & Sons.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | SAS/GRAPH | z/OS | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |||
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |||
Microsoft® Windows® for x64 | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |||
Microsoft Windows XP Professional | 9.2 TS1M0 | |||
Windows Vista | 9.2 TS1M0 | |||
Windows Vista for x64 | 9.2 TS1M0 | |||
64-bit Enabled AIX | 9.2 TS1M0 | |||
64-bit Enabled HP-UX | 9.2 TS1M0 | |||
64-bit Enabled Solaris | 9.2 TS1M0 | |||
HP-UX IPF | 9.2 TS1M0 | |||
Linux | 9.2 TS1M0 | |||
Linux for x64 | 9.2 TS1M0 | |||
OpenVMS on HP Integrity | 9.2 TS1M0 | |||
Solaris for x64 | 9.2 TS1M0 |
Type: | Usage Note |
Priority: | |
Topic: | Analytics ==> Distribution Analysis Analytics ==> Statistical Graphics SAS Reference ==> Procedures ==> SGPLOT SAS Reference ==> Procedures ==> UNIVARIATE |
Date Modified: | 2018-03-23 13:33:00 |
Date Created: | 2012-08-17 09:33:23 |