Sunday, October 18, 2020

Visual Inspection and Statistical Tests for Proportional Hazard Assumption

To analyze the time to event data (or survival analysis in the early days), the most commonly used approaches are the non-parametric method (such as log-rank test) and the semi-parametric method (Cox proportional hazard regression model). There are a lot of discussions about checking the assumption of the proportional hazard that is defined as the time independence of the covariates in the hazard function, that is, the ratio of the hazard function for two treatment groups with different regression covariates does not vary with time.

If the proportional hazard assumption does not hold,

  • the non-parametric log-rank test is still valid, but the statistical power will be decreased
  • the semi-parametric method of Cox proportional hazard regression will be invalid
There are several methods to check the proportional hazard assumption, primarily the virtual check of the various plots. 

Kaplan-Meier Plot:

For time to event variables, the first thing we will do is to generate the Kaplan-Meier plot. Kaplan-Meier curves can tell if there is an unusual pattern suggesting non-proportional hazards. For example, three Kaplan-Meier plots below suggest different types of non-proportional hazards that are commonly seen in clinical trials: delayed treatment effect, crossing hazard, and diminishing treatment effect. 
 

the Kaplan-Meier plot can be easily generated using SAS Proc Lifetest.
Proc lifetest plot=(s);
Time aval*cnsr(1);
Strata trt01p;
Run;
Where (s) specifies the request for survival plot (i.e., Kaplan-Meier plot). aval is the time to event variable, cnsr is the indicator for the censoring values. 

Log Log Survival Plot 

This plots the log of negative log of estimated survivor functions versus the log of time. The y-axis is
log(-log(Survival)) and the x-axis is log(time). We can visually check if there are two straight parallel lines suggesting the proportional hazards. The log log survival plot below may suggest the minor deviation from the proportional hazard assumption, but may still be ok (since there is no line crossing). 

the Log-lot plot can be easily generated using SAS Proc Lifetest.
Proc lifetest plot=(lls);
Time aval*cnsr(1);
Strata trt01p;
Run;
where (lls) requests for the log log plot. 

Schoenfeld Residual Plot

Schoenfeld plots every time event to test the proportional hazard assumption. A straight line passing through a residual value of 0 with gradient 0 indicates that the variable satisfies the PH assumption and therefore does not depend on time.

According to Schoenfeld's paper "Partial Residuals for The Proportional Hazards Regression Model"
Residuals are defined for the proportional hazards regression model introduced by Cox
(1972). These residuals can be plotted against time to test the proportional hazards
assumption. Histograms of these residuals can be used to examine fit and detect outlying
covariate values.

The Schoenfeld residual plot below suggests that the proportional hazard assumption holds (the horizontal line with slop = 0), but there seems to be an outlier (circled in yellow).  

Schoenfeld residual plot can be generated with two steps: obtain the Schoenfeld residuals from the model fit and then use a graphic tool to draw the plots. 

Proc phreg ;
Class trt01p (ref='N');
Model aval*cnsr(1) = trt01p;
output out= phcheck ressch = schres;
run;
Proc sgplot data=phcheck;
Loess x = aval y = schres / clm;
run;

Besides these plots, there are also some statistical tests (i.e., giving a p-value) for checking the proportional hazard assumptions. Unfortunately, none of these statistical tests can give a definitive answer about the proportional hazard assumptions (very similar to the normality tests by Shapiro-Wilk test or Kolmogorov-Smirnov test) that are commonly accepted.


Tests by Including Time-Dependent Covariates in the Cox Model

Generate the time-dependent covariates by creating interactions of the predictors and a function of survival time and include in the model. If any of the time-dependent covariates are significant then those predictors are not proportional.

In SAS it is possible to create all the time-dependent variables inside Proc Phreg. Furthermore, by using the test statement, it is possible to test all the time-dependent covariates all at once.
Proc phreg; 
 Model aval*cnsr(1) = age treat aget treatt; *treat has to be numeric values;
 aget = age*log(aval);  *Creating time dependent age variable (time*age interaction);
 treatt = treat*log(aval); *Creating time dependent age variable (time*treatment interaction); 
 TestAll: TEST aget, treatt; *test PH for all time dependent covariates;
run;

Where 'TestAll' is the label and the TEST statement tests linear hypotheses about the regression coefficients. PROC PHREG performs a Wald test for the joint hypothesis specified in a single TEST statement. Each equation specifies a linear hypothesis; multiple equations (rows of the joint hypothesis) are separated by commas.

Using ASSESS with the PH option (the supremum test) to check proportional hazards

This approach is based on the paper by Lin DY, Wei LJ, and Ying Z. (1993), “Checking the Cox Model with Cumulative Sums of Martingale-Based Residuals” Biometrika, 80, 557–572 and is built into SAS Proc PHREG with ASSESS statement.

The procedure can detect violations of proportional hazards by using a transform of the martingale residuals known as the empirical score process. The empirical score process under the null hypothesis of no model misspecification can be approximated by zero mean Gaussian processes, and the observed score process can be compared to the simulated processes to asses departure from proportional hazards.

In SAS, the ASSESS statement with the PH option provides an easy method to assess the proportional hazards assumption both graphically and numerically for many covariates at once. 

proc phreg;
  class trt01p(ref='N');
  model aval*cnsr(1)=trt01p age / rl ties=efron;
  assess PH / resample seed=123456;
run;

The option PH in ASSESS statement tells SAS that we would like to assess proportional hazards in addition to checking functional forms. The resample option is to request the supremum tests of the null hypothesis that proportional hazards holds. These tests calculate the proportion of simulated score processes that yielded a maximum score larger than the maximum observed score process. A very small proportion (p-value) suggests a violation of proportional hazards.

Grambsch-Therneau test or G-T test based on the scaled Schoenfeld residuals

Schoenfeld residual plot can be visually checked to assess the proportional hazard assumption. In addition, Grambsch-Therneau test can be used to do a hypothesis testing for the proportional hazard assumption. This approach is based on the paper by Grambsch-Therneau "Proportional Hazards Tests and Diagnostics Based on Weighted Residuals". This is essentially a goodness-of-fit test. 

Grambsch-Theneau test is not readily available in SAS, but there are programs in SAS or R available to do the G-T test. 
When analyzing the data for time to event variables, checking the assumption of proportional hazards is a 'must' step to do. However, we also need to realize that there is no single method that is acceptable to everybody. The visual check of various plots and the statistical tests all contain the subjective components in judging if the proportional hazard assumption holds. In most situations, the violation of the proportional hazard assumption is obvious. Only in the situation that there seems to be a minor or borderline violation, may different approaches give different conclusions - then the impact of the non-proportional-hazards on the estimation may not be very big. However, the sensitivity analyses assuming non-proportional-hazard assumption or non-parametric analyses (such as log-rank test) should be performed.  

1 comment:

Anonymous said...

The LogPlot Data Editor can take information from the keyboard, copy/paste, data collection, and import tools, among other places. Logplot