Related to #110
I'm trying to use left-truncation to account for age at study entry, and use age as the underlying time-scale, as recommended here).
suppressPackageStartupMessages({
library(survival)
library(flexsurv)
})
packageVersion("flexsurv")
#> [1] '2.3.2'
pbc$start <- pbc$age
pbc$stop <- pbc$age + pbc$time / 365.25
fit <- flexsurvspline(
Surv(start, stop, status == 2) ~ sex,
data = pbc,
k = 4
)
#> Error in optim(method = "BFGS", par = c(gamma0 = 0, gamma1 = 0, gamma2 = 0, : initial value in 'vmmin' is not finite
Created on 2026-03-09 with reprex v2.1.1
Related to #110
I'm trying to use left-truncation to account for age at study entry, and use age as the underlying time-scale, as recommended here).
suppressPackageStartupMessages({ library(survival) library(flexsurv) }) packageVersion("flexsurv") #> [1] '2.3.2' pbc$start <- pbc$age pbc$stop <- pbc$age + pbc$time / 365.25 fit <- flexsurvspline( Surv(start, stop, status == 2) ~ sex, data = pbc, k = 4 ) #> Error in optim(method = "BFGS", par = c(gamma0 = 0, gamma1 = 0, gamma2 = 0, : initial value in 'vmmin' is not finiteCreated on 2026-03-09 with reprex v2.1.1