简体   繁体   English

在r中拟合时变cox模型

[英]Fitting time varying cox model in r

Please, I have been having some challenges trying to fit a time varying cox model. 拜托,我一直在尝试适应时变的考克斯模型。 Precisely I find it hard getting the same result after following examples I read about in which the survSplit command was used. 确切地说,在我阅读了使用了survSplit命令的示例后,我发现很难得到相同的结果。 I end up with one error or the other, here is an example and the error message. 我最终得到一个错误或另一个错误,这是一个示例和错误消息。

hip2=survSplit(Surv(Time,status)~Operation.Performed,
           data=hip,cut=c(200,500,1000,1600),
           end='Time',event='status',start="start")

Error in survSplit(Surv(Time, status) ~ Operation.Performed, data = hip,  : 
start time must be < stop time

Note: My data set initially has no column labelled start. 注意:我的数据集最初没有标记为start的列。 But I read it will be created by the command, I do not know if this is right? 但是我看到它会被命令创建,我不知道这是不对的?

Please, is there anything am not doing correctly to get the right result??? 拜托,有什么东西没能正确地得到正确的结果??? or better still is there a better way to implement the survSplit command? 或者更好的是有更好的方法来实现survSplit命令?

It's hard to say without seeing your data head(hip) , but the error message states that you have the start and end times confused - you can see the message in the code in github here . 很难没有看到你的数据说head(hip) ,但该错误消息指出您具有混淆的开始和结束时间-你可以在github上看到消息中的代码在这里 survSplit Indeed creates a start time if you don't have one and calls it "tstart" by default. 如果没有,则确实会创建一个开始时间,默认情况下将其survSplit"tstart" Unless you use an old version of the package, don't use the event And start Arguments as they are deprecated and for legacy use alone. 除非您使用旧版本的软件包,否则请不要使用eventstart参数,因为它们已被弃用,仅供传统使用。 Give a name to the episode for use in the co ph model as an interaction, and you should be OK. episode命名以在合作模型中用作交互,你应该没问题

hip2 <- survSplit(Surv(Time, status) ~., data=hip, cut=c(200,500,1000,1600),episode="tgroup")

model.coxph <- coxph(Surv(tstart, Time, status) ~ Operation.Performed:strata(tgroup), data=hip2)

And that should do it. 这应该做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 R中的Cox比例风险模型和时间相关的Cox模型 - Cox proportional hazard model and time dependent Cox model in R 如何用时变系数从考克斯生存模型做预测 - how to do predictions from cox survival model with time varying coefficients R中时变Covariate Cox比例风险模型的数据格式 - Data Formatting for Time Varying Covariate Cox Proportional Hazards Modeling in R 使用R中随时间变化的协变量拟合完全参数比例风险模型 - Fitting a fully parametric proportional hazard model with time-varying covariates in R 在 R 中:FME/deSolve - SIR 拟合(时变参数) - In R: FME/ deSolve - SIR fitting (time varying parameters) R : 在 RandomForestSRC 中拟合具有时变协变量的生存树 - R :Fitting survival trees with time-varying covariates in RandomForestSRC 在cox模型中拟合受限三次样条曲线 - Fitting restricted cubic splines in a cox model 如何预测R中Cox回归模型的生存时间? - How to predict survival time in Cox's Regression Model in R? R 使用 survSplit 重塑/扩展数据集以获得 cox 回归的时变变量 - R reshaping / expanding dataset using survSplit to obtain time-varying variable for cox regression 使用 R 包“survival”和“rms”校准 Cox PH 模型:时间单位混淆 - Calibrating a Cox PH model with R packages 'survival' and 'rms': time unit confusion
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM