从Survreg解释Weibull参数


狗头军师
2025-03-15 08:24:03 (24天前)

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

X=b[-ln(1-rand())]^(1/a)
其中a和b分别是形状和比例参数,X是我想要的失效时间。我的问题是在解释survreg的intercept和协变量参数。我有以下参数,时间单位是天:


  1. 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”生成时间。我还应注意,我自己没有执行分析,也无法进一步查询数据。

2 条回复
  1. 1# v-star*위위 | 2020-08-24 15-35

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

    1. library(survival)
    2. y <- rweibull(1000, shape=2, scale=5)
    3. r <- survreg(Surv(y)~1, dist="weibull")
    4. a <- 1/r$scale # Approximately 2
    5. b <- exp( coef(r) ) # Approximately 5
    6. y2 <- b * ( -ln( 1-runif(1000) ) ) ^(1/a)
    7. y3 <- rweibull(1000, shape=a, scale=5)
    8. # Check graphically that the distributions are the same
    9. plot(sort(y), sort(y2))
    10. abline(0,1)
登录 后才能参与评论