Reputation: 31
I have fitted lognormal distribution to some dataset in R using library (survival)
and survreg()
. The output below is showing me both intercept and log (scale). However, I need to calculate the scale parameter (ฯ) and shape parameter (m) for this distribution. Is there a formula to calculate this using the values I got for intercept and log (scale) or is there any other way to do this?
>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
Upvotes: 3
Views: 1579
Reputation: 31
Thanks. So if I want to calculate the survivor function for lognormal, which is
๐(x)= 1โฮฆ(ln(x)/๐)
Does this mean that I should be able to do it by substituting ฯ with the value I got for Scale (1.56)?
Upvotes: 0
Reputation: 84529
Using simulations I would say that Intercept
is the estimate of ยต and Scale
is the estimate of ฯ:
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
Another test:
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
Upvotes: 1