我使用library (survival)
和survreg()
将对数正态分布拟合到R中的某些数据集。以下输出显示了截距和对数(比例)。但是,我需要为此分布计算比例参数(σ)和形状参数(m)。是否有公式使用我得到的截距和对数(刻度)值来计算此值?还是有其他方法可以做到这一点?
>summary(model)
Call:
survreg(formula = Surv(times_start, times_end, type = "interval2") ~
1, dist = "lognormal")
Value Std. Error z p
(Intercept) 3.207 0.191 16.78 < 2e-16
Log(scale) 0.442 0.116 3.81 0.00014
Scale= 1.56
Log Normal distribution
Loglik(model)= -224.3 Loglik(intercept only)= -224.3
Number of Newton-Raphson Iterations: 7
n= 102
答案 0 :(得分:1)
使用模拟,我会说Intercept
是µ的估计,而Scale
是σ的估计:
n <- 25000
y <- round(rlnorm(n), 2)
dat <- data.frame(left = y, right =y)
censored <- as.logical(sample.int(2, size=n, replace = TRUE) - 1L)
dat$left[censored] <- NA
dat$right[censored] <- 15
fit <- survreg(Surv(left, right, type = "interval2") ~ 1, data = dat,
dist = "lognormal")
summary(fit)
# (Intercept) -0.00712 0.00876 -0.81 0.42
# Log(scale) -0.00568 0.00599 -0.95 0.34
#
# Scale= 0.994
另一项测试:
n <- 100000
y <- rlnorm(n, meanlog = 2, sdlog = 0.5)
dat <- data.frame(left = y, right =y)
censored <- as.logical(sample.int(2, size=n, replace = TRUE) - 1L)
dat$left[censored] <- NA
dat$right[censored] <- 50
fit <- survreg(Surv(left, right, type = "interval2") ~ 1, data = dat,
dist = "lognormal")
summary(fit)
# (Intercept) 2.00004 0.00223 896 <2e-16
# Log(scale) -0.69321 0.00314 -220 <2e-16
#
# Scale= 0.5
答案 1 :(得分:0)
谢谢。因此,如果我要计算对数正态的幸存函数,那就是
?(x)= 1−Φ(ln(x)/ ?)
这是否意味着我应该能够通过用Scale(1.56)的值替换σ来做到这一点?