From 10c8332bedf3cc8b956ef793d272d2713053fa3e Mon Sep 17 00:00:00 2001 From: Dimitris Rizopoulos Date: Fri, 27 Oct 2023 10:20:36 +0200 Subject: [PATCH] updates --- DESCRIPTION | 4 ++-- Development/jm/test_jm.R | 11 +++++++++++ R/jm.R | 1 + man/JMbayes2.Rd | 4 ++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9a58a11..1a0c324 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: JMbayes2 Type: Package Title: Extended Joint Models for Longitudinal and Time-to-Event Data -Version: 0.4-6 +Version: 0.4-7 Authors@R: c(person("Dimitris", "Rizopoulos", email = "d.rizopoulos@erasmusmc.nl", role = c("aut", "cre"), comment = c(ORCID = '0000-0001-9397-0900')), person("Grigorios", "Papageorgiou", email = "g.papageorgiou@erasmusmc.nl", @@ -9,7 +9,7 @@ Authors@R: c(person("Dimitris", "Rizopoulos", email = "d.rizopoulos@erasmusmc.nl person("Pedro", "Miranda Afonso", email = "p.mirandaafonso@erasmusmc.nl", role = "aut")) Maintainer: Dimitris Rizopoulos -Date: 2023-09-10 +Date: 2023-10-27 BugReports: https://github.com/drizopoulos/JMbayes2/issues Description: Fit joint models for longitudinal and time-to-event data under the Bayesian approach. Multiple longitudinal outcomes of mixed type (continuous/categorical) and multiple event times (competing risks and multi-state processes) are accommodated. Rizopoulos (2012, ISBN:9781439872864). Suggests: lattice, knitr, rmarkdown, pkgdown diff --git a/Development/jm/test_jm.R b/Development/jm/test_jm.R index edf42c8..a9825cf 100644 --- a/Development/jm/test_jm.R +++ b/Development/jm/test_jm.R @@ -330,5 +330,16 @@ length(jm2$mcmc$bs_gammas) length(jm3$mcmc$bs_gammas) +############################################################################## + +data("pbc2", "pbc2.id", package = "JMbayes2") +pbc2$id_char <- as.character(pbc2$id) +pbc2$id_num <- as.numeric(pbc2$id_char) +# pbc2[1:100, c("id", "id_char", "id_num")] +# lapply(pbc2[, c("id", "id_char", "id_num")], summary) + +pbc2.id$id_char <- as.character(pbc2.id$id) +pbc2.id$id_num <- as.numeric(pbc2.id$id_char) + diff --git a/R/jm.R b/R/jm.R index f600f7f..0ad1a37 100644 --- a/R/jm.R +++ b/R/jm.R @@ -65,6 +65,7 @@ jm <- function (Surv_object, Mixed_objects, time_var, recurrent = FALSE, } idVar <- id_names[1L] idL <- dataL[[idVar]] + idL <- factor(idL, levels = unique(idL)) nY <- length(unique(idL)) # order data by idL and time_var if (is.null(dataL[[time_var]])) { diff --git a/man/JMbayes2.Rd b/man/JMbayes2.Rd index 2e18d1c..41f1dfd 100644 --- a/man/JMbayes2.Rd +++ b/man/JMbayes2.Rd @@ -15,8 +15,8 @@ Fit joint models for longitudinal and time-to-event data under the Bayesian appr \tabular{ll}{ Package: \tab JMbayes2\cr Type: \tab Package\cr -Version: \tab 0.4-5\cr -Date: \tab 2023-06-23\cr +Version: \tab 0.4-7\cr +Date: \tab 2023-10-27\cr License: \tab GPL (>=3)\cr }