r - How to apply time transformation to a factor variable in cph( ) function
问题描述
Hi I'm currently trying to fit a cox regression model but when I run the cox.zph() function, my p value is constantly smaller than 0.05 with the Delay variable being a major issue. It is a binary factor variable (0 or 1) describing whether a patient had early (0) or delayed (1) treatment. So from what I read on how to deal with this issue I tried to apply the tt() function to the Delay variable as such:
cox.death <- cph(Surv(diff, event)~tt(Delay)+rcs(age,3)+female+rcs(hba1c,3)+rcs(bmi,3)+rcs(egfr,3)+rcs(sbp,3),
data=cox.model, x = T, y = T)
But then I get this error message: Error in tt(Delay) : could not find function "tt"
I'm not quite familiar with the rms package but is there any solution to this problem? Thanks!
解决方案
推荐阅读
- java - 具有作为构造函数参数传递的泛型基类的枚举
- python - 不能在里面使用几何管理器包。已经有网格管理的从属,尽管主窗口不同
- maven - Gradle 7 中删除了旧版 `maven` 插件。请改用 `maven-publish` 插件
- ios - 为什么 iOS 拒绝 LetsEncrypt 驱动的证书?
- android - 如何为具有特定子子值的子项检索 Firebase DatabaseReference?
- python - 使用 python,我如何为 macOS 声音播放器 NSSound 构造一个委托?
- javascript - 函数内的基本函数
- javascript - 为什么animejs在svelte-kit骨架项目的构建中抛出这个错误?
- python-3.x - 如何通过其方法获取类对象?,尝试使用 dir() 和 __class__,但它输出
- json - 需要基于类的编程选择创建自定义模式