I use Cox regression to model survival data. My dataset has 345 observations and 78 events. The number of predictors in the Cox model is 124. All 124 variables are continuous Now, I want to do variable selection.The forward selection works fine. However, the stepwise and backward selection give the following error:
Error in coxph.wtest(fit$var[nabeta, nabeta], temp, control$toler.chol) :
NA/NaN/Inf in foreign function call (arg 3)
Here is a sample of the code (unfortunatelly I cannot provide any data):
fit <- coxph(Surv(time,Status) ~ . , data=data1)
final <- step(fit, direction="both")
Anyone knows what is the problem/what is the meaning of this error? Is it the number of predictors maybe?