Thank you. This work is about survival analysis. The boldedpart(see Code) below is the K-M estimator graph created by PROC lifetest. I am fitting a parametric Weibull survival function (S_y(t)=exp{-(lamda*t)^gamma})onthe data. Now having the estimated gamma and lamda. To plot the Weibull survival function, I will create thefunction and call the function for different time t, then plot using IML thevector. My question: How to combine the plot with the graph createdby PROC lifetest? Any suggestion? Code------------------------------------------------ Data radiotherapy; input x age gender $ censor_ind; datalines; 7 68 f 1 9 69 f 1 12 68 f 1 12 71 f 1 19 77 m 1 23 70 f 1 24 67 f 1 24 68 m 1 24 88 m 1 24 89 m 1 29 28 m 0 34 73 m 1 41 60 f 1 54 60 f 1 72 44 m 0 78 82 f 1 80 62 f 0 83 53 f 0 92 66 f 0 139 63 f 0 139 68 m 0 ; RUN; PROC PRINT data=radiotherapy; RUN; ODS GRAPHICS ON; PROC LIFETEST DATA= radiotherapy PLOTS=s(ATRISK ); TIME x*censor_ind(0); RUN; ODS GRAPHICS OFF; PROC LIFETEST DATA= radiotherapy OUTSURV=a; TIME x*censor_ind(0); RUN; PROC PRINT data=a; RUN; PROC IML; RESET LOG PRINT; USE radiotherapy VAR _ALL_; READ all VAR{x} INTO X; READ all VAR{age} INTO AGE; READ all VAR{gender} INTO GENDER; READ all VAR{censor_ind} INTO CENSOR_IND; CLOSE radiotherapy; start LogLik(param) global (X,CENSOR_IND); lamda = param[1]; gamma = param[2]; n = nrow(X); a =CENSOR_IND# ( log(lamda)*gamma+log(gamma)+(gamma-1)*log(X) ) ; b=-(lamda*X)##gamma ; f=SUM(a+b); return ( f ); finish; p={0.2 0.3}; con={1e-4 1e-4, 4 4}; opt ={1,4}; call nlpnra(rc, xres, "LogLik", p, opt, con); print xres;
... View more