I have a medical background, with absolutely no knowledge about programming. I am working on survival analysis. I have fitted a multivariate Cox model which I need to cross-validate. My questions are:
- My dataset is small (79 samples & 37 events). Which is the better method of cross-validation - bootstrapping or leave-one-out method?
- I am using the
rms
package. I need someone to explain to me in plain English how to enter the code. I have tried reading the help on validation, calibration, but I have not understood much. I tried validation by various methods.
I have indicated below the error message I get. Can someone please explain to me what is going wrong and also give me the correct code to be used for: bootstrapping and cross-validation by leave-one-out method.
I have a cox model with four variables: v1
, v2
, v3
, v4
.
v1
is a factor with three levels; v2
, v3
and v4
are factors with two levels.
data=Model5
fitmodel5 <- cph(Surv(time,event)~v1+v2+v3+v4,na.action=na.omit,data=Model5,x=TRUE,y=TRUE,surv=TRUE)
val1 <- validate(fitmodel5, method="crossvalidation", B = 10, dxy=TRUE)**
Error in measure(xb[test], y[test, , drop = FALSE], strata = stra[test], :
fit failure in discrim,coxphFit
In addition: Warning message:
In fitter(..., strata = strata, rownames = rownames, offset = offset, :
Ran out of iterations and did not converge
val1 <- validate(fitmodel5, method=".6", B = 100, dxy=TRUE)
Weights for .632 method (ordinary bootstrap weights 0.01)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.00768 0.00925 0.01010 0.01000 0.01070 0.01290
Divergence or singularity in 3 samples
Warning messages:
1: In fitter(..., strata = strata, rownames = rownames, offset = offset, :
Ran out of iterations and did not converge
2: In fitter(..., strata = strata, rownames = rownames, offset = offset, :
Ran out of iterations and did not converge
val1 <- validate(fitmodel5, method="boot", B = 100, dxy=TRUE)
Divergence or singularity in 1 samples
Warning message:
In fitter(..., strata = strata, rownames = rownames, offset = offset, :
Ran out of iterations and did not converge
Thanks