I am trying to use the jointModel function in the JM package to fit a
simple joint model to longitudinal and survival data.
I have come accross a range of errors when trying different things and
just can't seem to get around them all.
The code I use is as follows:
fitLME = lme(cd4~trt+time, random=~time|num, data=mnuts2); summary(fitLME)
fitSURV = coxph(Surv(fail.time, SI.code)~trt, x=TRUE, data=cov);
summary(fitSURV)
fitJM = jointModel(fitLME, fitSURV, timeVar="time",
method="piecewise-PH-GH"); summary(fitJM)
Both the lme and coxph functions work fine and both give the same sample
size (though sometimes I get the unequal sample size error that I see
others have experienced without a solution). My current error says "Can't
fit a Cox model with 0 failures" despite the coxph function working fine.
Previously I had an error message saying there were longitudinal
measurements after the event (which I wouldn't have thought would be a
problem!), I dealt with that by removing all measurements after the
failure time.
I want to know if there is somewhere I can find all the requirements (in
terms of data structures, lme and coxph limitations etc.) for the
jointModel function to work or someone who can help me with my errors.
Charles