predicted survival probabilities (at intervals of 1 month)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

predicted survival probabilities (at intervals of 1 month)

paulandpen
Hi all,

I have seen in SAS where it is possible to generate predicted survival probabilities for individual cases across specified time periods.  For example, over 21 months of time, researchers using SAS generated p1 through to p21 (predicted survival probabilities for individual cases) and each case was assigned a score for each month that ranged between 1 and 0.  At p1, all cases were assigned 1, then at p2 each case was assigned a probability such as .995 (of course this varied a great deal), then at p3, each case was assigned another probability that was lower and at p4 this continued so on, until the end of the time period (21 months).  Naturally the probabilities reduced over time.

There is a macro that was used in the article from the following that was applied to PROC PHREG.

Allison, Paul D. Survival Analysis Using the SAS
System: A Practical Guide, Cary, NC: SAS Institute Inc.
1995. 292pp.

Here is the code below in SAS.  I am not familiar with SAS so am having a bit of trouble back engineering this (understatement).
%MACRO PREDICT (OUTEST=, OUT=_LAST_,XBETA=,TIME=);
DATA _PRED_;
_P_=1;
SET &OUTEST (KEEP=_DIST_ _SCALE_ _SHAPE1_ ) POINT=_P_;
SET &OUT;
LP=&XBETA;
T=&TIME;
GAMMA=1/_SCALE_;
ALPHA=EXP(-LP*GAMMA);
PROB=0;
IF _DIST_='EXPONENT' OR _DIST_='WEIBULL' THEN
PROB=EXP(-ALPHA*T**GAMMA);
IF _DIST_='LNORMAL' THEN PROB=1-PROBNORM((LOG(T)-
LP)/_SCALE_);
IF _DIST_='LLOGISTC' THEN PROB=1/(1+ALPHA*T**GAMMA);
IF _DIST_='GAMMA' THEN DO;
D=_SHAPE1_;
K=1/(D*D);
U=(T*EXP(-LP))**GAMMA;
PROB=1-PROBGAM(K*U**D,K);
IF D LT 0 THEN PROB=1-PROB;
END;
DROP LP GAMMA ALPHA _DIST_ _SCALE_ _SHAPE1_ D K U;
RUN;

In spss I have attempted to generate this, but all I am left with so many questions.  I understand you can use the SAVE subcommand to save the cumulative survival, and cumulative hazard, XBeta.
I have thought about generating each of these for the 21 months by selecting and running cox-regression at month 1, month 2, etc but feel like this is incorrect

USE ALL.
COMPUTE filter_$=(tenure le 3).
VARIABLE LABEL filter_$ 'tenure=3 (FILTER)'.
VALUE LABELS filter_$  0 'Not Selected' 1 'Selected'.
FORMAT filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE .
COXREG
  tenure  /STATUS=churn(1)  /STRATA=custcat
  /CONTRAST (gender)=Indicator
  /METHOD=ENTER age income employ reside gender
  /PLOT SURVIVAL HAZARD
  /SAVE=SURVIVAL SE LML HAZARD PRESID XBETA
  /PRINT=CI(95) CORR BASELINE
  /CRITERIA=PIN(.05) POUT(.10) ITERATE(20) .


If you know of any similar spss code to the SAS code, could you post a link please to this.

Cheers Paul