When I run flexsurvspline, from the flexsurv package, on the attached dataset , I get the following error for any k>1:
flexsurvspline(Surv(time,dead)~1,data=input_df,k=2)
Error in optim(method = "BFGS", par = c(gamma0 = 0, gamma1 = 0, gamma2 = 0, :
initial value in 'vmmin' is not finite
From reading other posts with similar issues, I gather this is likely an issue with the inits parameter, and that I might have to generate my own inits function for this particular dataset. But I haven't found any guidance on how to do this for spline fits or what goes into that parameter. Am I correct that this is what's causing the error, and if so how should an inits function be determined?
Thanks in advance!