置信区间为“ R”生存的Weibull Survreg模型预测的自拟合

时间:2019-07-04 12:25:06

标签: r confidence-interval standard-error weibull survival

我想学习如何从R“ survival”的weibull survreg模型的值和标准误差的预测中获得置信区间。

R doc for predict.survreg的示例显示了一个图,它不仅给出了fit的韦伯Survreg模型预测,而且给出了fit+2*se.fitfit-2*se.fit。那么从fit-2*se.fitfit+2*se.fit的范围对应于什么置信区间?对于给定的置信区间,如何为fit +/- n*se.fit选择 n 以获得该置信区间?以下是代码:

lfit <- survreg(Surv(time, status) ~ ph.ecog, data=lung)
pct <- 1:98/100   # The 100th percentile of predicted survival is at +infinity
ptime <- predict(lfit, newdata=data.frame(ph.ecog=2), type='quantile', p=pct, se=TRUE)
matplot(cbind(ptime$fit, ptime$fit + 2*ptime$se.fit, ptime$fit - 2*ptime$se.fit)/30.5, 1-pct, xlab="Months", ylab="Survival", type='l', lty=c(1,2,2), col=1)

对于正态分布,我认为对于95%的置信区间,可以使用fit +/- 1.96*se.fit。我不确定它是否适用于weibull survreg模型。

0 个答案:

没有答案