Proc phreg does not calculate the expected lifetime directly. But PHREG can calculate the survival function, which then can be used to calculate the expected lifetime. It is such that the integrated survival function gives the expected lifetime. One should be carefull in practice, since the survival function can be difficult to estimate in the tail.
Here is an example, where the datastep after PHREG do the integration:
data mydata;
do i=1 to 10000;
predictor=mod(i,2);
time=rand('gamma',5*exp(log(2)*predictor));
censurtime=rand('gamma',10);
event=(time<=censurtime);
time=min(time,censurtime);
output;
end;
keep time predictor event;
run;
data covariates;
do predictor=0 to 1;
output;
end;
run;
proc phreg data=mydata;
class predictor /param=glm;
model time*event(0)=predictor;
baseline out=kaplanmeier survival=survival covariates=covariates/method=pl;
run;
data meansurvival;
set kaplanmeier;
by predictor;
retain lasttime;
if first.predictor then integral=0;
else do;
integral+survival*(time-lasttime);
end;
lasttime=time;
if last.predictor;
put integral;
keep integral predictor;
run;
Unfortunately, it is not possible to estimate confidence limits of the expected survival in this way. If you want this, you should better use a failuretime model (proc lifereg).
... View more