Learn R Programming

MBNMAdose (version 0.4.3)

norm2lnorm: 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)

Value

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

Arguments

m

Mean of the normal distribution

v

Variance of the normal distribution

Examples

Run this code

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)

Run the code above in your browser using DataLab