BookmarkSubscribeRSS Feed
ammarhm
Lapis Lazuli | Level 10

Hi all

I have a simple proc lifetest:

 

proc lifetest data=d4 atrisk plots=survival( f atrisk (atrisktickonly outside) test  ) notable;

strata status;

time Year*esldnum(0);

run;

 

How can I estimate 

1- The Cumulative rate and CI at a certain time point (t)

2- The total person-year follow up time for each strata?

 

Kind regards

Am

10 REPLIES 10
PGStats
Opal | Level 21

1- From the manual :  proc lifetest data=d4 atrisk notable TIMELIST=t  ... ;

2- proc sql; select status, sum(year) as totalFollowUpYears from D4 group by status; quit;

PG
JacobSimonsen
Barite | Level 11
Agree...except that the confidence intervals are not shown by adding "timelist=". Only the estimated survival probability at time=t is shown.

Alternative, the survival probability and confidence intervals can be read from the dataset with the survival curve: (t=5 here).

proc lifetest data=d4 outsurv=outsurv;
strata status;
time Year*esldnum(0);
run;
data pointestimate;
set outsurv(where=(t<5));
by status;
if last.status;
run;

ammarhm
Lapis Lazuli | Level 10

Thank you all

I think what I would get from these analysis is the cumulative survival

What I am actually interested in is the cumulative hazard rate at the a certain time point (the median survival point)

Wouls appreciate any help with that

Kind regards

A

PGStats
Opal | Level 21

Hazard estimates are only provided with the life table method in the OUTSURV= dataset.

PG
ammarhm
Lapis Lazuli | Level 10

Thanks again

The Outsurv tables provides "Survival Distribution Function Estimate", and that is not the cumulative hazards

Could anyone please comment on how to get the cumulative hazards at a certain time point and their confidence interval (at that time point)

Kind regards

 

JacobSimonsen
Barite | Level 11

If you want the cumulative survial rate (not the probability) then you just take -Log(S(t)), where S is the Kaplan Meier curve. Confidence intervals is found just be use same transformation of the confidence intervals of the Kaplan Meier curve.

 

Or, you can get it directly from proc phreg:

data simulation;
  do i=1 to 1000;
    t=rand('exponential',10);
    c=rand('exponential',10);
	event=(t<c);
	t=min(t,c);
	output;
  end;
run;
proc phreg data=simulation;
  model t*event(0)=;
  baseline out=out cumhaz=cumhaz lowercumhaz=lower uppercumhaz=upper;
ruN;

 and, if you want to pick out the function as a specific time-point you can do by find the last observation in the "out" dataset before (or at) the timepoint you are interested. Like in my suggestion above.

 

by the way, it is not so easy to find the median survival point if you have censoring. In that case you may need to assume some distribution of the survival time (weibull for instance) and then use proc lifereg to estimate the parameters. Afterward you can calculate median from the estimated parameters.

ammarhm
Lapis Lazuli | Level 10

Thank you JacobSimonsen

Very nice suggession

 

I tried a different approach:

 

ods output productlimitestimates=naout;
proc lifetest data=d4 nelson ;
strata group;
time time*event(0);
run;
proc sort data=naout (where=(cumhaz ne .));
by group time ;
run; data naout2; set naout; LowerCIFailure=failure-1.96*StdErr; UpperCIFailure=failure+1.96*StdErr; LowerCICumHaz=CumHaz-1.96*StdErrCumHaz; UpperCICumHaz=CumHaz+1.96*StdErrCumHaz; run;

Interestingly this produces the exact cum hazards estimates as the ones from proc phreg as you suggested

But the 95% confidence intervals are different, so I mudt have calculated it worngly

Any suggession is appreciated

Kind regards

JacobSimonsen
Barite | Level 11
I dont think you calculated it wrong. Your method can be asymptotical equivalent to what phreg produce. I think phreg cumputes the limits on some transformation of the cumulative hazard, which then is transformed back.

Unfortunately, it is not mentioned in the documentation how the limits of the cumulative hazard is computed. But I guess that it is calculated as -log() to the limits of S(t), and these limits are calculated on the log(S(t)) scale by default.
ammarhm
Lapis Lazuli | Level 10

I would appreciate if there is a way to programmatically calculate the confidence interval for failure using the lifetest procedure. THe option outsurv gives the confidence interval table for survival only and not for failure

Kind regards

 

JacobSimonsen
Barite | Level 11

since probability of failure is just 1-survial, you can calculate confidence limits for failure from the confidence limits of survival.

 

 

proc lifetest data=...          outsurv=outsurv;

...

..

run;

 

data outsurv;
  set outsurv;
  failure=1-survival;
  failure_lower=1-sdf_ucl;
  failure_upper=1-sdf_lcl;
run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 5318 views
  • 4 likes
  • 3 in conversation