The following R code computes the relative importance for predictor variables in a survival model. The implemented method for computing the relative importance was inspired by the Leo Breiman’s method for computing variable importance in a Random Forest.

Breiman’s method for computing variable importance can best be explained with an example.

Suppose you have 5 predictor variables, say *x _{1}* to

*x*. These 5 variables are used for predicting some observed response

_{5}*y*. However, the 5 variables do not predict exactly the observed values for

*y*. In other words, the predictions based on the 5 variables will more or less deviate from the observed values for

*y*. The Mean Squared Error (MSE) is calculated as the mean of these deviations.

Assume now that predictor

*x*has no predictive value for the response

_{1}*y*. Hence, if we would randomly permute the observed values for

*x*, then our predictions for

_{1}*y*would hardly change. As a consequence, the MSE before and after permuting the observed values for

*x*would be similar.

_{1}On the other hand, assume that

*x*is strongly related to our response

_{3}*y*. If we randomly permute the observed values for

*x*, then our MSE before and after this permutation would deviate considerably.

_{3}Based on these random permutations and our observed change in MSE, we may conclude that predictor variable

*x*is more important than

_{3}*x*in predicting

_{1}*y*.

The R code below applies Breiman’s permutation method for computing the relative importance of predictor variables to a survival model. However, instead of MSE the code employs concordance as a measure for the prediction accuracy.

Furthermore, the R code also compares in 2 simulations the performance of Breiman’s method applied to survival models with that of Breiman’s method implemented in a random survival forest.

Continue reading R code for computing variable importance for a survival model