我在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)?谢谢你的帮助。
答案 0 :(得分:1)
以防万一这仍然对任何人有用,这对我有用。首先从模型中提取系数信息矩阵:
invweibull.res <- invweibull$res
然后将估计的系数除以它们的标准误差,以计算具有渐近标准正态分布的Wald统计量:
invweibull.wald <- invweibull.res[,1]/invweibull.res[,4]
最后,获取p值:
invweibull.p <- 2*pnorm(-abs(invweibull.wald))