# Estimating the ratio of cell means in ANOVA under lognormal assumption

I am conducting a two-sample test (1-way ANOVA with 2 treatments), and the goal is to estimate the ratio of cell means assuming that the data are lognormal. A simple approach is to log the response and fit a model

$\log Y = b_0 + b_1 * X$

and then estimate the ratio as

$R = e^{b_1}$

However, that gives the ratio of geometric cell means rather than arithmetic cell means.

I assumed that if I fit a "proper" lognormal model using either gamlss in R or PROC GLIMMIX in SAS, I will get the ratio of arithmetic means, but for some reason both procedures generate the same slope as the $\log Y$ regression.

This is odd because when I use this approach with Poisson or Negative Binomial regression, I do get the ratio of arithmetic means. What am I missing?

P.S.

I think I identified the source of confusion, but I don't have an explanation for it. A lognormal setup with the identity link function is:

$\log Y_1 \sim N(b_0, \sigma^2)$

$\log Y_2 \sim N(b_0 + b_1, \sigma^2)$

which implies

$\frac{E[Y_2]}{E[Y_1]} = \frac{e^{b_0 + b_1 +\sigma^2/2}}{e^{b_0 + \sigma^2/2}} = e^{b_1}$

To me, it means that $e^{b_1}$ should have a point estimate equal to the ratio of arithmetic means for the original response.

On the other hand,

$E[\log Y_1] = b_0$

$E[\log Y_2] = b_0 + b_1$

$b_0$ is estimated as arithmetic mean of $\log Y_1$, $b_0 + b_1$ is estimated as arithmetic mean of $\log Y_2$. Hence, $e^{b_1}$ should have a point estimate equal to the ratio of geometric means for the original response, and it does, given the output from those two packages. Where did I make a mistake?

First off, I find hard to understand why you preferred an 1-way ANOVA instead of a t-test, since you did not look for interactions. As a second remark, I would check the assumptions of ANOVA: it might be that the variances of the two samples differ significantly. Eventually, in a linear regression setting with logged dependent variable, your problem might be due to heteroscedastic residuals, like in the following faked example performed in Stata 13.1/SE:

The slight difference between the two ratios of the arithmetic means is due to residuals heteroscedasticity. As a sidelight, the ratio of the geometric means is: exp(1.725205)/exp(1.352162)=1.4521468.

• Thanks. What is the ratio of geometric means in this example? – James Aug 25 '14 at 15:03
• Thanks James for pointing this out. The ratio of the geometric means is now reported at the end of the reply. – Carlo Lazzaro Aug 25 '14 at 15:53
• So the idea is that under the lognormal setup the sigma indeed cancels out in theory, but for a finite sample it doesn't. Even if the data generating process is homoskedastic, the observed variance is not going to be the same among cells unless there is a large number of observations per cell. To back out the observed ratio of arithmetic means from the parameters, one needs to perform manual estimation of cell variances by hand to plug them into the numerator and denominator. – James Aug 25 '14 at 16:28
• That's why, in my opinion, life gets more difficult with log transformation. It seems helpful at the very start, but problems and pitfalls usually come alive in the way back to the original metric (usually the relevant one for the decision-maker). – Carlo Lazzaro Aug 25 '14 at 16:46

$\log Y = b_0 + b_1 X$

When you omit the error term, you lead yourself straight into difficulty that is otherwise easily avoided. Clearly the equation you wrote is false, otherwise you wouldn't need to do estimation. Two $y$ values would be sufficient to estimate two parameters exactly (two equations in two unknowns). You mean something like

$\log Y = b_0 + b_1 X+\varepsilon$

where $\varepsilon\sim N(0,\sigma^2I)$ ... assuming that your $x$-variable is binary. (Not sure why you'd need to write it in this form, though, since there's only two groups.)

However, that gives the ratio of geometric cell means rather than arithmetic cell means.

Under the assumption of constant $\sigma^2$ parameters, the ratio of population means will be identical to the ratio of population medians (or geometric means, since both medians and GMs are $\exp(\mu)$ in the lognormal), since $e^{\mu_1+\sigma^2/2}/e^{\mu_2+\sigma^2/2}=e^{\mu_1}/e^{\mu_2}=e^{\mu_1-\mu_2}$.

As such, you can simply work directly on the log-scale and work with differences of means of logs, and when you exponentiate the result, it's still estimating the ratio of means - in the sense, for example, that an interval can be transformed. (If you want an unbiased estimator, you may need to take a little more effort.)

The exponentiated arithmetic mean of logged values is the geometric mean of the original values. So when you model $\log Y$ and exponentiate, you get back the geometric means.

In other words $E[\log Y | X]$ is the arithmetic mean of $\log Y$, and exponentiating that gives you the geometric mean of $Y$. This carries over to interpretation of coefficients.

However, when using a log link function in a GLM, you are modeling $\log (E[Y|X])$, and exponentiating gives you the arithmetic mean of $Y$

As for practical application via gamlss OR GLIMMIX, make sure you're supplying the correct arguments to model exactly what you want.