y*****w 发帖数: 1350 | 1 I was running the JM package in R for a joint model for longitudinal and
survival data. I could successfully run the lme() function (for the mixed
model) and the coxph() function (for the Cox model) separately, but when I
ran the JointModel() function, the program returned the following error
message:
Error in fitter(X, Y, strats, offset, init, control, weights = weights, :
Can't fit a Cox model with 0 failures
I double checked my data and there was no any irregular point. What's the
meaning of "0 failures" in this context? The event rate in my data was not
100% for sure.
My code just mimicked the original code in the JM package shown below:
install.packages("JM", dependencies = TRUE)
library(JM)
library(lattice)
lmeFit <- lme(pro ~ treat * (time + t0), random = ~ time | id, data =
prothro)
survFit <- coxph(Surv(Time, death) ~ treat, data = prothros, x = TRUE)
fitJoint.pw <- jointModel(lmeFit, survFit, timeVar = "time", method = "
piecewise-PH-aGH")
fitJoint.sp <- jointModel(lmeFit, survFit, timeVar = "time", method = "
spline-PH-aGH")
Any idea as to why I got the error message? Thanks! |
|