The ICPHREG Procedure

Example 65.1 Fitting Cubic Spline Models

(View the complete code for this example.)

This example illustrates how to use a cubic spline baseline hazard to fit a proportional hazards model.

Consider the HIV data set in the section Getting Started: ICPHREG Procedure. The following statements request a cubic spline proportional hazards model and the hazard ratio between the two levels of the Stage variable.

proc icphreg data=hiv;
   class Stage / desc;
   model (Left, Right) = Stage / basehaz=splines;
   hazardratio Stage;
run;

Output 65.1.1 displays information about the fitted spline model.

Output 65.1.1: Model Information

The ICPHREG Procedure

Model Information
Data SetWORK.HIV
Left BoundaryLeft
Right BoundaryRight
Baseline HazardCubic Splines


If no suboption is specified for the spline model, PROC ICPHREG uses three knots, generating three spline coefficients. Output 65.1.2 shows the selected knots.

Output 65.1.2: Cubic Spline Coefficients

Cubic Spline Parameters
CoefficientKnot
Coef11
Coef211
Coef325


The table of parameter estimates for the spline model is displayed in Output 65.1.3.

Output 65.1.3: Parameter Estimates for the Spline Model

Analysis of Maximum Likelihood Parameter Estimates
EffectStageDFEstimateStandard
Error
95% Confidence LimitsChi-SquarePr > ChiSq
Coef1 1-6.06303.2263-12.38650.2605  
Coef2 11.49212.2568-2.93115.9152  
Coef3 1-0.30860.6708-1.62331.0060  
Stage111.90160.66620.59593.20728.150.0043
Stage000.0000     


Output 65.1.4 shows the estimated hazard ratio between the two stages and the confidence limits.

Output 65.1.4: Hazard Ratio Estimate for Stage Values 1 and 0

Hazard Ratios for Stage
DescriptionPoint Estimate95% Wald Confidence Limits
Stage 1 vs 06.6971.81524.711


The cubic spline model can be considered a generalization of the Weibull proportional hazards model. It reduces to the Weibull model when there are only two knots, in which case the degrees of freedom is one (DF=1). The Weibull model assumes that the cumulative hazard function is a straight line in the log time scale whereas cubic splines offer a richer set of shapes that have more knots. The following statements fit the spline model with DF=1:

proc icphreg data=hiv;
   class Stage / desc;
   model (Left, Right) = Stage / basehaz=splines(df=1);
   hazardratio Stage;
run;

The "Fit Statistics" table is displayed in Output 65.1.5.

Output 65.1.5: Fit Statistics for the Spline Model When DF=1

The ICPHREG Procedure

Fit Statistics
-2 Log Likelihood30.025
AIC (Smaller is Better)36.025
AICC (Smaller is Better)36.914
BIC (Smaller is Better)40.327


The table of parameter estimates for the fitted spline model is displayed in Output 65.1.6.

Output 65.1.6: Parameter Estimates for the Spline Model When DF=1

Analysis of Maximum Likelihood Parameter Estimates
EffectStageDFEstimateStandard
Error
95% Confidence LimitsChi-SquarePr > ChiSq
Coef1 1-7.34812.4438-12.1378-2.5584  
Coef2 12.54200.89740.78314.3008  
Stage111.82650.61320.62473.02838.870.0029
Stage000.0000     


You can request that PROC LIFEREG fit an accelerated failure lifetime model by using the default distribution (Weibull). This would be equivalent to fitting the proportional hazards model by using a Weibull baseline hazard (Klein and Moeschberger 1997). The following statements fit the Weibull model:

proc lifereg data=hiv;
   class Stage;
   model (Left, Right) = Stage;
run;

The table of fit statistics is displayed in Output 65.1.7.

Output 65.1.7: Fit Statistics That Are Produced by PROC LIFEREG

The LIFEREG Procedure

Fit Statistics (Unlogged Response)
-2 Log Likelihood30.025
Weibull AIC (smaller is better)36.025
Weibull AICC (smaller is better)36.914
Weibull BIC (smaller is better)40.327


The table of parameter estimates for the Weibull model is displayed in Output 65.1.8.

Output 65.1.8: Parameter Estimates That Are Produced PROC LIFEREG

Analysis of Maximum Likelihood Parameter Estimates
Parameter DFEstimateStandard
Error
95% Confidence LimitsChi-SquarePr > ChiSq
Intercept 12.17220.17911.82112.5233147.06<.0001
Stage010.71850.27110.18711.24997.020.0080
Stage100.0000.....
Scale 10.39340.13890.19690.7858  
Weibull Shape 12.54200.89741.27265.0776  


Comparing Output 65.1.7 with Output 65.1.5, you can see that the two model fits produce identical likelihood values.

The Weibull shape estimate is equal to the second spline coefficient, but the rest of the parameter estimates are different. This is because PROC LIFEREG fits the Weibull model under the configuration of accelerated failure time models. The estimates of regression coefficients from PROC LIFEREG and PROC ICPHREG are proportional; their ratio equals the negative of the Weibull shape parameter. For example, the estimate –0.7185 from PROC LIFEREG can also be obtained by dividing the estimate 1.8265 from PROC ICPHREG by –2.5420.

Last updated: February 13, 2019