This script illustrates the use of the LIFEREG procedure to analyze survival data with arbitrary (interval) censoring. It models the relationship between recovery time, age, and sex, including an interaction. Two analyses are performed to generate probability plots (probplots) based on specific reference data (xrow1 and xrow2).
Data Analysis
Type : CREATION_INTERNE
All data (tables 'mice', 'xrow1', 'xrow2') are defined directly in the script via DATALINES blocks.
1 Code Block
DATA STEP Data
Explanation : Creation of the main 'mice' dataset containing the explanatory variables (sex, age) and the time interval bounds (time1, time2).
Explanation : Creation of a reference dataset 'xrow1' for prediction or plotting (Sex 1, Age 50).
Copied!
data xrow1;
input sex age time1 time2;
datalines;
1 50 . .
;
1
DATA xrow1;
2
INPUT sex age time1 time2;
3
DATALINES;
4
150 . .
5
;
3 Code Block
DATA STEP Data
Explanation : Creation of a second reference dataset 'xrow2' (Sex 2, Age 60.6).
Copied!
data xrow2;
input sex age time1 time2;
datalines;
2 60.6 . .
;
1
DATA xrow2;
2
INPUT sex age time1 time2;
3
DATALINES;
4
260.6 . .
5
;
4 Code Block
PROC LIFEREG
Explanation : Execution of the Weibull survival model with 'mice' data. The 'xdata=xrow1' option is used to customize the probability plot. The 'model' statement defines the censoring bounds (time1, time2) and the covariates.
Copied!
ods graphics on;
proc lifereg data=mice xdata=xrow1;
class sex;
model (time1, time2) = age sex age*sex / dist=Weibull;
probplot / nodata
plower=.5
vref(intersect) = 75
vreflab = '75 Percent';
inset;
run;
1
ods graphics on;
2
PROC LIFEREGDATA=mice xdata=xrow1;
3
class sex;
4
model (time1, time2) = age sex age*sex / dist=Weibull;
5
6
probplot / nodata
7
plower=.5
8
vref(intersect) = 75
9
vreflab = '75 Percent';
10
inset;
11
RUN;
5 Code Block
PROC LIFEREG
Explanation : Second execution of the model, identical to the first, but using 'xrow2' as reference data for the plot.
Copied!
proc lifereg data=mice xdata=xrow2;
class sex;
model (time1, time2) = age sex age*sex / dist=Weibull;
probplot / nodata
plower=.5
vref(intersect) = 75
vreflab = '75 Percent';
inset;
run;
title;
1
PROC LIFEREGDATA=mice xdata=xrow2;
2
class sex;
3
model (time1, time2) = age sex age*sex / dist=Weibull;
4
5
probplot / nodata
6
plower=.5
7
vref(intersect) = 75
8
vreflab = '75 Percent';
9
inset;
10
RUN;
11
title;
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.
Copyright Info : SAS SAMPLE LIBRARY - NAME: LIFEREX4
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.