Hello I am learning about survival analysis and introduced to parametric models with survreg
from the survival
package in R. In this process I was introduced to the idea of different ways to parametrize distributions. I found this topic very confusing so I am trying to wrap my head around it though examples.
Exponential Distribution
set.seed(123)
size <- 1000
deathtime <- rexp(size, rate = 1)
exp.fit <- survreg(Surv(deathtime) ~ 1, dist = "exponential")
exp.fit$icoef #paramter estimates
The intercept of this model is the ln(hazard) or ln($\lambda$) so if I wanted to plot the survival function it would look like this
$ \lambda = exp(intercept)$
$S(t) = exp(-\lambda t)$
I am pretty sure this is correct but correct me if I am wrong.
Weibull Distribution
Now this where things get more confusing for me after this point.
set.seed(123)
size <- 1000
deathtime <- rweibull(size, shape = 3, scale = 2)
wei.fit <- survreg(Surv(deathtime) ~ 1, dist = "weibull")
wei.fit$icoef
The coefficients of the weibull fit are the intercept and log(scale). When I simulated the weibull data I have a shape or $\alpha$ = 3 and scale or $\beta$ = 2. If I wanted to plot the survival function I would need to do this:
$ \beta = exp(intercept)$
$ \alpha = 1/exp(log(scale)) $ I think it is weird that the scale gives the shape parameter
$ S(t) = exp(-(t/\alpha)^\beta) $ Is that correct?
Log-Logistic
This is where I have the limits of my knowledge that I need the most clarification.
loglog.fit <- survreg(Surv(deathtime) ~ 1, dist = "loglogistic")
Fitting the log logistic distribution also provides the intercept and log(scale). If I would like to plot the survival function would this be correct?
$ \beta = exp(intercept) $
$ \alpha = 1/exp(log(scale)) $
$ S(t) = [1 + (t/\alpha)^\beta]^{-1} $ Formula from wiki
Please let me know if my understanding is correct on using the parameters of the survreg
function.