02.05.2013 Views

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

168 Sample 5: <strong>SAS</strong>/GRAPH: ODS and PRINTERPATH System Option Chapter 7<br />

Sample 5: <strong>SAS</strong>/GRAPH: ODS and PRINTERPATH System Option<br />

Output: File ’.graphip.ps’ with the characteristics of the<br />

Universal Printer ’Postscript’<br />

Format: ODS<br />

options nodate;<br />

goptions reset=all;<br />

libname saslib ’.saslib.data’;<br />

filename out ’.graphip.ps’;<br />

options printerpath=(Postscript out);<br />

ods listing close;<br />

goptions device=sasprtc;<br />

ods printer;<br />

footnote "ODS and Universal Printer";<br />

title1 "Linear Regression";<br />

title2 "Results";<br />

proc reg data=saslib.houses;<br />

/* Regression model */<br />

Linear_Regression_Model: MODEL price = sqfeet / ;<br />

/* output dataset to use as input <strong>for</strong> plots */<br />

output out = WORK._PLOTOUT<br />

predicted = _predicted1<br />

residual = _residual1<br />

student = _student1<br />

rstudent = _rstudent1;<br />

run;<br />

quit;<br />

title1 "Regression Analysis";<br />

title2 "Plots";<br />

axis1 major=(number=5) width=1;<br />

axis3 major=(number=5) offset=(5 pct) width=1;<br />

proc gplot data=WORK._PLOTOUT;<br />

where price is not missing and<br />

sqfeet is not missing;<br />

/* ********* PREDICTED plots ********* */<br />

title9 "Observed price by Predicted price";<br />

symbol1 C=GREEN V=DOT height=2PCT interpol=NONE L=1 W=1;<br />

label _predicted1 = "Predicted price";<br />

where price is not missing and _predicted1 is not missing;<br />

plot price * _predicted1 /<br />

vaxis=AXIS1 vminor=0 haxis=AXIS3 hminor=0<br />

description = "Observed price by Predicted price";<br />

run;<br />

/* ********* RESIDUAL plots ********* */

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!