/* Code for estimating power of weighted linear rank tests. Posted as spower1.sas */ %include "c:\mydocuments\courses\st565\sas\survpow.macro.sas"; data group1; input t s; datalines; 0 1.00 1 0.88 2 0.70 3 0.60 4 0.48 5 0.39 6 0.30 7 0.24 run; data group2; input t s; datalines; 0 1.00 1 0.95 2 0.89 3 0.77 4 0.65 5 0.53 6 0.40 7 0.30 run; /* Estimate power for the log-rank test for a single recruitment rate */ %survpow(s1=group1, s2=group2, actime=3, futime=4, rate=60, p=.5, loss1=0.10, loss2=0.20, w=1, siglevel=.05); /* Cycle through a set accrual rates and several test statistics */ data data; input w $; datalines; (n**.5) n 1 run; /* Create macro variables from weight functions */ data _null_; set data; i=_n_; call symput('w'||left(i), w); run; /* Create macro to loop across accrual rates and weight functions */ %macro loop; %do arate=60 %to 100 %by 5; %do jj=1 %to 3; %survpow(s1=group1, s2=group2, actime=3, futime=4, rate=&arate, p=0.5, loss1=.10, loss2=.20, w=&&w&jj, siglevel=0.05 ); %end; %end; %mend; %loop; run;