MLR - Survival analysis with time-dependent data

独自空忆成欢 提交于 2019-12-24 14:35:05

问题


I am using mlr and would like to be able to use the extended version of the Cox PH model for right-censored, time dependent covariates. This is what I have tried, following the vignette on time-dependent covariates https://cran.microsoft.com/web/packages/survival/vignettes/timedep.pdf (section 3.4):

library(survival)
library(mlr)
data(pbc)

temp <- subset(pbc, id <= 312, select=c(id:sex, stage)) # baseline
pbc2 <- tmerge(temp, temp, id=id, death = event(time, status)) #set range
pbc2 <- tmerge(pbc2, pbcseq, id=id, ascites = tdc(day, ascites),
               bili = tdc(day, bili), albumin = tdc(day, albumin),
               protime = tdc(day, protime), alk.phos = tdc(day, alk.phos))

pbc.task <- makeSurvTask(data = pbc2, target = c("tstart", "tstop", "status"))
cox.lrn <- makeLearner(cl="surv.coxph", predict.type="response")
mod = train(cox.lrn, pbc.task)

When I create the task I get the following error message:

Error in makeSurvTask(data = pbc2, target = c("tstart", "tstop", "status")) : 
  Assertion on 'target' failed: Must have length 2, but has length 3.

So obviously I cannot pass both tstart and tstop to makeSurvTask. Is there any way to use time-dependent variables with the cox model in mlr?

The mlr tutorial indicates that using interval censored data is possible:

Survival tasks use two target columns. For left and right censored problems
these consist of the survival time and a binary event indicator. For interval
censored data the two target columns must be specified in the "interval2"
format (see survival::Surv()).

Is it possible to use the interval2 format for time-dependent data? If so, how would this be done?

来源:https://stackoverflow.com/questions/54357172/mlr-survival-analysis-with-time-dependent-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!