jthaman / utterances

0 stars 0 forks source link

post/2021/03/10/bias-corrected-calibration-curve-from-scratch/ #6

Open utterances-bot opened 8 months ago

utterances-bot commented 8 months ago

Bias corrected calibration curve from scratch | Random effect

https://randomeffect.net/post/2021/03/10/bias-corrected-calibration-curve-from-scratch/

yellowbridge commented 8 months ago

This is an excellent explanation! Thanks a lot.

jthaman commented 8 months ago

Thanks!

chaoliu-cl commented 6 months ago

I was doing calibration plot myself and came across your post. Wonderful code and explanation! I was wondering if you know how to make the calibration plot for survival models, especially recurrent event models such as the following one: library(survival) library(rms) fit1 <- coxph(Surv(start, stop, event) ~ transplant + age + year + cluster(id), data= jasa1)

jthaman commented 6 months ago

Thanks Chao! Glad you liked it. I regret that I can't help with the calibration plot for the survival models. I'll put it on my long list of future posts that I want to write.

Recurrent event models are new to me. Do you have an explainer?

chaoliu-cl commented 6 months ago

Hi John, recurrent event models are an extension of survival models that focus on the occurrence of events (e.g., diseases or hospitalizations) that happen repeatedly over time (see https://en.wikipedia.org/wiki/Recurrent_event_analysis). The rms package can handle survival models: set.seed(1) n <- 200 d.time <- rexp(n) x1 <- runif(n) x2 <- factor(sample(c('a', 'b', 'c'), n, TRUE)) f <- cph(Surv(d.time) ~ pol(x1,2) * x2, x=TRUE, y=TRUE, surv=TRUE, time.inc=1.5) cal <- calibrate(f, u=1.5, cmethod='KM', m=50, B=20) But it doesn't seem to work on recurrent event models. So your post made me think if we can do this by hand without using the rms package...