- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I would like to get 95% confidence interval for failure rate - an example would be perfect!
Thanks.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @kc,
@kc wrote:
... but, using OUTSURV dataset gives CL for survival estimates not failure.
Yes, but you can calculate one from the other: failure rate = 1 − survival rate.
@kc wrote:
I believe values in _1_SDF_LCL_ and _1_SDF_UCL_ represent 95% CL for failure rates but the labels are switched? (Because _1_SDF_LCL_ > _1_SDF_UCL_ )
The variable names are correct (and the variable labels "1-SDF_LCL" and "1-SDF_UCL" are even clearer). As a consequence of the above relationship between the two rates, the LCL of the failure rate equals 1 − the UCL of the survival rate and the UCL of the failure rate equals 1 − the LCL of the survival rate. The survival rates (more precisely: survival probabilities) are the values of the survival distribution function (SDF). This also answers your next question:
@kc wrote:
Question: Not sure why this is happening. Is it safe to assume _1_SDF_LCL_ is indeed UCL for failure rate and _1_SDF_UCL_ is in fact LCL?
So, you'll get the same results from the failureplot ODS output dataset as you get by simply transforming the corresponding values from the OUTSURV= dataset (that @SteveDenham suggested) as described above.
Example:
/* Create test data */
data have;
call streaminit(27182818);
do id=1 to 200;
t=ceil(rand('expo',250));
censored=rand('bern',0.2);
output;
end;
run;
/* Compute survival estimates */
proc lifetest data=have outsurv=os noprint;
time t*censored(1);
run;
/* Derive failure estimates */
data want;
set os;
failure=1-survival;
if _censor_ ne 1 then do;
lcl=1-sdf_ucl;
ucl=1-sdf_lcl;
end;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Add an OUTSURV= <data set name> to your PROC LIFETEST statement. It will contain confidence bounds for each strata.
SteveDenham
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your response - but, using OUTSURV dataset gives CL for survival estimates not failure.
I believe using 'plots=survival(failure cl)' in the lifetest statement and 'failureplot=want' in the ods output statement does give CL for failure but the issue is interpretation: Here is a sample row from the 'want' dataset -
I have split one row from the dataset in to two rows here for better reading. I believe values in _1_SDF_LCL_ and _1_SDF_UCL_ represent 95% CL for failure rates but the labels are switched? (Because _1_SDF_LCL_ > _1_SDF_UCL_ )
Question: Not sure why this is happening. Is it safe to assume _1_SDF_LCL_ is indeed UCL for failure rate and _1_SDF_UCL_ is in fact LCL?
STRATUM Time SDF_LCL SDF_UCL Survival AtRisk Event Censored
1 0.72279 0.97752 0.99270 0.98717 918 1 .
StratumNum _1_SDF_LCL_ _1_SDF_UCL_ _1_SURVIVAL_ _1_CENSORED_
1 0.022476 .007304630 0.012827 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @kc,
@kc wrote:
... but, using OUTSURV dataset gives CL for survival estimates not failure.
Yes, but you can calculate one from the other: failure rate = 1 − survival rate.
@kc wrote:
I believe values in _1_SDF_LCL_ and _1_SDF_UCL_ represent 95% CL for failure rates but the labels are switched? (Because _1_SDF_LCL_ > _1_SDF_UCL_ )
The variable names are correct (and the variable labels "1-SDF_LCL" and "1-SDF_UCL" are even clearer). As a consequence of the above relationship between the two rates, the LCL of the failure rate equals 1 − the UCL of the survival rate and the UCL of the failure rate equals 1 − the LCL of the survival rate. The survival rates (more precisely: survival probabilities) are the values of the survival distribution function (SDF). This also answers your next question:
@kc wrote:
Question: Not sure why this is happening. Is it safe to assume _1_SDF_LCL_ is indeed UCL for failure rate and _1_SDF_UCL_ is in fact LCL?
So, you'll get the same results from the failureplot ODS output dataset as you get by simply transforming the corresponding values from the OUTSURV= dataset (that @SteveDenham suggested) as described above.
Example:
/* Create test data */
data have;
call streaminit(27182818);
do id=1 to 200;
t=ceil(rand('expo',250));
censored=rand('bern',0.2);
output;
end;
run;
/* Compute survival estimates */
proc lifetest data=have outsurv=os noprint;
time t*censored(1);
run;
/* Derive failure estimates */
data want;
set os;
failure=1-survival;
if _censor_ ne 1 then do;
lcl=1-sdf_ucl;
ucl=1-sdf_lcl;
end;
run;