drizopoulos / JM

Joint Models for Longitudinal & Survival Data under Maximum Likelihood
34 stars 7 forks source link

Error in if (t1 || t2) { : missing value where TRUE/FALSE needed #47

Open anandhari97 opened 8 months ago

anandhari97 commented 8 months ago

Hi, I'm encountering an error while attempting joint modeling for my dataset using the spline-PH-GH method. Here's a snippet of my code:

lmefit<-lme(y ~ time+age+sex+comorb+stage,random=~ time|ID,data = long) coxfit<-coxph(Surv(time,DEATH)~age+sex+comorb+stage,data = Surv,x=T) jointFit<-jointModel(lmefit, coxfit, timeVar = "time",method = "spline-PH-GH")

I got the following error message: Error in if (t1 || t2) { : missing value where TRUE/FALSE needed.

This issue doesn't occur when I use other methods like "piecewise-PH-aGH" or "Weibull-AFT-GH". I've attached a subset of my dataset for reference. datasets.zip

I'd appreciate any insights into why this error is occurring and how I might resolve it. Thanks in advance for your help!