Problem Note 34895: Error in PROC REG documentation Example 61.8: Creating PP and QQ Plots
There are some omissions in the code in the Proc REG Example 61.8 in the SAS 9.1.3 Online documentation. The retain statement in the annotate dataset should be
retain ysys xsys '2' color 'black' when 'a';
The documentation is missing the last portion (when 'a') which directs the line to be drawn after the other options are applied. Without this option, the CFRAME=ligr option on the proc REG plot statement overwrites the line in gray. Also the
symbol1 c=blue ;
statement should be
symbol1 c=blue v=dot;
If you make those two changes you should be able to generate the graphics displayed in the documentation. Complete working code is available in the FULL CODE tab of this note.
Operating System and Release Information
| SAS System | SAS/STAT | z/OS | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Microsoft® Windows® for x64 | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Windows Vista | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| 64-bit Enabled AIX | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| 64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| 64-bit Enabled Solaris | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| HP-UX IPF | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Linux | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Linux on Itanium | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| OpenVMS Alpha | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Solaris for x64 | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
| Tru64 UNIX | 9.1 TS1M3 SP4 | 9.2 TS1M0 |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
/* Corrected Version of Example 61.8: Creating PP and QQ Plots */
data Fitness;
input Age Weight Oxygen RunTime @@;
datalines;
44 89.47 44.609 11.37 40 75.07 45.313 10.07
44 85.84 54.297 8.65 42 68.15 59.571 8.17
38 89.02 49.874 . 47 77.45 44.811 11.63
40 75.98 45.681 11.95 43 81.19 49.091 10.85
44 81.42 39.442 13.08 38 81.87 60.055 8.63
44 73.03 50.541 10.13 45 87.66 37.388 14.03
45 66.45 44.754 11.12 47 79.15 47.273 10.60
54 83.12 51.855 10.33 49 81.42 49.156 8.95
51 69.63 40.836 10.95 51 77.91 46.672 10.00
48 91.63 46.774 10.25 49 73.37 . 10.08
57 73.37 39.407 12.63 54 79.38 46.080 11.17
52 76.32 45.441 9.63 50 70.87 54.625 8.92
51 67.25 45.118 11.08 54 91.63 39.203 12.88
51 73.71 45.790 10.47 57 59.08 50.545 9.93
49 76.32 . . 48 61.24 47.920 11.50
52 82.78 47.467 10.50
;
data annote1;
length function color $8;
retain ysys xsys '2' color 'black' when 'a';
function='move';
x=0;
y=0;
output;
function='draw';
x=1;
y=1;
output;
run;
symbol1 c=blue v=dot;
proc reg data=fitness;
title 'PP Plot';
model Oxygen=RunTime / noprint;
plot npp.*r.
/ annotate=annote1 nostat cframe=ligr
modellab="'Best' Two-Parameter Model:";
run;
title 'QQ Plot';
plot r.*nqq.
/ noline mse cframe=ligr
modellab="'Best' Two-Parameter Model:";
run;
|
| Type: | Problem Note |
| Priority: | medium |
| Topic: | Analytics ==> Regression
|
| Date Modified: | 2009-02-23 15:11:48 |
| Date Created: | 2009-02-21 06:35:58 |