Published on :
Général CREATION_INTERNE

Sans titre

This code is also available in: Deutsch Español Français
Awaiting validation
Data Analysis

Type : CREATION_INTERNE


Data is defined directly in the script (datalines) and concerns death times, censoring, stage, and age at diagnosis.

1 Code Block
DATA STEP Data
Explanation :
Creation of the 'ex1_8b' dataset containing clinical information. Variables are time, censor, stage, age, and year of diagnosis.
Copied!
1DATA ex1_8b;
2INPUT time censor stage age_diag yr_diag;
3lines;
40.6 1 1 77 76
51.3 1 1 53 71
62.4 1 1 45 71
7/* ... données tronquées pour l'affichage ... */
84.3 0 4 48 76
9;
2 Code Block
DATA STEP Data
Explanation :
Data preparation step: creation of indicator variables (dummy variables) 'stage2', 'stage3', 'stage4' to represent the categorical levels of the 'stage' variable in the regression models.
Copied!
1DATA ex1_8b; SET ex1_8b;
2title 'Example 1.8, page 9 data -- Death Times of Male Laryngeal Cancer Patients';
3title3 'Proportional Hazards Regression Model -- Local Tests';
4stage2=(stage=2);
5stage3=(stage=3);
6stage4=(stage=4);
7RUN;
3 Code Block
PROC PRINT
Explanation :
Displays the content of the prepared dataset for verification.
Copied!
1PROC PRINT DATA=ex1_8b;
2RUN;
4 Code Block
PROC PHREG
Explanation :
Cox model including age and stage indicators. TEST statements are used to test the overall effect of stage (no_stage) and perform pairwise comparisons between stages.
Copied!
1PROC PHREG DATA=ex1_8b;
2model time*censor(0) = stage2-stage4 age_diag;
3no_stage:test stage2,stage3,stage4;
4st2_st3: test stage2=stage3;
5st2_st4: test stage2=stage4;
6st3_st4: test stage3=stage4;
7RUN;
5 Code Block
PROC PHREG
Explanation :
Second Cox model including only stage indicators (without age), with tests for equality between coefficients of different stages.
Copied!
1PROC PHREG DATA=ex1_8b;
2model time*censor(0) = stage2-stage4;
3test stage2=stage3;
4test stage3=stage4;
5test stage2=stage4;
6RUN;
6 Code Block
PROC LIFETEST
Explanation :
Non-parametric survival analysis (actuarial/Life-Table method, or Kaplan-Meier depending on default options if method=life is not specified; here 'method=life' requests the actuarial method). Produces graphs of the survival function (s) and hazard function (h), stratified by stage.
Copied!
1PROC LIFETEST DATA=ex1_8b method=life plots=(s,h) graphics;
2time time*censor(0);
3strata stage;
4symbol1 v=none color=red line=1;
5symbol2 v=none color=blue line=2;
6symbol3 v=none color=green line=3;
7RUN;
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.