*Load Data; DATA stagec; length ploidy $ 10; input pgtime pgstat age eet g2 grade gleason ploidy $; cards; 6.1 0 64 2 10.26 2 4 diploid 9.4 0 62 1 . 3 8 aneuploid 5.2 1 59 2 9.99 3 7 diploid 3.2 1 62 2 3.57 2 4 diploid 1.9 1 64 2 22.56 4 8 tetraploid 4.8 0 69 1 6.14 3 7 diploid 5.8 0 75 2 13.69 2 . tetraploid 7.3 0 71 2 . 3 7 aneuploid 3.7 1 73 2 11.77 3 6 diploid 15.9 0 64 2 27.27 3 7 tetraploid 6.3 0 65 2 19.34 3 7 tetraploid 2.9 1 58 2 14.82 4 8 tetraploid 1.5 1 70 2 10.22 3 8 diploid 14.5 0 67 2 15.66 2 6 tetraploid 4.2 1 66 2 17.79 3 7 tetraploid 1.7 1 74 2 11.11 3 8 diploid 5 0 70 2 11.44 2 5 diploid 13.2 0 57 2 14.78 2 4 tetraploid 10.9 0 63 2 54.93 3 8 tetraploid 13 0 65 2 24.58 3 7 tetraploid 11.4 0 62 2 27.79 2 5 tetraploid 2.6 1 72 2 14.86 3 6 tetraploid 9.8 0 64 1 10.51 2 5 diploid 3.4 1 67 . 14.22 2 6 tetraploid 7.6 1 64 2 15.28 2 5 tetraploid 4.8 1 70 2 16.91 3 6 tetraploid 3.7 1 58 1 17.87 3 7 tetraploid 13.9 0 57 2 12.13 3 6 diploid 4.9 1 54 1 17.25 2 5 tetraploid 15.9 0 61 1 16.53 3 7 tetraploid 2.9 1 68 2 17.49 2 4 tetraploid 9.3 0 64 1 3.85 3 6 aneuploid 6.5 0 70 1 7.88 2 6 diploid 1.7 0 64 2 16.64 2 5 tetraploid 6.9 0 66 2 13.19 3 7 tetraploid 5.5 0 61 2 9.42 2 5 diploid 5.7 0 70 2 22.79 2 5 tetraploid 4.1 1 63 2 11.37 2 6 diploid 0.3 1 59 2 3.77 3 6 aneuploid 1.1 1 66 1 13.76 3 6 tetraploid 7.8 0 53 2 14.52 2 5 tetraploid 2 1 62 2 7.55 3 7 diploid 7.3 0 69 2 8.46 2 5 diploid 13.5 0 63 2 7.66 3 7 diploid 11.7 0 61 2 8.4 2 5 diploid 8.7 0 70 1 4.43 1 3 diploid 3.4 0 61 2 10.37 3 7 diploid 6.3 0 62 2 10.82 2 6 diploid 10.6 0 55 2 7.81 2 5 diploid 9.3 0 61 2 11.23 2 5 diploid 7.9 0 63 2 13.99 3 6 tetraploid 4.9 0 67 2 6.41 2 5 diploid 13.4 0 59 2 16.05 2 5 tetraploid 17.7 0 58 2 22.97 3 6 tetraploid 1 1 61 1 2.4 4 10 diploid 0.3 1 47 2 11.92 4 10 diploid 13.1 0 65 2 . 3 6 tetraploid 16.7 0 56 2 5.29 1 3 diploid 4.5 0 63 2 5.75 2 5 diploid 3.4 1 69 1 7.64 3 8 aneuploid 2.4 1 50 1 16.81 3 7 tetraploid 6.8 0 70 2 29.56 2 5 tetraploid 3 1 55 1 13.35 3 6 aneuploid 10.4 0 55 2 8.1 2 5 diploid 11.8 0 62 1 12.62 2 5 diploid 8 1 66 2 14.14 2 5 tetraploid 5.7 0 71 1 10.16 2 6 diploid 6.1 0 63 2 17.21 2 5 tetraploid 5.2 0 54 2 11.35 2 6 diploid 6.2 0 65 2 11.35 2 5 diploid 11.4 0 59 2 7.61 2 5 diploid 7 1 61 2 20.82 3 6 tetraploid 6.5 0 65 1 12.93 3 7 diploid 0.5 1 57 1 21.75 3 7 tetraploid 6.1 0 69 2 8.58 2 6 diploid 5.1 1 53 1 14.94 3 7 tetraploid 3.7 1 48 2 17.16 3 7 tetraploid 12.2 0 57 2 23.62 3 8 tetraploid 7.7 1 63 2 16.06 3 9 tetraploid 7 0 52 2 7.15 2 7 diploid 7.2 1 57 2 13.21 3 8 tetraploid 4.4 1 62 2 11.35 3 6 diploid 6.7 0 54 2 8.11 2 4 diploid 6.8 1 67 2 11.18 3 7 diploid 5.2 1 65 2 24.84 3 7 tetraploid 8.7 0 67 2 7.67 3 6 diploid 10.8 0 72 1 6.68 2 . diploid 2.6 1 66 2 15.23 3 8 tetraploid 10.9 0 72 2 6.8 2 5 diploid 5.6 1 60 2 14.58 3 7 tetraploid 10.1 0 70 2 13.17 2 6 tetraploid 7.2 0 63 1 9.76 2 5 diploid 10.2 0 64 1 7.61 2 . diploid 7.7 1 62 2 38.05 3 7 tetraploid 2.7 1 61 1 13.87 3 6 tetraploid 1.9 1 64 2 21.2 3 7 tetraploid 3.6 0 64 1 17.96 3 7 tetraploid 8.2 0 68 2 27.14 3 9 tetraploid 9.2 0 62 1 6.74 2 5 diploid 6.1 0 69 2 11.21 3 8 diploid 8.7 0 59 2 20.22 3 6 tetraploid 7.4 1 66 1 15.35 3 8 tetraploid 1.6 1 53 1 16.79 3 9 tetraploid 8.4 0 59 2 8.76 2 6 diploid 4.7 1 58 2 13.23 2 6 tetraploid 5.7 0 61 2 34.01 2 7 tetraploid 3.2 1 65 . 14.68 3 8 tetraploid 4.9 0 67 1 17.95 3 8 tetraploid 3.4 1 57 1 23.34 3 8 tetraploid 1 1 55 2 10.25 3 7 aneuploid 5.4 1 57 2 . 3 8 aneuploid 4.7 0 57 1 15.1 3 7 tetraploid 6.3 0 68 1 26.55 2 6 tetraploid 7 0 67 2 7.78 2 6 diploid 1.5 1 60 1 . 4 9 aneuploid 7.1 0 63 2 21.2 3 7 tetraploid 6 0 69 2 7.93 3 6 diploid 3.8 0 54 2 10.58 3 8 diploid 6.5 0 66 2 5.92 2 5 diploid 3.1 0 59 2 5.08 3 7 diploid 6.8 0 62 2 13.1 3 8 tetraploid 6.7 0 73 1 41.31 3 8 tetraploid 5.7 1 65 2 11.29 3 7 diploid 1.5 1 67 2 14.02 3 7 tetraploid 5.2 0 75 2 12.46 3 7 diploid 1.3 1 70 2 13.69 3 8 tetraploid 6.2 0 59 2 12.06 2 5 diploid 6.5 0 73 2 13.01 3 6 diploid 1.2 1 66 2 13.21 2 6 tetraploid 5.7 0 66 2 10.43 3 5 diploid 3.4 1 65 2 . 3 7 aneuploid 5.6 0 66 1 13.33 2 5 tetraploid 6 0 66 2 37.49 3 7 tetraploid 5.1 0 59 2 11.69 3 7 diploid 6 0 52 2 9.9 2 4 diploid 5.4 0 68 2 13.01 2 5 diploid 2.4 0 63 2 4.81 3 8 diploid 4.2 0 67 2 14.71 2 5 tetraploid 5.5 0 59 1 9.01 2 5 diploid 5.4 0 57 1 10.9 3 6 diploid 8.2 0 62 2 10.72 3 7 diploid 10.2 0 63 2 5.14 2 5 diploid 2.5 1 73 2 46.92 4 9 tetraploid 7.9 0 68 2 . 2 5 aneuploid 5.6 0 51 2 9.59 3 6 diploid 2.1 1 56 2 9.01 3 7 diploid ; PROC PRINT data=stagec; *-----------------------------------------------; options yearcutoff=1900; data Heart; input ID @5 Bir_Date mmddyy8. @14 Acc_Date mmddyy8. @23 Xpl_Date mmddyy8. @32 Ter_Date mmddyy8. @41 Status 1. @43 PrevSurg 1. @45 NMismatch 1. @47 Antigen 1. @49 Mismatch 4. @54 Reject 1. @56 NotTyped $1.; label Bir_Date ='Date of birth' Acc_Date ='Date of acceptance' Xpl_Date ='Date of transplant' Ter_Date ='Date last seen' Status = 'Dead=1 Alive=0' PrevSurg ='Previous surgery' NMismatch= 'No of mismatches' Antigen = 'HLA-A2 antigen' Mismatch ='Mismatch score' NotTyped = 'y=not tissue-typed'; Time= Ter_Date - Acc_Date; Acc_Age=int( (Acc_Date - Bir_Date)/365 ); if ( Xpl_Date ne .) then do; WaitTime= Xpl_Date - Acc_Date; Xpl_Age= int( (Xpl_Date - Bir_Date)/365 ); end; datalines; 1 01 10 37 11 15 67 01 03 68 1 0 2 03 02 16 01 02 68 01 07 68 1 0 3 09 19 13 01 06 68 01 06 68 01 21 68 1 0 2 0 1.11 0 4 12 23 27 03 28 68 05 02 68 05 05 68 1 0 3 0 1.66 0 5 07 28 47 05 10 68 05 27 68 1 0 6 11 08 13 06 13 68 06 15 68 1 0 7 08 29 17 07 12 68 08 31 68 05 17 70 1 0 4 0 1.32 1 8 03 27 23 08 01 68 09 09 68 1 0 9 06 11 21 08 09 68 11 01 68 1 0 10 02 09 26 08 11 68 08 22 68 10 07 68 1 0 2 0 0.61 1 11 08 22 20 08 15 68 09 09 68 01 14 69 1 0 1 0 0.36 0 12 07 09 15 09 17 68 09 24 68 1 0 13 02 22 14 09 19 68 10 05 68 12 08 68 1 0 3 0 1.89 1 14 09 16 14 09 20 68 10 26 68 07 07 72 1 0 1 0 0.87 1 15 12 04 14 09 27 68 09 27 68 1 1 16 05 16 19 10 26 68 11 22 68 08 29 69 1 0 2 0 1.12 1 17 06 29 48 10 28 68 12 02 68 1 0 18 12 27 11 11 01 68 11 20 68 12 13 68 1 0 3 0 2.05 0 19 10 04 09 11 18 68 12 24 68 1 0 20 10 19 13 01 29 69 02 15 69 02 25 69 1 0 3 1 2.76 1 21 09 29 25 02 01 69 02 08 69 11 29 71 1 0 2 0 1.13 1 22 06 05 26 03 18 69 03 29 69 05 07 69 1 0 3 0 1.38 1 23 12 02 10 04 11 69 04 13 69 04 13 71 1 0 3 0 0.96 1 24 07 07 17 04 25 69 07 16 69 11 29 69 1 0 3 1 1.62 1 25 02 06 36 04 28 69 05 22 69 04 01 74 0 0 2 0 1.06 0 26 10 18 38 05 01 69 03 01 73 0 0 27 07 21 60 05 04 69 01 21 70 1 0 28 05 30 15 06 07 69 08 16 69 08 17 69 1 0 2 0 0.47 0 29 02 06 19 07 14 69 08 17 69 1 0 30 09 20 24 08 19 69 09 03 69 12 18 71 1 0 4 0 1.58 1 31 10 04 14 08 23 69 09 07 69 1 0 32 04 02 05 08 29 69 09 14 69 11 13 69 1 0 4 0 0.69 1 33 01 01 21 11 27 69 01 16 70 04 01 74 0 0 3 0 0.91 0 34 05 24 29 12 12 69 01 03 70 04 01 74 0 0 2 0 0.38 0 35 08 04 26 01 21 70 02 01 70 1 0 36 05 01 21 04 04 70 05 19 70 07 12 70 1 0 2 0 2.09 1 37 10 24 08 04 25 70 05 13 70 06 29 70 1 0 3 1 0.87 1 38 11 14 28 05 05 70 05 09 70 05 09 70 1 0 3 0 0.87 0 39 11 12 19 05 20 70 05 21 70 07 11 70 1 0 y 40 11 30 21 05 25 70 07 04 70 04 01 74 0 1 4 0 0.75 0 41 04 30 25 08 19 70 10 15 70 04 01 74 0 1 2 0 0.98 0 42 03 13 34 08 21 70 08 23 70 1 0 43 06 01 27 10 22 70 10 23 70 1 1 44 05 02 28 11 30 70 01 08 71 1 1 45 10 30 34 01 05 71 01 05 71 02 18 71 1 0 1 0 0.0 0 46 06 01 22 01 10 71 01 11 71 10 01 73 1 1 2 0 0.81 1 47 12 28 23 02 02 71 02 22 71 04 14 71 1 0 3 0 1.38 1 48 01 23 15 02 05 71 02 13 71 1 0 49 06 21 34 02 15 71 03 22 71 04 01 74 0 1 4 0 1.35 0 50 03 28 25 02 15 71 05 08 71 10 21 73 1 1 y 51 06 29 22 03 24 71 04 24 71 01 02 72 1 0 4 1 1.08 1 52 01 24 30 04 25 71 08 04 71 1 0 53 02 27 24 07 02 71 08 11 71 01 05 72 1 0 y 54 09 16 23 07 02 71 07 04 71 1 0 55 02 24 19 08 09 71 08 18 71 10 08 71 1 0 2 0 1.51 1 56 12 05 32 09 03 71 11 08 71 04 01 74 0 0 4 0 0.98 0 57 06 08 30 09 13 71 02 08 72 1 0 58 09 17 23 09 23 71 10 13 71 08 30 72 1 1 2 1 1.82 1 59 05 12 30 09 29 71 12 15 71 04 01 74 0 1 2 0 0.19 0 60 10 29 22 11 18 71 11 20 71 01 24 72 1 0 3 0 0.66 1 61 05 12 19 12 04 71 12 05 71 1 0 62 08 01 32 12 09 71 02 15 72 1 0 63 04 15 39 12 12 71 01 07 72 04 01 74 0 0 3 1 1.93 0 64 04 09 23 02 01 72 03 04 72 09 06 73 1 1 1 0 0.12 0 65 11 19 20 03 06 72 03 17 72 05 22 72 1 0 2 0 1.12 1 66 01 02 19 03 20 72 04 20 72 1 0 67 09 03 52 03 23 72 05 18 72 01 01 73 1 0 3 0 1.02 0 68 01 10 27 04 07 72 04 09 72 06 13 72 1 0 3 1 1.68 1 69 06 05 24 06 01 72 06 10 72 04 01 74 0 0 2 0 1.20 0 70 06 17 19 06 17 72 06 21 72 07 16 72 1 0 3 1 1.68 1 71 02 22 25 07 21 72 08 20 72 04 01 74 0 0 3 0 0.97 0 72 11 22 45 08 14 72 08 17 72 04 01 74 0 0 3 1 1.46 0 73 05 13 16 09 11 72 10 07 72 12 09 72 1 0 3 1 2.16 1 74 07 20 43 09 18 72 09 22 72 10 04 72 1 0 1 0 0.61 0 75 07 25 20 09 29 72 09 30 72 1 0 76 09 03 20 10 04 72 11 18 72 04 01 74 0 1 3 1 1.70 0 77 08 27 31 10 06 72 10 26 72 1 0 78 02 20 24 11 03 72 05 31 73 04 01 74 0 0 3 0 0.81 0 79 02 18 19 11 30 72 02 04 73 03 05 73 1 0 2 0 1.08 1 80 06 27 26 12 06 72 12 31 72 04 01 74 0 1 3 0 1.41 0 81 02 21 20 01 12 73 01 17 73 04 01 74 0 0 4 1 1.94 0 82 08 19 42 11 01 71 01 01 73 0 0 83 10 04 19 01 24 73 02 24 73 04 13 73 1 0 4 0 3.05 0 84 05 13 30 01 30 73 03 07 73 12 29 73 1 0 4 0 0.60 1 85 02 13 25 02 06 73 02 10 73 1 0 86 03 30 24 03 01 73 03 08 73 04 01 74 0 0 3 1 1.44 0 87 12 19 26 03 21 73 05 19 73 07 08 73 1 0 2 0 2.25 1 88 11 16 18 03 28 73 04 27 73 04 01 74 0 0 3 0 0.68 0 89 03 19 22 04 05 73 08 21 73 10 28 73 1 0 4 1 1.33 1 90 03 25 21 04 06 73 09 12 73 10 08 73 1 1 3 1 0.82 0 91 09 08 25 04 13 73 03 18 74 1 0 92 05 03 28 04 27 73 03 02 74 04 01 74 0 0 1 0 0.16 0 93 10 10 25 07 11 73 08 07 73 04 01 74 0 0 2 0 0.33 0 94 11 11 29 09 14 73 09 17 73 02 25 74 1 1 3 0 1.20 1 95 06 11 33 09 22 73 09 23 73 10 07 73 1 0 y 96 02 09 47 10 04 73 10 16 73 04 01 74 0 0 2 0 0.46 0 97 04 11 50 11 22 73 12 12 73 04 01 74 0 0 3 1 1.78 0 98 04 28 45 12 14 73 03 19 74 04 01 74 0 0 4 1 0.77 0 99 02 24 24 12 25 73 01 14 74 1 0 100 01 31 39 02 22 74 03 31 74 04 01 74 0 1 3 0 0.67 0 101 08 25 24 03 02 74 04 01 74 0 0 102 10 30 33 03 22 74 04 01 74 0 0 103 05 20 28 09 13 67 09 18 67 1 0 ; PROC PRINT data=Heart; *-----------------------------------------------; PROC FORMAT; value DiseaseGroup 1='ALL' 2='AML-Low Risk' 3='AML-High Risk'; DATA bmt; input Group T Status WaitTime @@; logWaittime=log(WaitTime); format Group DiseaseGroup.; datalines; 1 2081 0 98 1 1602 0 1720 1 1496 0 127 1 1462 0 168 1 1433 0 93 1 1377 0 2187 1 1330 0 1006 1 996 0 1319 1 226 0 208 1 1199 0 174 1 1111 0 236 1 530 0 151 1 1182 0 203 1 1167 0 191 1 418 2 110 1 383 1 824 1 276 2 146 1 104 1 85 1 609 1 187 1 172 2 129 1 487 2 128 1 662 1 84 1 194 2 329 1 230 1 147 1 526 2 943 1 122 2 2616 1 129 1 937 1 74 1 303 1 122 1 170 1 86 2 239 1 466 2 508 1 192 1 74 1 109 1 393 1 55 1 331 1 1 2 196 1 107 2 178 1 110 1 361 1 332 2 834 2 2569 0 270 2 2506 0 60 2 2409 0 120 2 2218 0 60 2 1857 0 90 2 1829 0 210 2 1562 0 90 2 1470 0 240 2 1363 0 90 2 1030 0 210 2 860 0 180 2 1258 0 180 2 2246 0 105 2 1870 0 225 2 1799 0 120 2 1709 0 90 2 1674 0 60 2 1568 0 90 2 1527 0 450 2 1324 0 75 2 957 0 90 2 932 0 60 2 847 0 75 2 848 0 180 2 1850 0 180 2 1843 0 270 2 1535 0 180 2 1447 0 150 2 1384 0 120 2 414 2 120 2 2204 2 60 2 1063 2 270 2 481 2 90 2 105 2 120 2 641 2 90 2 390 2 120 2 288 2 90 2 421 1 90 2 79 2 90 2 748 1 60 2 486 1 120 2 48 2 150 2 272 1 120 2 1074 2 150 2 381 1 120 2 10 2 240 2 53 2 180 2 80 2 150 2 35 2 150 2 248 1 30 2 704 2 105 2 211 1 90 2 219 1 120 2 606 1 210 3 2640 0 750 3 2430 0 24 3 2252 0 120 3 2140 0 210 3 2133 0 240 3 1238 0 240 3 1631 0 690 3 2024 0 105 3 1345 0 120 3 1136 0 900 3 845 0 210 3 422 1 210 3 162 2 300 3 84 1 105 3 100 1 210 3 2 2 75 3 47 1 90 3 242 1 180 3 456 1 630 3 268 1 180 3 318 2 300 3 32 1 90 3 467 1 120 3 47 1 135 3 390 1 210 3 183 2 120 3 105 2 150 3 115 1 270 3 164 2 285 3 93 1 240 3 120 1 510 3 80 2 780 3 677 2 150 3 64 1 180 3 168 2 150 3 74 2 750 3 16 2 180 3 157 1 180 3 625 1 150 3 48 1 210 3 273 1 240 3 63 2 360 3 76 1 330 3 113 1 240 3 363 2 180 ; PROC PRINT data=BMT; *---------------------------------------------------------------------------------------------------------------------; *Example 1.1: Cox Regression, ploidy only; PROC UNIVARIATE data =stagec; where pgstat=1; var pgtime; histogram pgtime / kernel; PROC LIFETEST data=stagec plots=survival(atrisk cb); time pgtime*pgstat(0); PROC LIFETEST data=stagec plots=survival(atrisk cb); time pgtime*pgstat(0); strata ploidy; PROC PHREG data=stagec; class ploidy(ref="diploid"); model pgtime*pgstat(0) = ploidy; *---------------------------------------------------------------------------------------------------------------------; *Example 1.2: Cox Regression, other covariates; PROC PHREG data=stagec; class eet ploidy(ref="diploid"); model pgtime*pgstat(0)=eet grade gleason ploidy age g2; PROC PHREG data=stagec; class eet grade gleason ploidy(ref="diploid"); model pgtime*pgstat(0)=eet grade gleason ploidy age g2; PROC PHREG data=stagec; class grade ploidy(ref="diploid"); model pgtime*pgstat(0)=grade ploidy g2; *---------------------------------------------------------------------------------------------------------------------; *Example 1.3: Parametric Models: https://support.sas.com/resources/papers/proceedings10/252-2010.pdf; PROC LIFEREG data=stagec; class ploidy; model pgtime*pgstat(0)=ploidy/dist=lnormal; *AICc=403.379; PROC LIFEREG data=stagec; class ploidy; model pgtime*pgstat(0)=ploidy/dist=logistic; *AICc=461.343; PROC LIFEREG data=stagec; class ploidy; model pgtime*pgstat(0)=ploidy/dist=llogistic; *AICc=404.043; PROC LIFEREG data=stagec; class ploidy; model pgtime*pgstat(0)=ploidy/dist=gamma; *AICc=405.514; PROC LIFEREG data=stagec; class ploidy; model pgtime*pgstat(0)=ploidy/dist=exponential; *AICc=406.302; PROC LIFEREG data=stagec; class ploidy; model pgtime*pgstat(0)=ploidy/dist=weibull; *AICc=295.114 -> best fit; PROC LIFEREG data=stagec; class ploidy grade; model pgtime*pgstat(0)=ploidy grade g2/dist=weibull; PROC PHREG data=stagec; class ploidy grade; model pgtime*pgstat(0)=ploidy grade g2; *---------------------------------------------------------------------------------------------------------------------; *Example 2: Bayesian Analysis; DATA stagec; set stagec; if ploidy='diploid' then do; psort=3; end; else if ploidy='tetraploid' then do; psort=2; end; else do; psort=1; end; PROC SORT data=stagec; by psort; PROC LIFEREG data=stagec order=data; class ploidy; model pgtime*pgstat(0)=ploidy/dist=weibull; PROC LIFEREG data=stagec order=data; class ploidy; model pgtime*pgstat(0)=ploidy/dist=weibull; bayes seed=100 outpost=post nbi=2000 nmc=10000 thin=2 coeffprior=normal(var=1E6) scaleprior=gamma(shape=1E-4, iscale=1E-4); *---------------------------------------------------------------------------------------------------------------------; *Example 3: Time-dependent Variables; *(https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_phreg_sect049.htm); *Single time-dependent variable; PROC PHREG data=Heart; model Time*Status(0)=XStatus Acc_Age; if (WaitTime=. or Time < WaitTime) then XStatus=0.; else XStatus=1.0; *Multiple time-dependent variables; PROC PHREG data= Heart; model Time*Status(0)= XStatus XAge XScore; where NotTyped ^= 'y'; if (WaitTime = . or Time < WaitTime) then do; XStatus=0.; XAge=0.; XScore= 0.; end; else do; XStatus= 1.0; XAge= Xpl_Age; XScore= Mismatch; end; *Example 4: Competing Risks; *(https://support.sas.com/rnd/app/stat/papers/2014/competingrisk2014.pdf); *Cause-specific Hazard (competing events are treated as censored events); *Status: 0=Censored, 1=Relapse, 2=Die (w/o relapse); PROC PHREG data=bmt; *for hazard of relapse; class Group / order=internal ref=first param=glm; model T*Status(0,2) = Group logWaitTime; hazardratio 'Cause-Specific Hazards' Group / diff=pairwise; DATA risk; logWaitTime=5.2; Group=1; output; Group=2; output; Group=3; output; format Group DiseaseGroup.; PROC PHREG data=bmt plots(overlay=stratum)=cif; class Group / order=internal ref=first param=glm; model T*Status(0) = Group logWaitTime / eventcode=1; *eventcode=1 to designate relapse (status=1) as event of interest; hazardratio 'Subdistribution Hazards' Group / diff=pairwise; baseline covariates=risk out=_null_ /rowid=Group; *culm incidence at logTimeWait=5.2;