drizopoulos / JMbayes2

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

calibration_metrics Thoriz argument error #17

Closed harryparr closed 2 years ago

harryparr commented 2 years ago

I appear to get an error message when explicitly specifying both Dt=NULL & Thoriz=as.numeric() arguments in the calibration_metrics function, or even just the Thoriz argument on its own without Dt.

calibration_metrics(JMB2,  newdata = newdata, Tstart=i, Dt=NULL, Thoriz=8)
Error in calibration_plot(object, newdata, Tstart, Dt = Dt, df_ns = df_ns,  : 
  either 'Thoriz' or 'Dt' must be non null.

I think this small bug is made by the missing Thoriz argument in the calibration_plot function. I think explicitly adding this argument to line 408 would solve this issue.

    comps <- calibration_plot(object, newdata, Tstart, Dt = Dt, df_ns = df_ns, Thoriz=Thoriz,
                              plot = FALSE)

Many thanks, Harry

drizopoulos commented 2 years ago

Thanks for reporting this issue. It has been resolved in the current development version on GitHub.