BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kc
Quartz | Level 8 kc
Quartz | Level 8

I would like to get 95% confidence interval for failure rate - an example would be perfect!

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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;

View solution in original post

3 REPLIES 3
SteveDenham
Jade | Level 19

Add an OUTSURV= <data set name> to your PROC LIFETEST statement.  It will contain confidence bounds for each strata.

 

SteveDenham

kc
Quartz | Level 8 kc
Quartz | Level 8
Hi Steve,
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 .



FreelanceReinh
Jade | Level 19

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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 3362 views
  • 1 like
  • 3 in conversation