library(mets)
data(bmt); bmt$time <- bmt$time+runif(408)*0.001
rmst30 <- rmstIPCW(Event(time,cause!=0)~platelet+tcell+age,bmt,time=30,cause=1)
rmst301 <- rmstIPCW(Event(time,cause)~platelet+tcell+age,bmt,time=30,cause=1)
rmst302 <- rmstIPCW(Event(time,cause)~platelet+tcell+age,bmt,time=30,cause=2)
estimate(rmst30)
estimate(rmst301)
estimate(rmst302)
## percentage of total cumulative incidence due to cause 1
rmstratioI <- rmstRatio(Event(time,cause)~platelet+tcell+age,bmt,time=30,
cause=1,outcome="rmst")
summary(rmstratioI)
pp <- predict(rmstratioI,bmt)
ppb <- cbind(pp,bmt)
## percentage of total cumulative incidence due to cause 1
cifratio <- binregRatio(Event(time,cause)~platelet+tcell+age,bmt,time=30,cause=1)
summary(cifratio)
pp <- predict(cifratio,bmt)
rmstratioI <- binregRatio(Event(time,cause)~platelet+tcell+age,bmt,
time=30,cause=1,outcome="rmst")
summary(rmstratioI)
pp <- predict(rmstratioI,bmt)
ppb <- cbind(pp,bmt)
Run the code above in your browser using DataLab