我使用flexsurvreg中的逆威布尔分布拟合了生存模型:
if (require("actuar")){
invweibull <- list(name="invweibull",
pars=c("shape","scale"),
location="scale",
transforms=c(log, log),
inv.transforms=c(exp, exp),
inits=function(t){ c(1, median(t)) })
invweibull <- flexsurvreg(formula = kpnsurv~iaas, data = kpnrs2,
dist=invweibull)
invweibull
}
我得到以下输出:
Call:
flexsurvreg(formula = kpnsurv ~ iaas, data = kpnrs2, dist = invweibull)
Estimates:
data. mean. est L95% U95% se exp(est) L95% U95%
shape NA 0.4870 0.4002 0.5927 0.0488 NA NA NA
scale NA 62.6297 36.6327 107.0758 17.1371 NA NA NA
iaas 0.4470 -0.6764 -1.2138 -0.1391 0.2742 0.5084 0.2971 0.8701
N = 302, Events: 54, Censored: 248
Total time at risk: 4279
Log-likelihood = -286.7507, df = 3
AIC = 579.5015
如何获得协变量估算值的p值(在本例中为iaas)?谢谢您的帮助。
只要万一这仍然对任何人有用,这对我有用。首先从模型中提取系数信息矩阵:
invweibull.res
然后将估计系数除以其标准误差,以计算出具有渐近标准正态分布的Wald统计量:
invweibull.wald
最后,获得p值:
invweibull.p