drizopoulos / JM

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

diagnostic plots #9

Closed BethPhipps closed 6 years ago

BethPhipps commented 6 years ago

Hi sorry if I am missing something obvious but I get an error when I try and use the basic diagnostic plot for JM if I just have a random intercepts model. So in terms of an example you used in "JM: An R Package for the Joint Modelling of Longitudinal and Time-to-Event Data".

fitLME <- lme(sqrt(CD4) ~ obstime + obstime:drug, random = ~ 1 | patient, data = aids) fitSURV <- coxph(Surv(Time, death) ~ drug, data = aids.id, x = TRUE) fit.JM <- jointModel(fitLME, fitSURV, timeVar = "obstime", method = "piecewise-PH-aGH")

plot(fit.JM, which = 1) plot(fit.JM, which = 2) plot(fit.JM, which = 3) plot(fit.JM, which = 4)

Here I have just changed the random effects in the mixed effects model to 1|patient instead of obstime|patient and it comes up with the following error when I try and plot the 3rd and 4th plot.

Error in Zs * b[id.GK, , drop = FALSE] : non-conformable arrays

If you could help me understand why that is it would be greatly appreciated! again sorry if this is obvious :)

drizopoulos commented 6 years ago

Thanks for reporting this. It was a bug in the plot method. It is now corrected in version 1.4-9 available on this repository.