Functions to convert parameters of a log-normal distribution to meaningfull values on the response scale.
Source:R/lnorm_converter.R
lnorm_mean.Rd
Functions to convert parameters of a log-normal distribution to meaningfull values on the response scale.
Usage
lnorm_mean(meanlog, sdlog, ...)
lnorm_median(meanlog, ...)
lnorm_var(meanlog, sdlog, ...)
lnorm_sd(meanlog, sdlog, ...)
Arguments
- meanlog, sdlog
mean and standard deviation of the distribution on the log scale with default values of
0
and1
respectively.- ...
Not used
Examples
x <- rlnorm(1e4, meanlog = 1.5, sdlog = 1.2)
m <- lm(log(x) ~ 1)
meanlog <- coef(m)
sdlog <- sigma(m)
lnorm_mean(meanlog, sdlog)
#> [1] 9.179592
mean(x)
#> [1] 9.188247
lnorm_median(meanlog, sdlog)
#> [1] 4.399393
median(x)
#> [1] 4.432723
lnorm_sd(meanlog, sdlog)
#> [1] 16.81076
sd(x)
#> [1] 16.38653