This script illustrates a survival analysis on industrial fan reliability data. It begins by creating the 'Fan' dataset containing operating times and censoring indicators. The LIFEREG procedure is then used to fit a log-normal parametric model with a Bayesian approach (BAYES statement), generating posterior samples in the 'Post' table. A subsequent DATA step uses these samples to estimate the probability distribution of failure at 8000 hours. Finally, PROC MEANS provides descriptive statistics (mean and percentiles) on this estimated probability.
Data Analysis
Type : INTERNAL_CREATION
Data is defined directly in the script via the 'datalines' statement in the DATA Fan step.
1 Code Block
DATA STEP Data
Explanation : Creates the SAS table 'Fan' by reading internal data (datalines). The 'Lifetime' variable represents the lifespan and 'Censor' indicates whether the observation is censored (1) or not (0).
Explanation : Performs a regression analysis on survival data with a log-normal distribution. The 'bayes' statement activates Bayesian analysis, sets a random seed for reproducibility (seed=1), and exports posterior distribution samples to the 'Post' table.
Explanation : Uses the estimated parameters (Intercept, Scale) stored in the 'Post' table to calculate the 'Frac' variable. This variable represents the estimated probability of failure at 8000 hours for each iteration of the Bayesian simulation.
Copied!
data Prob;
set Post;
Frac = ProbNorm(( log(8000) - Intercept ) / Scale );
label Frac= 'Fraction Failing in 8000 Hours';
run;
Explanation : Calculates descriptive statistics (number of observations, mean, and various percentiles) on the 'Frac' variable from the 'Prob' table to summarize the posterior distribution of the probability of failure.
Copied!
proc means data = Prob(keep=Frac) n mean p10 p25 p50 p75 p90;
run;
1
2
PROC MEANS
3
DATA = Prob(keep=Frac) n mean p10 p25 p50 p75 p90;
4
RUN;
5
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.