【发布时间】:2023-03-04 20:42:01
【问题描述】:
我有关于桥梁生存能力的数据:https://pastebin.com/1ryj68Bd。
我是 R 和生存分析的新手,所以这听起来很基础,但我已经创建了 Weibull AFT 模型。我想使用模型来预测一组特定变量值的生存概率。我怎么做?为了给你一些上下文,这里是代码:
weibul1=survival::survreg(survival::Surv(weibul$TIS,weibul$Survival) ~ weibul$ADT + weibul$NumberOfFreezeThawCycles + weibul$ADTT + weibul$NumberOfSnowfalls + weibul$Skew, weights = weibul$Quantity, data = weibul[weibul$Age > 0,], dist = "weibull")
summary(weibul1)
#plotting Weibull AFT; Gamma = 1/weibul1$Scale -- survreg gives log sigma and not sigma as output; Intercept = 1/weibul1$coefficients[1]
plot(weibul$Age,1-pweibull(weibul$Age,1/(weibul1$scale),exp(weibul1$coefficients[1])),xlab = 'Age', ylab='Survival Probability')
我想做的是给定ADT、ADTT、Age等的值,求生存概率。我在 R 中使用 survival 包。所以,我使用 predict 和以下代码:
covariates = list(Age = 26.68, ADT=5267, ADTT=763.37, NumberOfSnowfalls=14.88 , NumberOfFreezeThawCycles=56.34, Skew = 13.39)
predict(weibul1, newdata=covariates, type="quantile", p=(1:98)/100)
plot(predict(weibul1, newdata=covariates,type="quantile",p=seq(.01,.99,by=.01)),seq(.99,.01,by=-.01),col="green")
但是,现在我看到一个错误: xy.coords(x, y, xlabel, ylabel, log) 中的错误: “x”和“y”长度不同
感谢任何想法/建议。
【问题讨论】:
标签: r regression survival-analysis weibull