drizopoulos / JMbayes2

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

Errors in tvROC #3

Closed yudeng2015 closed 3 years ago

yudeng2015 commented 3 years ago

Hi I tried to evaluate my model using tvROC, and it shows the following error message.

fit_lme1 <- lme(log(TOTCHL) ~ Time + log(AGE),random = ~ Time | ID_d, data = data.train) fit_lme2 <- mixed_model(SMOKER ~ Time + log(AGE), random = ~ Time | ID_d, data = data.train,family = binomial()) fit_lme3 <- mixed_model(HXDIAB ~ Time + log(AGE), random = ~ Time | ID_d, data = data.train, family = binomial()) fit_lme4 <- lme( log(HDLCHL) ~ Time + log(AGE), random = ~ Time | ID_d, data = data.train ) fit_lme5 <- lme( log(SBP) ~ Time + log(AGE) + I(RXHYP), random = ~ Time | ID_d, data = data.train) fit_cox <- coxph(Surv(LENYASCVD, ASCVD) ~ log(AGE) , data = data.train ) fit_jm_wm <- jm(fit_cox, list(fit_lme1, fit_lme2, fit_lme3, fit_lme4, fit_lme5), time_var = "Time", n_chains = 1L) > tvROC(fit_jm_wm, newdata = data.test, Tstart = 5, Dt = 10, cores = 1L) Time-dependent Sensitivity and Specificity for the Joint Model fit_jm_wm At time: 15 Using information up to time: 5 (422 subjects still at risk) Error in .rowNamesDF<-(x, value = value) : invalid 'row.names' length

> head(data.train ) ID_d LENYASCVD ASCVD AGE Time RXHYP HXDIAB SMOKER TOTCHL HDLCHL SBP 1 4 16.766667 0 46 0.0 0 0 1 206.0013 39.52000 145.3333 2 4 16.766667 0 46 2.8 0 1 1 188.0012 47.00029 149.3333 3 4 16.766667 0 46 6.2 0 1 1 210.0000 40.00000 136.0000 4 7 7.666667 1 61 0.0 0 0 0 179.0011 39.52000 184.0000 5 7 7.666667 1 61 2.7 0 0 0 177.0011 44.00027 162.0000 6 7 7.666667 1 61 7.1 0 0 0 163.0000 36.00000 194.0000

> head(data.test) ID_d LENYASCVD ASCVD AGE Time RXHYP HXDIAB SMOKER TOTCHL HDLCHL SBP 7 23 6.666667 0 63 0.0 0 0 1 172.0011 54.92800 113.3333 8 23 6.666667 0 63 2.7 0 0 1 150.0009 51.00031 106.6667 9 23 6.666667 0 63 6.0 0 0 1 155.0000 75.00000 128.0000 15 37 11.000000 1 62 0.0 1 0 0 158.0010 36.63100 116.0000 16 37 11.000000 1 62 2.7 1 0 1 168.0010 47.00029 136.0000 17 37 11.000000 1 62 5.8 1 0 1 177.0000 57.00000 238.6667

drizopoulos commented 3 years ago

Is this with the current GitHub version?

