As best as I can tell from the linked publication, the models based on the training set were applied, with the same regression coefficients, to the data in the internal and external validation sets.
The problem with your proposed approach is that the
coxph() function will try to re-fit models to
pred2 on the new data. You would get a new regression coefficient for each model, a slope for how each of
pred2 is associated with log hazard in the new data set. That's useful in some contexts; for example, it's how the
validate() function in Harrell's
rms package evaluates the optimism in a model. But that's not what you want.
The trick with likelihoods based on a model with pre-defined regression coefficients is to recognize that you just want to evaluate the (partial) likelihood of the data, given that model. AdamO shows, with code, a very simple way to do this with Cox models:
If you simply want the partial likelihood, why not fool R into giving it to you? Simply initialize beta and allow no iterations, then extract the
loglik value from the
I don't know if that's precisely how the authors of this study did this, but that's the basic idea. An alternative might be to use
offset(pred2) to force their regression coefficients to be exactly 1, then extract the log likelihoods.
For the C-index calculations, the authors say that they used tools in the
compareC package. I don't have experience with that package. The basic R
survival package has a
concordance() function that can evaluate the C-index for a model applied to new data.
A few warnings.
First, as the authors note, even Harrell doesn't find the C-index useful for comparisons among models. It's a good measure of discrimination for a single model.
Second, a split into training and validation sets isn't the most efficient use of data when there are so few cases. See this post, for example. Resampling from a combined data set is generally better unless there are tens of thousands of cases.
Third, the authors' use of LASSO might have found a set of predictors that work OK, but the same procedure applied to a new data set might well find a different set of predictors. It's not clear that the authors' use of bootstrapping evaluated the entire model-building process including the LASSO predictor selection. That's another advantage of a full resampling-based validation of the model-building process in this situation.