I'm trying to write out the log hazard function of the lognormal distribution and use this in R.
Using the survival function:
and the hazard function:
I have the following for the log(hazard):
log(hazard) = $-\log(2\pi)/2-\log(\sigma)-\log(t) - ((\log(t)-\mu)^2)/(2\sigma^2) - \log(1-\phi((\log(t)-\mu)/\sigma))$
In R I think this should be:
log(hazard) = -0.5*log(2*pi)-log(sigma)-log(t) -
((log(t)-mu)^2)/(2*sigma^2) -
log(1-pnorm(log(t),mu,sigma))
Can anyone confirm whether this is the correct syntax to use?
Thanks in advance.