Why Retransformation Needs Care
In a pharmacometric model, the structural prediction is often a concentration or another positive quantity. Under lognormal residual error, observed values fluctuate multiplicatively around that prediction. Taking logarithms makes the residual error normally distributed, but exponentiating a prediction on the log scale does not generally return the arithmetic mean on the original scale. The difference matters whenever the target is an average concentration, rather than a typical or median observation.
The results below are conditional on the subject-specific model prediction. They describe residual variability while holding the subject’s random effects and the design conditions fixed; they do not, by themselves, average over between-subject variability.
Model and Assumptions
This model assumes a positive prediction and positive, continuous observations; a normally distributed log residual with mean zero and variance \(\sigma^2\); and a residual distribution that is appropriate conditional on the model prediction and random effects. The moment calculations at a single observation require the stated conditional distribution; assuming residuals are independent across observations is an additional assumption used when modelling a sequence of observations. With a nonzero log-residual mean, the formulas change: the median is multiplied by the exponential of that mean. The centered form above is the standard specification considered here.
The parameter \(\sigma\) is measured in log units. It is not the standard deviation of \(Y_{ij}\), which has the same units as the observation. Because the same log-scale variance applies across predictions, the model represents multiplicative variability: larger predictions have larger original-scale standard deviations.
Deriving the Conditional Median, Mean, and Variance
Write \(Z_{ij}=\log(Y_{ij})\). Conditional on \(F_{ij}\), \(Z_{ij}\) is normal with mean \(\log(F_{ij})\) and variance \(\sigma^2\). Since exponentiation is strictly increasing, the median of \(Y_{ij}\) is the exponential of the median of \(Z_{ij}\). A normal distribution’s median equals its mean, so the conditional median is \(F_{ij}\).
For the arithmetic mean, use the moment-generating function of a normal random variable: if \(\epsilon\sim N(0,\sigma^2)\), then \(E[\exp(t\epsilon)]=\exp(t^2\sigma^2/2)\). Setting \(t=1\) gives the conditional mean. Setting \(t=2\) gives the second moment, from which the variance follows.
Because \(Y_{ij}=F_{ij}\exp(\epsilon_{ij})\) is an increasing transformation of \(\epsilon_{ij}\), and the median of the centered normal residual is zero, \(\operatorname{Median}(Y_{ij}\mid F_{ij})=F_{ij}\exp(0)=F_{ij}\).
\(E[Y_{ij}\mid F_{ij}]=F_{ij}E[\exp(\epsilon_{ij})]=F_{ij}\exp(\sigma^2/2)\).
\(E[Y_{ij}^2\mid F_{ij}]=F_{ij}^2E[\exp(2\epsilon_{ij})]=F_{ij}^2\exp(2\sigma^2)\). Subtracting the squared mean gives \(\operatorname{Var}(Y_{ij}\mid F_{ij})=F_{ij}^2\{\exp(2\sigma^2)-\exp(\sigma^2)\}=F_{ij}^2\exp(\sigma^2)\{\exp(\sigma^2)-1\}\).
The variance also shows why this distribution is right-skewed: observations cannot fall below zero, but the exponential transformation allows relatively large values. The conditional coefficient of variation is \(\sqrt{\exp(\sigma^2)-1}\), which is constant across \(F_{ij}\) under this model. This follows by dividing the conditional standard deviation by the conditional mean; both contain the factor \(F_{ij}\).
Worked Example: Conditional Moments at a Given Prediction
Suppose a hypothetical subject-specific prediction is \(F_{ij}=12\) mg/L and the log-residual standard deviation is \(\sigma=0.20\), so \(\sigma^2=0.04\). Find the conditional median, mean, and variance of the observation.
The median is the prediction itself: \(12\) mg/L. The mean is \(12\exp(0.04/2)=12\exp(0.02)=12(1.0202)=12.24\) mg/L.
The variance is \(12^2\exp(0.04)\{\exp(0.04)-1\}=144(1.0408)(0.04081)=6.117\) (mg/L)\(^2\). The conditional standard deviation is therefore \(\sqrt{6.117}=2.473\) mg/L. The mean is above the median even though the log residual is centered at zero.
Retransformation Bias
Suppose a model fitted on the log scale estimates \(m_{ij}=E[\log(Y_{ij})\mid F_{ij}]\). Under the model above, \(m_{ij}=\log(F_{ij})\). Directly exponentiating this fitted log-scale value gives \(\exp(m_{ij})=F_{ij}\), the conditional median. If the requested quantity is the conditional arithmetic mean, the correct retransformation is \(\exp(m_{ij}+\sigma^2/2)\).
The size of the difference can be stated in two ways. The absolute amount by which naive retransformation falls below the mean is \(\exp(m_{ij})\{\exp(\sigma^2/2)-1\}\), in the observation’s units. Relative to the true arithmetic mean, the naive value has relative bias \(\exp(-\sigma^2/2)-1\), which is negative. Relative to the median, the arithmetic mean is larger by the factor \(\exp(\sigma^2/2)\). These denominators differ, so the corresponding percentage comparisons should not be interchanged.
Worked Example: Correcting a Log-Scale Prediction
For a hypothetical concentration, suppose the fitted conditional mean of \(\log(Y_{ij})\) is \(m_{ij}=\log(8)\), with \(Y_{ij}\) measured in mg/L, and \(\sigma=0.30\). Calculate the naive retransformation, the conditional arithmetic mean, and the bias.
Naive retransformation gives \(\exp(m_{ij})=\exp\{\log(8)\}=8.000\) mg/L. This is the conditional median. The corrected arithmetic mean is \(\exp(m_{ij}+0.30^2/2)=8\exp(0.045)=8(1.0460)=8.368\) mg/L.
The naive value is \(8.368-8.000=0.368\) mg/L below the arithmetic mean. Its relative bias using the arithmetic mean as the denominator is \((8.000-8.368)/8.368=-0.0440\), or \(-4.40\%\). Equivalently, the relative bias is \(\exp(-0.045)-1=-0.0440\). This is a systematic consequence of retransformation, not evidence that the log-scale model’s residual mean is nonzero.
Worked Example: Interpreting Original-Scale Variability
Consider a hypothetical prediction of \(F_{ij}=5\) mg/L with \(\sigma=0.40\), hence \(\sigma^2=0.16\). Find its conditional mean, variance, and coefficient of variation.
The median is \(5\) mg/L. The arithmetic mean is \(5\exp(0.16/2)=5\exp(0.08)=5(1.0833)=5.416\) mg/L.
The variance is \(5^2\exp(0.16)\{\exp(0.16)-1\}=25(1.1735)(0.1735)=5.090\) (mg/L)\(^2\). Thus the standard deviation is \(2.256\) mg/L. The coefficient of variation is \(\sqrt{\exp(0.16)-1}=\sqrt{0.1735}=0.4165\), or about \(41.65\%\). It is a ratio and therefore has no units; this relative variability is the same at any positive prediction under the assumed constant \(\sigma^2\).
What the Correction Does—and Does Not—Average
The factor \(\exp(\sigma^2/2)\) corrects for residual variability conditional on a particular \(F_{ij}\). In an NLME model, \(F_{ij}\) can vary across subjects through their random effects. Averaging over subjects requires accounting for the distribution of those effects as well as residual error. In general, exponentiating a population-average log prediction is not the same as averaging subject-specific original-scale means. The correction above should therefore be applied at the conditional level for the stated target, not treated as a universal marginal population correction.
If \(\sigma^2=0\), there is no residual spread and the median, mean, and prediction coincide. As \(\sigma^2\) increases, the mean-to-median ratio \(\exp(\sigma^2/2)\) increases. The correction is consequently important when residual variation is substantial or when a decision depends on the arithmetic mean.
Choosing and Checking the Error Scale
Lognormal error is appropriate when measurements are positive and deviations are plausibly multiplicative: a given percentage departure is more meaningful than a fixed absolute departure. It differs from the neighboring residual-error formulations in useful ways:
| Error formulation | Typical implication | Important limitation |
|---|---|---|
| Additive error | Constant absolute spread around the prediction | Can assign positive probability to negative observations |
| Proportional error | Spread scales with the prediction | A Gaussian error multiplier can also produce negative observations |
| Lognormal error | Positive observations with multiplicative, right-skewed residual variation | Requires positive values and a suitable normal distribution on the log scale |
Checks should be made on the scale assumed by the model. Under this formulation, \(\log(Y_{ij}/F_{ij})\) should be compatible with a centered normal residual of constant variance, conditional on the prediction and random effects. Patterns in these log residuals, strong asymmetry, or a spread that changes systematically with prediction may indicate that the model is inadequate. Such patterns are prompts to assess the specification, not automatic proof that one particular alternative is correct.
Zeros and negative observations cannot be handled by simply taking their logarithms. Adding an arbitrary constant changes the model and its interpretation. If zeros arise because values fall below a quantification limit, treating them as ordinary positive observations after an arbitrary substitution can distort the analysis; the observation mechanism needs to be represented appropriately. Lognormal error also does not guarantee that every positive dataset is well described: a few very large observations or non-normal log residuals can make its mean and variance summaries poor descriptions.
Common Mistake
Check Your Understanding
Work through the questions, then compare your results with the solutions below.
- If \(F_{ij}=20\) mg/L and \(\sigma=0.10\), what are the conditional median and mean?
- For a log-scale fitted value \(m_{ij}\), what original-scale quantity does \(\exp(m_{ij})\) estimate under centered lognormal residual error?
- If \(\sigma=0\), how do the conditional median and mean compare?
- Give one reason lognormal residual error may be unsuitable for a dataset containing zero-valued observations.
Solutions. (1) The median is \(20\) mg/L. The mean is \(20\exp(0.10^2/2)=20\exp(0.005)=20.10\) mg/L. (2) It estimates the conditional median, not the arithmetic mean; the latter is \(\exp(m_{ij}+\sigma^2/2)\). (3) They coincide because both equal \(F_{ij}\) when the residual variance is zero. (4) The logarithm of zero is undefined, and the lognormal model assigns probability only to strictly positive observations; zeros may require modelling their measurement or censoring mechanism rather than arbitrary replacement.