norm2lnorm: Convert normal distribution parameters to corresponding...

norm2lnormR Documentation

Convert normal distribution parameters to corresponding log-normal distribution parameters

Description

Converts mean and variance of normal distribution to the parameters for a log-normal distribution with the same mean and variance

Usage

norm2lnorm(m, v)

Arguments

m

Mean of the normal distribution

v

Variance of the normal distribution

Value

A vector of length two. The first element is the mean and the second element is the variance of the log-normal distribution

Examples


norm <- rnorm(1000, mean=5, sd=2)
params <- norm2lnorm(5, 2^2)
lnorm <- rlnorm(1000, meanlog=params[1], sdlog=params[2]^0.5)

# Mean and SD of lnorm is equivalent to mean and sd of norm
mean(lnorm)
sd(lnorm)


MBNMAdose documentation built on Aug. 8, 2023, 5:11 p.m.