R:生存分析广义Gamma参数拟合置信区间计算

时间:2018-12-04 17:37:04

标签: r survival-analysis

我正在尝试通过flexsurv软件包将通用伽玛参数函数拟合到生存曲线上(限制均值t = 365):

library(dplyr)
library(ggplot2)
library(survival)
library(survminer)
library(survRM2)
library(flexsurv)

DD = c(1:365)
CNSR = rbinom(365, 1, 0.5)
data = as.data.frame(cbind(DD,CNSR))

data$SurvObj <- with(data, Surv(DD, CNSR == 0))
res.ggamma <- tryCatch(flexsurvreg(SurvObj ~ 1, data=data, dist="gengamma"), error = function(e) NA)

然后我尝试找到限制均值以及上下置信区间:

mean.predicted <- round(rmst_gengamma(365, mu = res.ggamma$res[1, 1], sigma = res.ggamma$res[2, 1], Q = res.ggamma$res[3, 1], start = 0)*12/365, 1)
mean.l95 <- round(rmst_gengamma(365, mu = res.ggamma$res[1, 2], sigma = res.ggamma$res[2, 2], Q = res.ggamma$res[3, 1], start = 0)*12/365, 1)
mean.u95 <- round(rmst_gengamma(365, mu = res.ggamma$res[1, 3], sigma = res.ggamma$res[2, 3], Q = res.ggamma$res[3, 1],  start = 0)*12/365, 1)
summary <- paste(mean.predicted, " (", mean.l95, " - ", mean.u95, ")", sep = "")

对于具有某些数据集的某些摘要输出,我得到一些正常的外观,如下所示:

7.5 (6.3 - 8.2)

但是一些关于置信区间的输出看起来确实很古怪:

7.7 (9.9 - 2.8) [this one I get from the randomly generated dataset in the code above]

我想知道这是怎么回事?它与shape参数有关吗?其他任何参数拟合函数(exp,gompertz等)都不会发生这种情况。当我查看生存曲线原始数据时,它看起来不错(所有下限和上限点均包含平均值)。

0 个答案:

没有答案