Closed quanhomie closed 5 months ago
I wouldn't recommend using flexsurv with time-dependent covariates. The likelihood calculation does not generally apply (see this Github issue), and prediction from them isn't supported.
More technically, the error message was due to an unrelated issue - flexsurv uses a heuristic to choose the initial parameter values for optimisation, which sometimes fails. You can work around this by providing your own initial values (e.g. informed by parameter estimates from a simpler model that does work):
flexsurvspline(Surv(start_t, end_t, status) ~ cov1, data = data, k = 1, inits = c(-4, 0.7, 0))
Hi, thanks for giving us great package to use.
I'm trying to fitting model with time-dependent covariate using flexsurvspline function
but it gives me an error message saying,
The code run well if I use the Surv object not in counting process form, which means
I'm wondering whether this error occurs because flexsurvspline function cannot be used for fitting model with time-dependent covariate or occurs because of the optimization problem.
The test data file is attached here test_data.csv
Thank you in advance.