I am testing simulation of the lognormal distribution against the lung dataset, as an example of right-censored data, from the survival package. Goodness-of-fit tests indicate Weibull provides best fit, but please bear with my example as I try getting my arms around the lognormal distribution too.
When I run the code posted at the bottom, I get the values shown in the image below just before the posted code. Which are the correct parameters for the lognormal distribution, if indeed they are shown below? If not, how would I extract or transform those values? The parameters I am looking for are "σ" for shape parameter (SDEV of the log of the distribution), and "μ" for scale parameter (median of the distribution), consistent with the objective explained in the next paragraph.
My objective is to (A) fit a Kaplain-Meier curve against the fitted lung data using those lognormal parameters, (B) run simulations by drawing random samples from a distribution of those lognormal parameters probably using the mvrnorm() function of the MASS package, and (C) layering (B) against (A) in the same plot in order to show the sensitivity of the survival curve to those parameters as done for another distribution in example: How to generate multiple forecast simulation paths for survival analysis?
Code:
library(survival)
Fit lognormal distribution to right-censored survival data
fit <- survreg(Surv(time, status) ~ 1, data = lung, dist = "lognormal")
mu <- fit$coef
sigma <- fit$scale
summary(fit)
mu
sigma
