drizopoulos / JMbayes2

Extended Joint Models for Longitudinal and Survival Data
https://drizopoulos.github.io/JMbayes2/
78 stars 22 forks source link

survival no events in the interval #20

Closed antoine4ucsd closed 2 years ago

antoine4ucsd commented 2 years ago

Hello I am very interested in your package to look at biomarker(s) associated with death. I have a cohort of participants who all died after 50 and 360 days of follow-up. For those,I have ~50 markers with heterogeneity in sampling time. I was able to run your joint model as described in https://drizopoulos.github.io/JMbayes2/articles/Dynamic_Predictions.html but I fail running the survival analyses:

roc <- tvROC(jointFit, newdata = mydata, Tstart = t0, Dt = 60, cores = 1L)

where t0= 300 days (some participants died after 330-360 days) . I tried with multiple t0 and Dt...

error message rror in tvROC.jm(jointFit, newdata = marker_df_wide2, Tstart = t0, Dt = 60, : it seems that there are no events in the interval [Tstart, Thoriz).

I would be happy to share the data via mp if you are interested thank you!

drizopoulos commented 2 years ago

Are there events between 330 and 360 days?

antoine4ucsd commented 2 years ago

yes. I can share the data via mp if it helps see below

thank you!

Screen Shot 2022-03-17 at 1 40 35 PM
drizopoulos commented 2 years ago

And did these subjects also have repeated measurements before 330 days?

antoine4ucsd commented 2 years ago

some do. for example for id1:

image

and id5

image
drizopoulos commented 2 years ago

In the data.frame you provide in the newdata argument, all subjects need to have at least one longitudinal measurement before the Tstart time.

antoine4ucsd commented 2 years ago

still not working... if newdata is ID 5 only

image

and t0=300 I tried roc <- tvROC(jointFit, newdata = marker_df_wide_pid5, Tstart = t0, Dt = 47, cores = 1L) or roc <- tvROC(jointFit, newdata = marker_df_wide_pid5, Tstart = t0, Dt = 347, cores = 1L)

this is probably obvious...sorry

antoine4ucsd commented 2 years ago

I tihnk this mighjt be because all my individuals died so event should be 1 in every cells. I thought it had to be 1 only at the time of event.

I also have this error for survival


ND <- marker_df_wide[marker_df_wide$id %in% c(5,12), ] # I exclude those with < 90 days follow up and only 1 tp after filtering
ND
t0 <- 90 # all selected individuals were alived at day 90

ND <- ND[ND$day < t0, ]
ND
t0
ND$status2 <- 0 # were alive up to this time point
ND$days <- t0
View(ND)
predLong1 <- predict(jointFit, newdata = ND, return_newdata = TRUE)

predLong2 <- predict(jointFit, newdata = ND,
                     times = seq(t0, 346, length.out = 51),
                     return_newdata = TRUE)

predSurv <- predict(jointFit, newdata = ND, process = "event",
+                     times = seq(t0, 346, length.out = 51),
+                     return_newdata = TRUE)

Error in t.default(st0) : argument is not a matrix

N after filering is below id5 was followed until 346 days and id 12 followed until day 247

image

all suggestions and/or alternative approaches are welcome. happy to chat more via mp or call. THANK YOU!

drizopoulos commented 2 years ago

Please arrange your data as in the example in the vignette.

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


From: antoine @.> Sent: Friday, March 18, 2022 1:32:50 AM To: drizopoulos/JMbayes2 @.> Cc: Dimitris Rizopoulos @.>; Comment @.> Subject: Re: [drizopoulos/JMbayes2] survival no events in the interval (Issue #20)

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.

I tihnk this mighjt be because all my individuals died so event should be 1 in every cells. I thought it had to be 1 only at the time of event.

I also have this error for survival

ND <- marker_df_wide[marker_df_wide$id %in% c(5,12), ] # I exclude those with < 90 days follow up and only 1 tp after filtering ND t0 <- 90 # all selected individuals were alived at day 90

ND <- ND[ND$day < t0, ] ND t0 ND$status2 <- 0 # were alive up to this time point ND$days <- t0 View(ND) predLong1 <- predict(jointFit, newdata = ND, return_newdata = TRUE)

predLong2 <- predict(jointFit, newdata = ND, times = seq(t0, 346, length.out = 51), return_newdata = TRUE)

predSurv <- predict(jointFit, newdata = ND, process = "event",

Error in t.default(st0) : argument is not a matrix

N after filering is below id5 was followed until 346 days and id 12 followed until day 247

[image]https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F18502631%2F158915123-1217af02-6f42-4e0f-94b9-5721350db22b.png&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C7798370a66f741e9063b08da0876d68a%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637831603751688218%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=XFTD7w9hZS91Z3%2FBYSdv3tKG0mH9LrQ0mVgtRgBRCbg%3D&reserved=0

all suggestions and/or alternative approaches are welcome. happy to chat more via mp or call. THANK YOU!

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos%2FJMbayes2%2Fissues%2F20%23issuecomment-1071901888&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C7798370a66f741e9063b08da0876d68a%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637831603751688218%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=t41RVhFpkjMg%2BKfSMwSqR5VSFhRQ86ZMAzITDQv7LC4%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TT2MPXD5TUN63JYQQFLVAPFLFANCNFSM5Q7UQJBQ&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C7798370a66f741e9063b08da0876d68a%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637831603751688218%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=6BsOsFZYiwXKueoGvJnOrtUsBFdyP4Yj5q48j9pEGo0%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

antoine4ucsd commented 2 years ago

good news: I was able to make your tutorial to work! thank you for your support.

to summarize: I am investigating the association between longitudinal biomarker data and survival time. We are using your approach for joint modeling. To assess the predictive accuracy of our model, we are following your tutorial / vignette titled “Dynamic Predications.” Under that particular section of the vignette (Predictive accuracy), you use the following command:

tvROC(jointFit, newdata = pbc2, Tstart = t0, Dt = 3)

My understanding of this command is to predict who would die between time t0 and time t0+Dt. In my dataset, all the participants eventually died. Given our setting, we thought a different predictive accuracy metric may be useful (for example, something like the square difference between the expected time of death and actual time). We have begun to look for alternative metrics, but thought I would reach out to see if you have already thought about alternative accuracy metrics; and if so, if those approaches are available through your R package.

thank you!

drizopoulos commented 1 year ago

What is the syntax you used to fit the joint model?

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


From: antoine @.> Sent: Thursday, March 17, 2022 10:32:40 PM To: drizopoulos/JMbayes2 @.> Cc: Dimitris Rizopoulos @.>; Comment @.> Subject: Re: [drizopoulos/JMbayes2] survival no events in the interval (Issue #20)

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.

still not working... if newdata is ID 5 only [image]https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F18502631%2F158898400-5db740ab-15f2-4379-957d-9df7c844a272.png&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Cbdccbe7c85ea4826af1508da085daaf6%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637831495636953841%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=6uAow7NtQi6%2F%2FzLLK2yHtmi6NKD2QetJoNVNbXoARSA%3D&reserved=0

and t0=300 I tried roc <- tvROC(jointFit, newdata = marker_df_wide_pid5, Tstart = t0, Dt = 47, cores = 1L) or roc <- tvROC(jointFit, newdata = marker_df_wide_pid5, Tstart = t0, Dt = 347, cores = 1L)

this is probably obvious...sorry

— Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos%2FJMbayes2%2Fissues%2F20%23issuecomment-1071519335&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Cbdccbe7c85ea4826af1508da085daaf6%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637831495636953841%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=rRJiSh7dijxDKXeRq96l65whbBHsZmHR1xYgA3pD9yA%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TTYDPOJEIBHDLHA3Z3DVAOQHRANCNFSM5Q7UQJBQ&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Cbdccbe7c85ea4826af1508da085daaf6%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637831495636953841%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=4tBQHyArdCoS8k%2FMjfNlsNfJd622WM7WOtOc3xigvfA%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>