OUTPUT Survival estimate from proc lifereg

Reply
Super Contributor
Posts: 303

OUTPUT Survival estimate from proc lifereg

How do I output survival estimate S(.) from the following proc lifereg?

proc lifereg data=test;

class n;

      model (m1, m2) = x1/D=Weibull;

   run;

Just as in the statement below:

ods trace on /listing;

proc lifetest data=test;

time time*censored(1);

ods output ProductLimitEstimates= simulate;

run;

In the proc lifetest, I can easily output survival estimate using "ods output ProductLimitEstimates= simulate " . How do I do this in above proc lifereg?

    pro


c

Super Contributor
Posts: 296

Re: OUTPUT Survival estimate from proc lifereg

As far as I know you can not get the survivalfunction directly from proc lifereg. But, the Weibull distribution has a quite simple survival distribution, so you can calculate it yourself from the parameter estimates. Below I have calculated the survival distribution in a simulated example.

If the main goal is to get survivalfunctions, then I would suggest you to use the semiparametric hazard model, where you can get the survival functions directly from PROC PHREG.

data simulation;
  do i=1 to 1000;
    group=mod(i,2);
t=rand('weibull',2,exp(-1.5*group));
output;
  end;
ruN;
ods output parameterestimates=est;
proc lifereg data=simulation;
  model t=group/d=weibull;
run;

proc transpose data=est out=transposed;
  var estimate;
  id parameter;
ruN;

data survival_weibull;
  set transposed;
  do t=0 to 10 by 0.01;
    s0=exp(-exp(-0*group/scale)* t**weibull_shape);
    s1=exp(-exp(-1*group/scale)* t**weibull_shape);
output;
  end;
  keep t s0 s1;
run;
symbol1 i=join;
symbol2 i=join;
proc gplot data=survival_weibull;
  plot (s0 s1)*t/overlay;
run;

Ask a Question
Discussion stats
  • 1 reply
  • 573 views
  • 1 like
  • 2 in conversation