drizopoulos / JM

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

the cluster slot in survobj has been renamed to '(cluster)' #22

Closed smouksassi closed 3 years ago

smouksassi commented 4 years ago

from the book:

pbc <- pbc2[c("id", "serBilir", "drug", "year", "years",
              "status2", "spiders")]
pbc$start <- pbc$year
 splitID <- split(pbc[c("start", "years")], pbc$id)
pbc$stop <- unlist(lapply(splitID,
                            function (d) c(d$start[-1], d$years[1]) ))
pbc$event <- with(pbc, ave(status2, id,
                             FUN = function (x) c(rep(0, length(x)-1), x[1]) ))

tdCox.pbc <- coxph(Surv(start, stop, event) ~ drug * spiders + cluster(id),
        data = pbc, x = TRUE, model = TRUE)

jointFit8.pbc <- jointModel(lmeFit.pbc, tdCox.pbc, timeVar = "year",
                            method = "spline-PH-aGH")
Error in jointModel(lmeFit.pbc, tdCox.pbc, timeVar = "year", method = "spline-PH-aGH") : 

use argument 'model = TRUE' and cluster() in coxph().

the code test for the cluster slot but it is now (cluster)

drizopoulos commented 3 years ago

Is resolved on GitHub now.

smouksassi commented 3 years ago

thanks you !