- data outSurv2;
- array _perc[9] _temporary_ (5 10 15 20 25 30 40 50 75);
- array _atRisk[8] _temporary_ (0 12 24 36 48 60 72 84);
- set outSurv11 end =Eof;
- Failure=1 -survival;
- do p =1 to nobs;
- set outSurv1 (keep =Time_m survival rename =(Time_m =_00Time_m survival =_00Survival)) point =p nobs =nobs;
- if SDF_UCL >_00Survival then time_LCL =min(time_LCL, _00Time_m);
- if SDF_LCL >_00Survival then time_UCL =min(time_UCL, _00Time_m);
- end;
- retain time_CL;
- if cmiss(time_LCL, time_UCL) ^=2 then time_CL =cats(put(time_m, 5.0))||' ('||catx(' - ', put(time_LCL, 5.0), put(time_UCL, 5.0))||')';
- lag1Failure =lag1(Failure); lag1time_CL =lag1(time_CL);
- do i =1 to 9;
- if Failure>_perc/100 and lag1Failure <=_perc/100 then do;
- perc =_perc; percY =perc /100;
- time_CLchar =lag1time_CL;
- i =9+1;
- end;
- end;
- lag1Time_m =lag1(Time_m);
- retain NumberAtRisk0;
- if not missing(NumberAtRisk) then NumberAtRisk0 =NumberAtRisk;
- do i =1 to 8;
- if Time_m >=_atRisk/1.00 and lag1Time_m <_atRisk/1.00 then do;
- atriskX =_atRisk;
- atriskChar =cats(NumberAtRisk0);
- i =9+1;
- end;
- end;
- percX =3;
- atriskY =-0.05;
- if _censor_ then censorChar ='+'; *mark the censored;
- if Eof then do;
- atriskX =84;
- atriskChar ='#at risk';
- end;
- keep time_m Failure censorChar atriskX atriskY atriskChar percX percY time_CLChar;
- run;
- proc sgplot data = outSurv2 noautolegend;
- step x =time_m y =Failure;
- scatter x =time_m y =Failure/markerchar =censorChar;
- scatter x =atriskX y =atriskY/markerchar =atriskChar markercharattrs =(family ='Times' size =09pt style =normal weight =bold);
- scatter x =percX y =percY/markerchar =time_CLchar markercharattrs =(family ='Times' size =09pt style =normal weight =bold);
- inset " " " "
- "Failure months (95% CL)"/ noborder position =topleft textattrs =(family ='Times' size =10pt style =normal weight =bold);
- xaxis grid label ='Follow-up in Months' values =(0 to 84 by 12) offsetmin =0.060 offsetmax =0.045;
- yaxis label ='Estimated probability of infection' grid values =(0 0.05 0.10 0.15 0.20 0.25 0.30 0.40 0.50 0.75 1.00) offsetmin =0.075;
- format Failure percentn6.0;
- run;


雷达卡
京公网安备 11010802022788号







