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
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;
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
Hazard estimates are only provided with the life table method in the OUTSURV= dataset.
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
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.
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
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
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;
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.
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.