r - JM 的jointModel 使用左截断数据引发错误
问题描述
我收到与时间相关的 cox 模型的以下错误。不确定是什么问题。它既不适用于教科书中的示例,也不适用于我的数据。
关节模型中的错误(lmeFit.pbc,tdCox.pbc,timeVar = "year",method = "spline-PH-aGH"):在 coxph() 中使用参数 'model = TRUE' 和 cluster()。
library("JM")
library("lcmm")
pbc <- pbc2[c("id", "serBilir", "drug", "year", "years",
"status2", "spiders")]
pbc$start <- pbc$year
splitID <- split(pbc[c("start", "years")], pbc$id)
pbc$stop <- unlist(lapply(splitID,
function (d) c(d$start[-1], d$years[1]) ))
pbc$event <- with(pbc, ave(status2, id,
FUN = function (x) c(rep(0, length(x)-1), x[1]) ))
lmeFit.pbc <- lme(log(serBilir) ~ drug * (year + I(year^2)),
random = ~ year + I(year^2) | id, data = pbc2)
tdCox.pbc <- coxph(Surv(start, stop, event) ~ drug * spiders + cluster(id),
data = pbc, x = TRUE, model = TRUE)
jointFit8.pbc <- jointModel(lmeFit.pbc, tdCox.pbc, timeVar = "year",
method = "spline-PH-aGH")
summary(jointFit8.pbc)
解决方案
推荐阅读
- go - 在 golang gin 中显示基于用户的静态图像
- webdatarocks - Webdatarocks 文件大小限制问题
- reactjs - 如何在 TypeScript 文件中接收任何元素作为 ReactChild?
- python - 从证券交易所网站的买卖列中提取信息
- firebase - Flutter Firebase StreamBuilder 列表
> 不是 - > 错误
- c# - 检查 API 数据的条件列表
- python - Python Regex 返回包含双字符的单词
- jestjs - `transformIgnorePatterns` 无法包含一些 node_modules
- python - 将元素附加到 Ragged 张量?
- server - Ghost中的自定义管理员链接导致拒绝连接错误