The script begins by creating a dataset named 'Fan' using embedded data (datalines) for the 'Lifetime' and 'Censor' variables. The 'Lifetime' variable is then scaled by being divided by 1000. Subsequently, it uses PROC LIFEREG to fit a survival regression model to the 'Fan' dataset. The model specifies 'Lifetime' as the survival time variable and 'Censor' (where 1 indicates a censored observation) as the censoring status variable, using a Weibull distribution. Options are enabled to generate a probability plot ('probplot'), a table of plot points ('ppout'), simultaneous nonparametric intervals ('npintervals=simul') and an inset in the ODS graph ('inset').
Data Analysis
Type : CREATION_INTERNE
The 'Fan' dataset is created directly within the script using the DATALINES clause, providing values for 'Lifetime' and 'Censor'.
1 Code Block
DATA STEP Data
Explanation : This DATA Step block creates the 'Fan' dataset by reading 'Lifetime' (survival time) and 'Censor' (censoring indicator) data directly from datalines. The 'Lifetime' variable is then divided by 1000 to scale it (for example, from milliseconds to seconds or similar units).
Explanation : This block uses PROC LIFEREG to fit a survival regression model to the 'Fan' dataset. 'Lifetime' is the survival time variable and 'Censor' (where a value of 1 indicates a censored observation) is the censoring status variable. The model is specified with a Weibull distribution ('d=Weibull'). The options 'probplot', 'ppout', 'npintervals=simul', and 'inset' are used to generate a probability plot of the data, a table of plot points, simultaneous nonparametric intervals, and an inset in the ODS (Output Delivery System) graph, respectively. The 'ods graphics on;' statement enables the creation of high-quality graphical output.
Copied!
ods graphics on;
proc lifereg data=Fan;
model Lifetime*Censor( 1 ) = / d = Weibull;
probplot
ppout
npintervals=simul;
inset;
run;
1
ods graphics on;
2
PROC LIFEREGDATA=Fan;
3
model Lifetime*Censor( 1 ) = / d = Weibull;
4
probplot
5
ppout
6
npintervals=simul;
7
inset;
8
RUN;
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.