# [R] Exact 95% CI around the mean for LogNormal distribution

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Wed Mar 16 23:44:04 CET 2022

```This is largely a statistics question, so somewhat off topic here (see
the posting guide linked below). Ergo the lack of a response yet.

Therefore you *might* do better posting on the r-sig-ecology list.

And now for a couple of statistics comments, which you are free to
ignore of course, and which you may already be well aware of. Assuming
the rv X is approximately lognormally distributed means that log(x) is
~ normally distributed which means that a (symmetric) CI for the mean
of the log(X) (=: meanlog of X) is also approximately a CI for the
median of log(X). Hence the back transform (exp()) of the meanlog CI
is an approx CI for the **median** of the lognormal distribution. The
median of a lognormal is **not** the same as the mean, but it
generally makes more sense, as the mean of a skew distribution like
the lognormal has no clear interpretation, while the median (or any
quantile) still does.

Your mileage may vary, of course.

Cheers,
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Wed, Mar 16, 2022 at 1:10 PM varin sacha via R-help
<r-help using r-project.org> wrote:
>
> Dear R-experts,
>
> I have used the EnvStats package and the elnorm function (p. 248).
> I would like to calculate the exact 95% confidence intervals around the mean, not around the meanlog.
> Here below my R code, how can I get the exact 95% CIs around the mean ?
> Many thanks.
>
>
> library(EnvStats)
> x=rlnorm(100000,0,1)
> mean(x)
> elnorm(x,method="mvue",ci=TRUE,ci.type="two-sided",ci.method="exact",conf.level=0.95)
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

```