Example 1 for PROC ICPHREG

This code is also available in: Deutsch Español Français
Difficulty Level
Beginner
Published on :
The script begins by creating a dataset named 'hiv' containing information on disease progression, with left and right-censored observation times. It then uses the ICPHREG procedure in three different ways to model this data: a first basic model, a second model specifying a piecewise constant baseline hazard function, and a third model that calculates Hazard Ratios for the disease stage variable.
Data Analysis

Type : CREATION_INTERNE


The data is created directly within the script via a DATA step and a 'datalines' statement. Values of 0 for the lower bound (Left) and values >= 26 for the upper bound (Right) are converted to missing values to handle data censoring.

1 Code Block
DATA STEP Data
Explanation :
This block creates the SAS table 'hiv' from embedded data ('datalines'). It defines the variables Left, Right, Stage, Dose, CdLow, and CdHigh. The conditional 'if' statements transform certain values into SAS missing data ('.') to correctly represent censored survival data.
Copied!
1DATA hiv;
2 INPUT Left Right Stage Dose CdLow CdHigh;
3 IF (Left=0) THEN Left=.;
4 IF (Right>=26) THEN Right=.;
5 DATALINES;
60 16 0 0 0 1
715 26 0 0 0 1
812 26 0 0 0 1
917 26 0 0 0 1
1013 26 0 0 0 1
110 24 0 0 1 0
126 26 0 1 1 0
130 15 0 1 1 0
1414 26 0 1 1 0
1512 26 0 1 1 0
1613 26 0 1 0 1
1712 26 0 1 1 0
1812 26 0 1 1 0
190 18 0 1 0 1
200 14 0 1 0 1
210 17 0 1 1 0
220 15 0 1 1 0
233 26 1 0 0 1
244 26 1 0 0 1
251 11 1 0 0 1
2613 19 1 0 0 1
270 6 1 0 0 1
280 11 1 1 0 0
296 26 1 1 0 0
300 6 1 1 0 0
312 12 1 1 0 0
321 17 1 1 1 0
330 14 1 1 0 0
340 25 1 1 0 1
352 11 1 1 0 0
360 14 1 1 0 0
37;
38 
2 Code Block
PROC ICPHREG
Explanation :
This block executes a proportional hazards regression model for interval-censored data. The response variable is the time interval (Left, Right). The explanatory variables are 'Stage' and 'Dose', treated as classification variables. The 'desc' option on the CLASS statement orders the levels of these variables in descending order.
Copied!
1PROC ICPHREG DATA=hiv;
2 class Stage Dose / desc;
3 model (Left, Right) = Stage Dose;
4RUN;
3 Code Block
PROC ICPHREG
Explanation :
This second execution of PROC ICPHREG includes two additional options. 'ithistory' displays the iteration history of the model fit. 'basehaz=pch(intervals=(10))' specifies that the baseline hazard function should be modeled as a piecewise constant function with a breakpoint at 10.
Copied!
1PROC ICPHREG DATA=hiv ithistory;
2 class Stage Dose / desc;
3 model (Left, Right) = Stage Dose / basehaz=pch(intervals=(10));
4RUN;
4 Code Block
PROC ICPHREG
Explanation :
This third model focuses on the effect of the 'Stage' variable. The 'hazardratio Stage' statement is added to request the calculation and display of Hazard Ratios for the different levels of the 'Stage' variable, allowing quantification of the effect of this variable on the risk.
Copied!
1PROC ICPHREG DATA=hiv;
2 class Stage / desc;
3 model (Left, Right) = Stage / basehaz=pch(intervals=(10));
4 hazardratio Stage;
5RUN;
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 : S A S S A M P L E L I B R A R Y


Related Documentation

Aucune documentation spécifique pour cette catégorie.