Reputation: 31
I receive the following error message:
Error in if (t1 || t2) { : missing value where TRUE/FALSE needed
And when I just type:
library(JM)
lmefit=lme(ADAS11+apoe4+AGEING,random = ~AGEING|RID,data = AD,na.action=na.exclude)
coxfit=coxph(Surv(AGEEND,DXEND)~apoe4bl+,data = AD.RID,x=TRUE)
jointfit=jointModel(lmefit,coxfit,timeVar = "AGEING")
What does it mean, and how do I solve it.Thanks
Upvotes: 3
Views: 684
Reputation: 41
I tried rescaling the time variable and it worked without having to remove any IDs
Worth a shot
https://github.com/drizopoulos/JM/issues/10
Upvotes: 1
Reputation: 131
I was having the same problem, and have found excluding some IDs can avoid the error message.
Some of the IDs in my dataset contained only one data point for the longitudinal variable. When I removed these IDs from the data, including only the IDs which had at least 2 entries, the model ran without the error. I suspect this was causing the problem, as the model then might not know how to estimate the random-effects gradient for these variables.
One way to remove them:
AD <- AD[which(is.element(AD$RID,
AD$RID[duplicated(AD$RID)])),]
Note you'll have to remove them from both AD and AD.RID as these datasets need to be corresponding, where AD and AD.RID are both ordered by ID and contain the same individuals.
As to what the variables t1 and t2 are, and what exactly is causing the error I'm not sure - I checked the source code of jointModel, coxph and lme and they don't appear in any of the functions.
If you want to include these IDs it might be more possible in the Bayesian framework than frequentist, as it's easier to deal with missing data with Bayesian methods. I haven't yet looked at it but the JMBayes package in R fits Bayesian joint models and might allow you to include these individuals.
Upvotes: 0