Error when using ggcoxfunctional() on a model that includes splines

20 Views Asked by At

I'm having an issue with using ggcoxfunctional() from library(survminer)but only after I use splines in my model. Without splines, and even with additions like frailty.gamma(), it works. I'm struggling to see why there would be an issue.

I'm using the coxph() model from library(survival).

fit3 <- coxph(Surv(tstart, tstop_x, status == 1) ~ pspline(x1)+ pspline(x2), data)

ggcoxfunctional(spline_fit, data)

I then get the following error: Error in xy.coords(x, y, setLab = FALSE) : 'x' and 'y' lengths differ.

0

There are 0 best solutions below