- Thread starter rajvaidya
- Start date
- Tags interval survival times lifereg weibull

1) Do you know the sample size? SAS has 3 types of model statements, but you can only use one of them in a proc call. If you do not know sample size, then I don't think you can use lifereg.

2) In the data you provided, cumulative failure % only goes up to 27. Does that mean the other 73% is censored, with survival > 180 minutes?

I wrote up some code, and I'll post it now because I don't want to save it. But it assumes you know the sample size:

%let SAMPLESIZE=500; *put your sample size here;

data talkstats;

input interval $ cumpct;

datalines;

0-30 4

30-60 10

60-90 15

90-120 18

120-150 22

150-180 27

;

run;

data talkstats2(drop=interval);

set talkstats end=last;

time_begin=input(substr(interval,1,index(interval,"-")-1),8.);

time_end=input(substr(interval,index(interval,"-")+1),8.);

if (last) then do;

output;

*un-comment the code below, if your data past 180 minutes are indeed censored;

/* time_begin=.; cumpct=100; output;*/

end;

else output;

run;

data talkstats3(drop=beginpct intervalpct temp);

retain beginpct;

set talkstats2;

if _N_=1 then beginpct=0;

intervalpct=cumpct-beginpct;

temp=intervalpct * &SAMPLESIZE/100;

do while (temp>0);

output;

temp=temp-1;

end;

beginpct=cumpct;

run;

proc lifereg data=talkstats3;

model (time_begin, time_end) = ;

run;

*SAS also has a model statement where you can do: model r/n = ;

but since you have interval-type survival times then you cannot use that type of model, I believe;

Thanks for your reply. Answers to your questions are:

Nope I do not know the total sample size. Only 27% has failed till the time I have mentioned. Since I do not know the sample size I am forced to assume that the rest of the sample survive greater than the max time given in my data. They would then be right censored.