r - 从Survreg解释Weibull参数

标签 r statistics weibull operations-research

我正在尝试使用从R中survreg估计的参数生成逆Weibull分布。这意味着我想针对给定的概率(在MS Excel中实现的小型仿真模型中为随机数)返回使用我的参数的预期故障时间。我理解逆Weibull分布的一般形式为:

X=b[-ln(1-rand())]^(1/a)

其中a和b分别是形状和比例参数,X是我想要的失效时间。我的问题是来自survreg的intercept和协变量参数的解释。我有以下参数,时间单位是天:
             Value   Std. Error    z    p
(Intercept)     7.79    0.2288  34.051  0.000
Group 2        -0.139   0.2335  -0.596  0.551
Log(scale)     0.415    0.0279  14.88   0.000
Scale= 1.51 

Weibull distribution
Loglik(model)= -8356.7   Loglik(intercept only)= -8356.9 
Chisq = 0.37 on 1 degrees of freedom, p= 0.55 
Number of Newton-Raphson Iterations: 4 
n=1682 (3 observations deleted due to missing values)

我已经在帮助文件中阅读到R的系数来自“极值分布”,但是我不确定这的真正含义以及我如何“回到”公式中直接使用的标准比例参数。使用b = 7.79和a = 1.51会给出无意义的答案。我真的希望能够为基础组和“组2”生成时间。我还应注意,我自己没有执行分析,也无法进一步查询数据。

最佳答案

手册页?survreg(在“示例”部分中)对此进行了说明。

library(survival)
y <- rweibull(1000, shape=2, scale=5)
r <- survreg(Surv(y)~1, dist="weibull")
a <- 1/r$scale      # Approximately 2
b <- exp( coef(r) ) # Approximately 5
y2 <- b * ( -ln( 1-runif(1000) ) ) ^(1/a)
y3 <- rweibull(1000, shape=a, scale=5)
# Check graphically that the distributions are the same
plot(sort(y), sort(y2))
abline(0,1)

关于r - 从Survreg解释Weibull参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9113872/

相关文章:

r - KSVM(在 r 中)给出 - 索引错误[[j]] : subscript out of bounds

r - 使用ggbiplot向PCA的变量名添加下标?

r - 您可以在read.table中指定列数吗?

用于深入了解统计树的 JavaScript 控件

r - 使用 curve() 绘制 survreg 的生存和风险函数

r - ESet的子集/划分ESet

c++ - 用二阶二次曲线平滑小数据集

r - 评估线性回归(在微软机器学习中

r - mle 无法估计参数,错误代码为 7

r - 将分布拟合到 R 中的给定频率值