/* Weibull and Exponential */ %Let Lambda = 1000 ; %Let Shape = 1 ; /* value of 1 for exponential */ %Let Time_Censor = 99999999999999; %Let Beta0 = 1; %Let Beta1 = 1.2; %Let Sn=10; Data Sim1A ( Drop = Linear_Predict Time_Censor Beta1 Lambda Shape Beta0); Lambda = &Lambda. ; Shape = &Shape.; n= 10; Time_Censor = &Time_Censor.; Do Sim = 1 To &Sn. ; Do n = 1 To n ; ID + 1 ; x1=rand('BERN',.5); Beta0=&Beta0.; Beta1=&Beta1.; Linear_Predict = Exp(-(beta0* + (Beta1 * x1))) ; Time = Rand( "WEIBULL", Shape ,Lambda* Linear_Predict) ; If Time_Censor < Time Then Do ; Censored = 1 ; Time = Time_Censor ; End ; Else Censored = 0 ; Output ; End ; End ; Run ;
... View more