Learn R Programming

bayescount (version 0.9.9-1)

lnormal.params: Calculate the Log-Normal Mean and Standard Deviation Using the Normal Mean and Standard Deviation

Description

Function to calculate the equivalent values for the mean and standard deviation of a log-normal distribution from the mean and standard deviation of the normal distribution. Outputs from this function can be used with the dlnorm() function, and with the lognormal distribution in JAGS.

Usage

lnormal.params(mean, sd, coeff.variation)

Arguments

Value

A list with elements representing the mean of the lognormal distribution, the standard deviation of the lognormal distribution, and the coefficient of variation.

See Also

bayescount, normal.params

Examples

Run this code
mean <- 10
sd <- 2
lmean <- lnormal.params(mean,sd)[[1]]
lsd <- lnormal.params(mean,sd)[[2]]

curve(dnorm(x, mean, sd), from=0, to=20)
dev.new()
curve(dlnorm(x, lmean, lsd), from=0, to=20)

Run the code above in your browser using DataLab