Validation of cox model

Hi everyone,

Currently I am working on an analysis using the cox model. I have about 200 observations. I built a model based on the results of univariate analysis (also cox, with the best p-value results).

In the next step, I would like to validate such a model. What validation strategy is recommended for such a sample size?

I was very interested in the article - LINK - but I don’t know exactly how to do this validation based on the rms package. :frowning_face:

PS - I am beginner in R :smile:

Unfortunately models based on univariable screening and p-values are not valid. One of the disappointments you’ll find during validation is that you will not be able to replicate the list of “winning” variables. I suggest you take a fresh look at the problem using some of the methods in the RMS course notes. If you have too many variables, use unsupervised learning (data reduction), not variable selection. This data reduction must be masked to Y.

3 Likes

Thanks for this suggestion and link (notes look very extensive and helpful). However, when I will have appropriate variables and want to validate the model - what type of validation is recommended in this case?

PS
It is an honor for me to have a message directly from you. :slight_smile:

Hi,

I would also like to validate a Cox model for prediction in R. The data has about 80 events within 600 observations and the predictors were chosen a priori.

I would like to use the rms package for this, but for some reason, can’t get a simple example to work as I expect: the performance statistics are computed for the development data, but all other columns contain only NaNs. Does anyone know why this is occurring and how to fix it?

Here is a short example:

library(survival)
library(rms)

data(cancer, package=“survival”)
dd ← datadist(cancer)
options(datadist= ‘dd’)

fit

s1yr ← Surv(cancer$time, cancer$status)
cph.euro.log ← cph(s1yr ~ log(age), data = cancer, method = ‘exact’,
x = TRUE, y = TRUE, surv = TRUE)

validate

validate(cph.euro.log, B=20)

It works if you drop `method=‘exact’. I’ll put this on my to-do list for ‘exact’.

Please Use legal R quote marks and set off code with three back ticks.

1 Like