JMbayes2 icon indicating copy to clipboard operation
JMbayes2 copied to clipboard

question: interval censored outcomes?

Open bcjaeger opened this issue 1 year ago • 8 comments

Hi @drizopoulos!

This software is incredible. Thank you for developing it. JMbayes allows users to pass models for interval-censored outcomes fit with survreg into the joint model fitting function. Does JMbayes2 allow this? I apologize if this is stated in the documentation somewhere and I missed it.

bcjaeger avatar Jul 08 '22 12:07 bcjaeger

Yes, JMbayes2 allows for interval censoring.

—— Professor of Biostatistics Erasmus Medical Center Rotterdam The Netherlands


Από: Byron @.> Στάλθηκε: Friday, July 8, 2022 2:22:53 PM Προς: drizopoulos/JMbayes2 @.> Κοιν.: Dimitris Rizopoulos @.>; Mention @.> Θέμα: [drizopoulos/JMbayes2] question: interval censored outcomes? (Issue #27)

Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is. Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Hi @drizopouloshttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos&data=05%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Cdf042403b324462bb6a908da60dc95d2%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637928797762994621%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ex8zGzOmEzKO0p%2FvpaSDO5EotgoMZbQy63jYdfy8BMU%3D&reserved=0!

This software is incredible. Thank you for developing it. JMbayes allows users to pass models for interval-censored outcomes fit with survreg into the joint model fitting function. Does JMbayes2 allow this? I apologize if this is stated in the documentation somewhere and I missed it.

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos%2FJMbayes2%2Fissues%2F27&data=05%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Cdf042403b324462bb6a908da60dc95d2%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637928797762994621%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=cISCQ1i5VhTCkvjgXDt0wyymBU%2FbzFmjZIrvVGbAgYg%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TT5WISQRTZE7EGEKFR3VTAMR3ANCNFSM53A2I6PA&data=05%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Cdf042403b324462bb6a908da60dc95d2%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637928797762994621%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GABCA%2BUkICKRm%2B47dTaAabSqQ91QT0AVEWP%2FkRq0EyA%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

drizopoulos avatar Jul 08 '22 16:07 drizopoulos

Great! Are there any examples or vignettes with code for this?

bcjaeger avatar Jul 08 '22 18:07 bcjaeger

Unfortunately, not yet.

—— Dimitris Rizopoulos Professor of Biostatistics Erasmus University Medical Center The Netherlands


From: Byron @.> Sent: Friday, July 8, 2022 8:39:35 PM To: drizopoulos/JMbayes2 @.> Cc: Dimitris Rizopoulos @.>; Mention @.> Subject: Re: [drizopoulos/JMbayes2] question: interval censored outcomes? (Issue #27)

Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is. Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Great! Are there any examples or vignettes with code for this?

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos%2FJMbayes2%2Fissues%2F27%23issuecomment-1179266266&data=05%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C43e575e0862847a89eef08da611135b3%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637929023796802969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Jgfp5fVzWwAq5R%2FAezkkQdauMpxFqFofBlENkD%2FteMU%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TTZZMAQEWV7AKVZH6YDVTBYWPANCNFSM53A2I6PA&data=05%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C43e575e0862847a89eef08da611135b3%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637929023796802969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=no69nuhk%2BF4KVkIJ4RPkum7Xo1j7j3JRAdTYrliiWHg%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

drizopoulos avatar Jul 08 '22 19:07 drizopoulos

No problem. Thank you for checking! I have a reprex below where I am trying to get an interval-censored model to run with jm, but an error seems to occur during the cpp routine. Can you review this and let me know if there is a modification I can make to get the interval-censored model right?

library(JMbayes2)
#> Loading required package: survival
#> Loading required package: nlme
#> Loading required package: GLMMadaptive
#> Loading required package: splines
library(tidyverse)

pbc2_id_intervals <- pbc2.id %>% 
 transmute(
  id, 
  years,
  status2,
  drug,
  # pretend death was interval censored
  t1 = years,
  t2 = if_else(status2 == 1, years + abs(rnorm(n())), Inf),
 )

# coxph fit
fit_surv_coxph <- coxph(Surv(years, status2) ~ drug, 
                        data = pbc2_id_intervals)

# interval censoring fit
fit_surv_intervals <- survreg(
 formula =  Surv(t1, t2, type = "interval2") ~ drug,
 data = pbc2_id_intervals,
 model = TRUE
)

# longitudinal model for bili
fit_lme <- lme(fixed = log(serBilir) ~ year * sex + I(year^2) +
                age + prothrombin, random =  ~ year | id, data = pbc2)

joint_model_fit_coxph <- jm(Surv_object = fit_surv_coxph, 
                            Mixed_objects = fit_lme, 
                            time_var = "year",
                            n_chains = 1L, 
                            n_iter = 11000L, 
                            n_burnin = 1000L)

joint_model_fit_intervals <- jm(Surv_object = fit_surv_intervals, 
                                Mixed_objects = fit_lme, 
                                time_var = "year",
                                n_chains = 1L, 
                                n_iter = 11000L, 
                                n_burnin = 1000L)
#> Error in checkForRemoteErrors(val): one node produced an error: matrix multiplication: incompatible matrix dimensions: 4680x1 and 2x1

Created on 2022-07-08 by the reprex package (v2.0.1)

bcjaeger avatar Jul 08 '22 19:07 bcjaeger

Hi @drizopoulos, I apologize for rushing a response, but do you have any recommendations based on the example above?

bcjaeger avatar Aug 19 '22 13:08 bcjaeger

Sorry, I didn't have the time to look into this yet.

drizopoulos avatar Aug 19 '22 15:08 drizopoulos

Hi, @bcjaeger. I met a very similar problem today while running the joint model. Did you solve your problem? Thanks!

Minana05 avatar Aug 25 '22 00:08 Minana05

Hi! I don't know if there is a solution for JMbayes2 yet. If you are in a hurry, you may be able to fit your interval-censored models using JMbayes.

bcjaeger avatar Aug 25 '22 00:08 bcjaeger