Skip to content
Prev 280178 / 398506 Next

k-folds cross validation with conditional logistic

Terry Therneau <therneau at mayo.edu> writes:
Terry,

I do not know the answer to the question you posed, but I suspect the
answer is no.

The cross-validation would need to be done stratum-wise, but that does
not seem to be supported by predict.coxph():
Error in predict.coxph(train.sans.1, newdat = subset(infert, stratum ==  : 
  New data has a strata not found in the original model


One can work around this:
[1] TRUE
but the predicted values are not centered in each stratum as usual with
strata in predict.coxph (if that matters):
1        84       166 
 0.000000 -2.527759 -2.527759
1         84        166 
 1.6851724 -0.8425862 -0.8425862 


Best,

Chuck