From: yudeng2015 @.> Sent: Tuesday, May 25, 2021 4:43 PM To: drizopoulos/JMbayes2 @.> Cc: Subscribed @.***> Subject: [drizopoulos/JMbayes2] Errors in tvROC (#3)

Hi I tried to evaluate my model using tvROC, and it shows the following error message.

` fit_lme1 <- lme(log(TOTCHL) ~ Time + log(AGE),random = ~ Time | ID_d, data = data.train) fit_lme2 <- mixed_model(SMOKER ~ Time + log(AGE), random = ~ Time | ID_d, data = data.train,family = binomial()) fit_lme3 <- mixed_model(HXDIAB ~ Time + log(AGE), random = ~ Time | ID_d, data = data.train, family = binomial()) fit_lme4 <- lme( log(HDLCHL) ~ Time + log(AGE), random = ~ Time | ID_d, data = data.train ) fit_lme5 <- lme( log(SBP) ~ Time + log(AGE) + I(RXHYP), random = ~ Time | ID_d, data = data.train) fit_cox <- coxph(Surv(LENYASCVD, ASCVD) ~ log(AGE) , data = data.train ) fit_jm_wm <- jm(fit_cox, list(fit_lme1, fit_lme2, fit_lme3, fit_lme4, fit_lme5), time_var = "Time", n_chains = 1L)

tvROC(fit_jm_wm, newdata = data.test, Tstart = 5, Dt = 10, cores = 1L)Time-dependent Sensitivity and Specificity for the Joint Model fit_jm_wm At time: 15 Using information up to time: 5 (422 subjects still at risk) Error in.rowNamesDF<-`(x, value = value) : invalid 'row.names' length

head(data.train ) ID_d LENYASCVD ASCVD AGE Time RXHYP HXDIAB SMOKER TOTCHL HDLCHL SBP 1 4 16.766667 0 46 0.0 0 0 1 206.0013 39.52000 145.3333 2 4 16.766667 0 46 2.8 0 1 1 188.0012 47.00029 149.3333 3 4 16.766667 0 46 6.2 0 1 1 210.0000 40.00000 136.0000 4 7 7.666667 1 61 0.0 0 0 0 179.0011 39.52000 184.0000 5 7 7.666667 1 61 2.7 0 0 0 177.0011 44.00027 162.0000 6 7 7.666667 1 61 7.1 0 0 0 163.0000 36.00000 194.0000

head(data.test) ID_d LENYASCVD ASCVD AGE Time RXHYP HXDIAB SMOKER TOTCHL HDLCHL SBP 7 23 6.666667 0 63 0.0 0 0 1 172.0011 54.92800 113.3333 8 23 6.666667 0 63 2.7 0 0 1 150.0009 51.00031 106.6667 9 23 6.666667 0 63 6.0 0 0 1 155.0000 75.00000 128.0000 15 37 11.000000 1 62 0.0 1 0 0 158.0010 36.63100 116.0000 16 37 11.000000 1 62 2.7 1 0 1 168.0010 47.00029 136.0000 17 37 11.000000 1 62 5.8 1 0 1 177.0000 57.00000 238.6667

- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos%2FJMbayes2%2Fissues%2F3&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Ccd029a02b3bf41783ea808d91f8b640c%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637575505806102842%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=FimFfzRnpDnNLtyv26eFHkh7wHawmvjKoadEL8M0j9Y%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TT4F77G4KMHLS277TN3TPOZPDANCNFSM45PQ4TQQ&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7Ccd029a02b3bf41783ea808d91f8b640c%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637575505806102842%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=sE6wxZL3PzuxAuRX32CYRJbN%2BkBkyiNerF%2FZzZPauKs%3D&reserved=0.

yudeng2015 commented 3 years ago

Thanks for your quick response! I am using the version: JMbayes2_0.1-6

drizopoulos commented 3 years ago

Could you update to the most recent version from GitHub

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


From: yudeng2015 @.> Sent: Tuesday, May 25, 2021 6:02:51 PM To: drizopoulos/JMbayes2 @.> Cc: D. Rizopoulos @.>; Comment @.> Subject: Re: [drizopoulos/JMbayes2] Errors in tvROC (#3)

Thanks for your quick response! I am using the version: JMbayes2_0.1-6

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdrizopoulos%2FJMbayes2%2Fissues%2F3%23issuecomment-847997156&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C7203f44efd6949889f3c08d91f968d9e%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637575553740888476%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=nHeP%2B5qMyh4y3ZD4Dl%2F6DMt%2BduPiu6x121reSTt6y7g%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADE7TT7HLWS2ZHYMRYHCZV3TPPC2XANCNFSM45PQ4TQQ&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C7203f44efd6949889f3c08d91f968d9e%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C0%7C637575553740888476%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=inrr7oypV25BUJ6BjlAdKACuYuM5vy0A56ptT9056qg%3D&reserved=0.

drizopoulos commented 3 years ago

Also, check if the model has successfully converged (i.e., the Rhat values for the coefficients need to be smaller than 1.1).