Skip to contents

Calculate the parameters of a log normal distribution from quantile estimates.

Usage

lnorm_param(p50, p95, p05 = NA)

Arguments

p50

the most likely value, the 0.5 quantile.

p95

the "high" value, the 0.95 quantile.

p05

the "low" value, the 0.05 quantile.

Value

a list including the meanlog and sdlog parameters, as well as the fractional difference between the estimated and actual median (0.5 quantile), mdiff.

Details

If p05 is not provided (the default), use p50 (median) and p95 to calculate meanlog and sdlog. If p05 is provided, use p05 and p95 to calculate the parameters, and also calculate the fractional difference between the estimated median value (0.5 quantile) and the median value calculated from the 0.05 and 0.95 values.

mdiff is set to NA if p05 is not provided.

Examples

lnorm_param(p50 = 1425000, p95 = 20000000)
#> $meanlog
#> [1] 14.16968
#> 
#> $sdlog
#> [1] 1.605955
#> 
#> $mdiff
#> [1] NA
#> 
lnorm_param(p50 = 1425000, p95 = 20000000, p05 = 100000)
#> $meanlog
#> [1] 14.16208
#> 
#> $sdlog
#> [1] 1.610574
#> 
#> $mdiff
#> [1] 0.007627163
#>