Eva Eva
Eva Eva

Reputation: 31

How can you calculate scale and shape parameters for lognormal distribution in R?

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

Answers (2)

Eva Eva
Eva Eva

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

St&#233;phane Laurent
St&#233;phane Laurent

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

Related Questions