THis is how my code looks like;, is this format correct, why is it that I cant get the data impute_t_&p ods html close; %macro surv(replicates=); %do p=1 %to &replicates; data tes_&p; seed=-1; alpha1 = 2.50; beta1 = 2.00; beta2=4; do i = 1 to 500; X=ranbin(0,1,.5); lambdaT = 0.025; *baseline hazard; lambdaC= .03; *heavy=0.15; *light=0.03; er=0+(0.05)*rannor(1); t = rand("WEIBULL", 0.75, lambdaT); * time of event; c1 = rand("WEIBULL", 1.25, lambdaC) ;* time of censoring; c2= rand("WEIBULL", 1.50, lambdaC) ; if er le 0.240482 then c=c1; else c=c1; time = min(t, c); * which came first?; censored = (c lt t); obs=(t lt c); * creating observation vaiable from censored when observeed obs=1; obs = (t lt c); y= alpha1 + beta1*t + er; if t le 0.015072 then R=0; else if t gt 0.015072 then R=1; y1= alpha1 +beta1*R + er; output; end; run; %do i=1 %to 7; proc surveyselect data=tes_&i method = urs sampsize = 10 OUTHITS reps=1 seed=123410 out=test_&i; run; proc means data = test_&i sum; where obs = 0; var censored; ods output summary = summary_&i; run; %end; data impute_t_&p; set summary_1 -summary_&i;; run; %end; %mend surv; %surv(replicates=10);
... View more