/* $Id: simple5.sas,v 1.3 2009/06/23 19:04:52 kkleinma Exp $ */ /* These examples use the HELP data sets, available from http://www.math.smith.edu/sasr/datasets.php. The code provided in these code files reads the data sets in the various formats provided there. For smooth running, we suggest downloading all of the files available. For Windows based systems, the files should be stored in c:\data. The code in the book was run on a windows system in this configuration. For other operating systems, you will need to modify the code below to reflect different directory structures and references. */ *** Code chunk number 1 ***; proc import datafile='c:/book/help.csv' out=ds dbms=dlm; delimiter=','; getnames=yes; run; *** Code chunk number 2 ***; axis1 minor=none; axis2 minor=none order=(5 to 60 by 13.625); axis3 minor=none order=(20, 40, 60); symbol1 i=sm65s v=circle color=black l=1 w=5; symbol2 i=sm65s v=triangle color=black l=2 w=5; proc gplot data=ds; where female eq 1 and substance eq 'alcohol'; plot indtot*cesd / vaxis=axis1 haxis=axis3; plot2 mcs*cesd / vaxis = axis2; run; quit; *** We suggest you open an ODS html output destination (section A.7.2) *** to contain the sg* procedure output. *** otherwise the this graphic output will be displayed in a platform-dependent *** viewer and can be found by navigating the Results window in the left-hand panel; *** This file must be closed in order to be viewed. *** In this file, we open the html output file here and close it at the end of the code; ods html; *** Code chunk number 3 ***; proc sgpanel data=ds; panelby g1b substance / layout=lattice; pbspline x=cesd y=mcs; run; quit; *** Code chunk number 4 ***; *** Code chunk number 5 ***; ods graphics on; ods select censoredsummary; proc lifetest data=ds plots=s(test); time dayslink*linkstatus(0); strata treat; run; ods graphics off; *** Code chunk number 6 ***; ods graphics on; ods select survivalplot; proc lifetest data=ds plots=s(test); time dayslink*linkstatus(0); strata treat; run; ods graphics off; *** Code chunk number 7 ***; ods graphics on; ods select roccurve; proc logistic data=ds descending plots(only)=roc; model g1b = cesd; run; ods graphics off; *** Code chunk number 8 ***; proc sgscatter data=ds; where female eq 1; matrix cesd mcs pcs i1 / diagonal=(histogram kernel); run; quit; *** Code chunk number 9 ***; *** Code chunk number 10 ***; proc sgscatter data=ds; matrix mcs pcs pss_fr drugrisk cesd indtot i1 sexrisk / ellipse=(alpha=.25) start=bottomleft markerattrs=(symbol=circlefilled size=2); run; quit; ods html close;