我正在使用flexsurvreg
包中的flexsurv
,以便将Gompertz模型与生存数据相匹配。每个参数的一个分类和一个连续协变量的示例如下:
library(survival)
library(flexsurv)
Call:
flexsurvreg(formula = Surv(time, status) ~ sex + shape(ph.ecog),
data = lung, dist = "gompertz")
Estimates:
data mean est L95% U95% se exp(est) L95% U95%
shape NA 0.000659 -0.000210 0.001527 0.000443 NA NA NA
rate NA 0.003355 0.002042 0.005512 0.000850 NA NA NA
sex 1.396476 -0.525441 -0.852719 -0.198163 0.166982 0.591294 0.426254 0.820236
shape(ph.ecog) 0.951542 0.000937 0.000375 0.001498 0.000287 1.000937 1.000375 1.001500
N = 227, Events: 164, Censored: 63
Total time at risk: 69522
Log-likelihood = -1139.932, df = 4
AIC = 2287.864
par$coefficients
shape rate sex shape(ph.ecog)
0.0006588492 -5.6973226550 -0.5254411364 0.0009368314
请注意,摘要中的费率字词与par$coefficients
调用之间的差异是后者显示为前者的自然对数
从小插图 - https://cran.r-project.org/web/packages/flexsurv/flexsurv.pdf - Gompertz Hazard函数定义为 -
Gompertz distribution with shape parameter a and rate parameter b has hazard function H(x: a, b) = b.e^{ax}
我的问题是,如何将协变量应用于形状和速率参数以推导出新的危险函数?
新形状参数是shape_new = shape + ph.ecog_value(between 1-5)*shape(ph.ecog) = 0.0006588492 + (some value between 1 and 5)*0.0009368314
而新费率是rate_new = rate + sex = -5.6973226550 - 0.5254411364
(根据我之前示例中的变量)?
注意 - 这个先前的问题是相关的,但它并不涉及在形状/速率参数中包含协变量 - Gompertz Aging analysis in R