library(survival)
library(data.table)
set.seed(10)
d <- sampleData(40, outcome = "survival")[,.(eventtime,event,X1,X6)]
setkey(d, eventtime)
m.cox <- coxph(Surv(eventtime, event) ~ X1+X6, data = d, y = TRUE, x = TRUE)
system.time(IC.cox <- iidCox(m.cox))
IC.cox <- iidCox(m.cox, tauHazard = sort(unique(c(7,d$eventtime))))
Run the code above in your browser using DataLab