1. (read data into SAS and creat permanent data sets) libname in 'C:\carsdata'; data in.recid; input week arrest fin age race wexp mar paro prio educ emp1-emp52; cards; 20 1 0 27 1 0 0 1 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1 0 18 1 0 0 1 8 4 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1 0 19 0 1 0 1 13 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 0 1 23 1 1 1 1 1 5 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 52 0 0 19 0 1 0 1 3 3 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (I ommit many lines of data here) ; run; libname in 'C:\carsdata'; libname out XPORT 'C:\carsdata\recid.xpt'; data out.recid; set in.recid; run; 2. (Bayes analysis with a normal prior on beta) data prior; input _TYPE_ $ age; datalines; Mean 5 Var 0.6 ; run; libname mylib 'C:\carsdata'; proc phreg data=mylib.recid; model week*arrest(0) = age/ties=efron; bayes seed=123 coeffprior=normal( input=prior ); run; 3. (plot residuals) libname mylib 'C:\carsdata'; proc phreg data = mylib.recid; model week*arrest(0) = age/ties=efron; output out=OutP xbeta=Xb resmart=Mart resdev=Dev; run; proc sgplot data=OutP; scatter y=Dev x=Xb; run; 4. (output a survival curve) data covs; input fin age prio; cards; 0 30 2 ; run; libname mylib 'C:\carsdata'; proc phreg data = mylib.recid; model week*arrest(0) = age fin prio /ties=efron; output out=pred covariates=covs survival=s /nomean; run; proc gplot data=pred; plot s*week; run;