data equiv_survival;
alpha=0.05;                             /*指定一类错误α值*/
beta=0.2;                               /*指定二类错误β值*/
lt=0.87;                                /*指定试验组风险率*/
lc=0.77;                                /*指定对照组风险率*/
delta=-0.2;                              /*指定非劣效界值δ*/
accrualtime=1;                          /*指定招募时间*/
followuptime=2;                         /*指定随访时间*/
k=1;                                  /*指定试验组与对照组例数之比*/
totaltime=accrualtime+followuptime;
st=lt**2/(1+(exp(-lt*totaltime)-exp(-lt*followuptime))/(lt*accrualtime));
sc=lc**2/(1+(exp(-lc*totaltime)-exp(-lc*followuptime))/(lc*accrualtime));
nc=ceil((probit(1-alpha)+probit(1-beta))**2*(st/k+sc)/(lc-lt-delta)**2);
nt=k*nc;
label nt="试验组例数";
label nc="对照组例数";
label lt="试验组风险率";
label lc="对照组风险率";
label st="试验组风险率方差";
label sc="对照组风险率方差";
proc print label noobs;
var lt lc st sc nc nt; 
run;

