1 The SAS System 22:20 Wednesday, February 14, 1996 NOTE: Copyright (c) 1989-1992 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software Release 6.09 TS042 Licensed to UNIVERSITY OF NORTH CAROLINA, Site 0005540009. This message is contained in the SAS news file, and is presented upon initialization. Edit the files "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: AUTOEXEC processing beginning; file is /home/users/qaqish/autoexec.sas. NOTE: SAS initialization used: real time 0.48 seconds cpu time 0.26 seconds NOTE: AUTOEXEC processing completed. 1 * TIES.SAS 2 * xref: 3 * input: 4 * output: 5 * does: - Simulate grouped survival data 6 - Evaluate methods of tie handling 7 - exponential distribution 8 - no censoring 9 ***************************************************; 10 %let n=20; * sample size; 11 %let nsim=1000; * # simulations; 12 %let width=0.1; * width of rounding interval; 13 %let beta=0.69; * slope for z; 14 ***************************************************; 15 data A (keep=sim t delta z); 16 retain 17 h &width 18 n &n 19 beta &beta 20 nsim &nsim 21 beta &beta 22 delta 1 23 seed 21496 24 ; 25 26 array zz (*) zz1 - zz&n; 27 28 x = -1; d = 2/(n-1); * equally spaced on [-1,1]; 29 do i=1 to n; zz(i)=x; x+d; end; 30 31 do sim = 1 to nsim; 32 do i = 1 to n; 33 z = zz(i); 34 psi = exp(z * beta); 35 t = -log(ranuni(seed)) / psi; 36 t = round(t, h); 37 output; 38 end; 39 end; 40 2 The SAS System 22:20 Wednesday, February 14, 1996 41 run; NOTE: The data set WORK.A has 20000 observations and 4 variables. NOTE: DATA statement used: real time 1.82 seconds cpu time 0.70 seconds 42 ***************************************************; 43 proc freq data=A; 44 table t; * ties?; 45 run; NOTE: The PROCEDURE FREQ printed pages 1-2. NOTE: PROCEDURE FREQ used: real time 0.58 seconds cpu time 0.24 seconds 46 ***************************************************; 47 proc phreg data=A outest=EX noprint; NOTE: PROCEDURE PHREG used: real time 28.41 seconds cpu time 27.30 seconds NOTE: The data set WORK.EX has 1000 observations and 6 variables. 48 model t * delta(0) = z / ties = Exact; 49 by sim; 50 run; 51 ***************************************************; 52 proc phreg data=A outest=EF noprint; NOTE: PROCEDURE PHREG used: real time 7.09 seconds cpu time 6.44 seconds NOTE: The data set WORK.EF has 1000 observations and 6 variables. 53 model t * delta(0) = z / ties = Efron; 54 by sim; 55 run; 56 ***************************************************; 57 proc phreg data=A outest=BR noprint; NOTE: PROCEDURE PHREG used: real time 5.74 seconds cpu time 5.15 seconds NOTE: The data set WORK.BR has 1000 observations and 6 variables. 58 model t * delta(0) = z / ties = breslow; 59 by sim; 60 run; 61 ***************************************************; 62 proc phreg data=A outest=DI noprint; NOTE: PROCEDURE PHREG used: real time 8.05 seconds cpu time 7.44 seconds NOTE: The data set WORK.DI has 1000 observations and 6 variables. 63 model t * delta(0) = z / ties = discrete; 64 by sim; 65 run; 3 The SAS System 22:20 Wednesday, February 14, 1996 66 ***************************************************; 67 68 data B (keep = ex ef br di ef_e br_e di_e); 69 merge 70 EX (rename=(z=ex)) 71 EF (rename=(z=ef)) 72 BR (rename=(z=br)) 73 DI (rename=(z=di)) 74 ; 75 if (_type_ = "PARMS"); 76 ef_e = ef-ex; 77 br_e = br-ex; 78 di_e = di-ex; 79 label 80 ex = "Exact" 81 ef = "Efron approximation" 82 br = "Breslow approximation" 83 di = "Discrete approximation" 84 ef_e = "Efron approximation error" 85 br_e = "Breslow approximation error" 86 di_e = "Discrete approximation error" 87 ; 88 89 run; NOTE: The data set WORK.B has 1000 observations and 7 variables. NOTE: DATA statement used: real time 0.37 seconds cpu time 0.13 seconds 90 91 ***************************************************; 92 93 proc univariate data=B; 94 var ex ef_e br_e di_e; 95 run; NOTE: The PROCEDURE UNIVARIATE printed pages 3-6. NOTE: PROCEDURE UNIVARIATE used: real time 0.15 seconds cpu time 0.12 seconds NOTE: The SAS System used: real time 53.41 seconds cpu time 47.88 seconds NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414