解释 survreg 中的威布尔参数

发布于 2025-01-02 00:03:57 字数 847 浏览 4 评论 0原文

我正在尝试使用从 R 中的 survreg 估计的参数生成逆威布尔分布。我的意思是,对于给定的概率(这将是在 MS Excel 中实现的小型模拟模型中的随机数),返回使用我的参数预计出现故障​​的时间。我理解逆威布尔分布的一般形式是:

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

其中 a 和 b 分别是形状和尺度参数,X 是我想要的失效时间。我的问题在于解释 survreg 的截距和协变量参数。我有这些参数,时间单位是天:

             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 给出了无意义的答案。我真的希望能够为基础组和“第二组”生成一个时间。我还应该指出,我自己没有进行分析,无法进一步询问数据。

I am trying to generate an inverse Weibull distribution using parameters estimated from survreg in R. By this I mean I would like to, for a given probability (which will be a random number in a small simulation model implemented in MS Excel), return the expected time to failure using my parameters. I understand the general form for the inverse Weibull distribution to be:

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

where a and b are shape and scale parameters respectively and X is the time to failure I want. My problem is in the interpretation of the intercept and covariate parameters from survreg. I have these parameters, the unit of time is days:

             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)

I have read in the help files that the coefficients from R are from the "extreme value distribution" but I'm unsure what this really means and how I get 'back to' the standard scale parameter used directly in the formulae. Using b=7.79 and a=1.51 gives nonsensical answers. I really want to be able to generate a time for both the base group and 'Group 2'. I also should note that I did not perform the analysis myself and cannot interrogate the data further.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青丝拂面 2025-01-09 00:03:57

这在手册页 ?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)

This is explained in the manual page, ?survreg (in the "examples" section).

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)
老旧海报 2025-01-09 00:03:57

关键是 rweibull 生成的形状参数是 survreg 输入的形状参数的倒数

The key is that the shape parameter the rweibull generates is the inverse of the shape parameter the survreg inputs

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文