Tutorials › Multiple Imputation by Chained Equations (MICE) › Transformations and the Target Regression Relationship

Imputation-Model Compatibility With the Analysis Model · Tutorial 280 of 497

Transformations and the Target Regression Relationship

Learn how the analysis model’s predictor transformation shapes the conditional relationship that an imputation model must preserve.

Advanced 12 min read

What You'll Learn

  • Distinguish raw-scale, logarithmic, and polynomial analysis relationships.
  • Identify the analysis terms and predictor support that imputation must preserve.
  • Derive the conditional distribution for a raw linear model under normal assumptions.
  • Explain why a log-scale model is naturally handled on the transformed scale.
  • Recognize why polynomial relationships can produce nonnormal or multimodal conditional distributions.
  • Use diagnostics to identify when an imputation model has flattened or distorted the target relationship.

Why the Analysis Scale Matters

A regression model does not merely name which variables are related; it specifies how they are related. A one-unit increase in a raw predictor, a one-unit increase in its logarithm, and a quadratic change in the predictor describe different patterns. When that predictor has missing values, the imputation model must preserve the relationship required by the planned analysis. Including the variable by name is not enough if the imputation model imposes the wrong shape.

This tutorial focuses on a continuous predictor \(X\), an outcome \(Y\), and fully observed covariates \(Z\). The target analysis is one of three regression models: linear in \(X\), linear in \(\log X\), or quadratic in \(X\). The issue is especially important when \(X\) is incomplete and \(Y\) is observed: the imputation model needs to reproduce the conditional relationship between \(X\) and \(Y\) implied by the analysis model, not just make plausible-looking values of \(X\).

Definition: The target regression relationship is the specified conditional relationship between the outcome and predictors in the analysis model. If \(X\) is incomplete, an imputation model is compatible with that target when its conditional distribution for missing \(X\), together with the other model components, can preserve the target relationship in completed data. A useful starting point is \(f(X\mid Y,Z)\propto f(Y\mid X,Z)f(X\mid Z)\). The analysis model supplies the outcome likelihood \(f(Y\mid X,Z)\); the distribution of \(X\) given \(Z\) also affects the required conditional distribution.

Compatibility is a distributional requirement, not a checklist that can be satisfied merely by adding a column to a regression. In chained equations, each incomplete variable is imputed from a conditional model. If the conditional model for \(X\) cannot represent the pattern implied by the analysis, the completed data may attenuate, distort, or otherwise alter the analysis coefficient. In practice, analysts may use a carefully chosen conditional model, a transformed-scale model, or a model designed to be compatible with the substantive analysis. A convenient approximation should not be mistaken for an exact guarantee.

Raw, Logarithmic, and Polynomial Targets

Consider an outcome model with normally distributed errors and constant variance, conditional on the predictors. The following forms make distinct assumptions about the conditional mean of \(Y\):

$$ \begin{aligned} \text{Raw:}\quad & E(Y\mid X,Z)=\beta_0+\beta_1X+\boldsymbol{\gamma}^{\mathsf T}Z,\\ \text{Logarithmic:}\quad & E(Y\mid X,Z)=\beta_0+\beta_1\log(X)+\boldsymbol{\gamma}^{\mathsf T}Z,\quad X>0,\\ \text{Quadratic:}\quad & E(Y\mid X,Z)=\beta_0+\beta_1X+\beta_2X^2+\boldsymbol{\gamma}^{\mathsf T}Z. \end{aligned} $$

For the raw model, the mean changes at a constant rate per unit of \(X\). In the log model, it changes at a constant rate per unit of \(\log(X)\); the positive-domain condition is essential. In the quadratic model, the slope with respect to \(X\) is \(\beta_1+2\beta_2X\), so the rate of change depends on the predictor value. The imputation model must not quietly replace any of these target shapes with a straight line on the raw scale.

When a deterministic transformation such as \(X^2\) or \(\log(X)\) is needed in the analysis, it should be recalculated from each imputed value of \(X\). This is often called passive derivation: the transformed column is defined by the current value of \(X\), rather than independently imputed. That step ensures the algebraic identity holds in every completed data set. It does not, by itself, ensure that the conditional distribution used to impute \(X\) has preserved the outcome relationship.

Deriving the Conditional Target

The raw linear case gives a useful contrast. Suppose, conditional on \(Z\), that \(X\) is normally distributed with mean \(\mu_X(Z)\) and variance \(\tau^2\), and that \(Y\mid X,Z\) is normal with mean \(\beta_0+\beta_1X+\boldsymbol{\gamma}^{\mathsf T}Z\) and variance \(\sigma^2\). Completing the square in \(f(X\mid Z)f(Y\mid X,Z)\) shows that \(X\mid Y,Z\) is normal. Its variance and mean are:

$$ \begin{aligned} \operatorname{Var}(X\mid Y,Z) &=\left(\frac{1}{\tau^2}+\frac{\beta_1^2}{\sigma^2}\right)^{-1},\\ E(X\mid Y,Z) &=\operatorname{Var}(X\mid Y,Z) \left[ \frac{\mu_X(Z)}{\tau^2} +\frac{\beta_1\{Y-\beta_0-\boldsymbol{\gamma}^{\mathsf T}Z\}}{\sigma^2} \right]. \end{aligned} $$

Thus a linear conditional mean for \(X\) given \(Y,Z\) is appropriate under these particular normal-model assumptions. The result depends on the assumed distribution for \(X\mid Z\) as well as the analysis model. It should not be generalized automatically to transformed or polynomial targets. The following examples make the differences concrete.

Worked Example: A Raw-Scale Linear Relationship

Suppose a hypothetical analysis model is \(Y=10+2X+\varepsilon\), where \(\varepsilon\) has mean zero and variance \(4\), and \(X\mid Z\) is normal with mean \(2\) and variance \(1\). For illustration, take \(Y=15\). Calculate the conditional mean and variance of \(X\mid Y\) under these assumptions.

Here \(\beta_0=10\), \(\beta_1=2\), \(\mu_X=2\), \(\tau^2=1\), and \(\sigma^2=4\). The conditional variance is \(1/(1+4/4)=0.5\). The conditional mean is \(0.5[2+(2/4)(15-10)]=0.5(4.5)=2.25\).

So \(X\mid Y=15\) has mean \(2.25\) and variance \(0.5\) in this illustrative model. A stochastic imputation would draw from this conditional distribution, not simply insert \(2.25\) for every missing value. The linear raw-scale relationship is appropriate here because the stated normal assumptions make the derived conditional distribution normal with a linear mean in \(Y\).

For the logarithmic target, let \(W=\log(X)\). If \(W\mid Z\) is normal and the outcome is normal with a mean linear in \(W\), the same normal-normal calculation applies on the \(W\) scale. A draw of \(W\) can then be transformed back using \(X=\exp(W)\). The resulting distribution for \(X\) is positive and generally right-skewed. Modeling \(X\) as normal on its raw scale would not enforce positivity and would not generally reproduce this target relationship.

Worked Example: A Logarithmic Predictor

Suppose a hypothetical analysis uses \(Y=4+3\log(X)+\varepsilon\), with \(X>0\). The observed pairs are \((X,Y)=(1,4)\), \((e,7)\), and \((e^2,10)\), taking the error to be zero for this simple illustration. For a case with \(Y=8.5\), find the predictor value that lies exactly on the fitted mean relationship.

Rearrange the equation: \(\log(X)=(Y-4)/3\). Substitution gives \(\log(X)=(8.5-4)/3=1.5\), so \(X=\exp(1.5)\approx4.482\). This is a solution on the positive predictor scale.

The arithmetic identifies the value on the conditional mean curve; it is not a stochastic imputation rule. Under a normal model for \(W=\log(X)\mid Z\) and normal outcome errors, the conditional distribution for \(W\mid Y,Z\) can be derived on the transformed scale, then sampled and exponentiated. A linear imputation of raw \(X\) on \(Y\) would not in general preserve the constant-per-unit-\(\log(X)\) target relationship.

For a polynomial target, the conditional distribution can be more complicated still. The quadratic term is a deterministic function of \(X\); it must be recomputed from the imputed \(X\). But the conditional relationship of \(X\) to \(Y\) can be curved and, in some cases, have more than one region of high probability. A single normal regression for \(X\) with a linear mean in \(Y\) may be unable to represent that pattern.

Worked Example: A Quadratic Relationship With Two Plausible Values

Consider the hypothetical mean model \(Y=5+2X-0.5X^2+\varepsilon\), with \(\varepsilon\sim N(0,0.5^2)\). To show the shape clearly, suppose \(X\) takes the values 0, 1, 2, or 3 with equal prior probabilities. The corresponding fitted means are 5, 6.5, 7, and 6.5. For a case with observed \(Y=6.5\), calculate the relative conditional probabilities of those four possible predictor values.

With equal prior probabilities, the relative weights are proportional to the normal likelihood, \(\exp[-(Y-\mu_X)^2/(2(0.5)^2)]\), where \(\mu_X\) is the fitted mean at each candidate \(X\). For \(X=1\) and \(X=3\), the residual is zero, so each weight is \(1\). For \(X=2\), the residual is \(-0.5\), so its weight is \(\exp[-0.25/0.5]=\exp(-0.5)\approx0.6065\). For \(X=0\), the residual is \(1.5\), so its weight is \(\exp[-2.25/0.5]=\exp(-4.5)\approx0.01111\).

The weights sum to \(2+0.6065+0.01111=2.6176\). Normalizing, the conditional probabilities are approximately \(0.3820\) for \(X=1\), \(0.2317\) for \(X=2\), \(0.3820\) for \(X=3\), and \(0.00425\) for \(X=0\). Thus \(X=1\) and \(X=3\) are both strongly plausible given \(Y=6.5\). A single conditional mean cannot convey that two-region shape; a flexible or specially constructed conditional model may be needed.

Practical Specification and Diagnostics

Before fitting the imputation model, state the analysis relationship and the scale on which it is defined. Then specify the conditional model for the incomplete predictor with that target in mind. A useful workflow is:

1
Write the analysis term explicitly.
Record whether the outcome mean uses \(X\), \(\log(X)\), \(X^2\), or a combination, and note any support restriction such as \(X>0\).
2
Identify the required conditional shape.
Use \(f(X\mid Y,Z)\propto f(Y\mid X,Z)f(X\mid Z)\) as the target. Check whether a simple regression for \(X\) can represent it under plausible distributional assumptions.
3
Impute on a suitable scale and derive terms.
For a positive predictor in a log model, consider modeling \(W=\log(X)\) and transforming draws back. Recalculate all deterministic analysis terms from the resulting \(X\) values.
4
Check the relationship in completed data.
Compare observed and imputed values across outcome ranges and inspect the analysis-scale terms. Look for flattened curvature, implausible support, or missing regions of the conditional distribution.

Diagnostics can reveal clear failures but cannot prove compatibility. Useful checks include plots of \(X\) against \(Y\) with observed and imputed values distinguished, plots of \(\log(X)\) when that is the target scale, and plots of \(X^2\) or the fitted polynomial relationship for quadratic analyses. Compare the range and spread of imputed values with observed values across relevant outcome ranges. For a log model, any nonpositive imputed value is a direct failure. For a quadratic model, a cloud of imputations concentrated near one side of a curved or two-region pattern is a warning that the conditional model is too restrictive.

Common Pitfalls and Alternatives

A frequent mistake is to create a passive column \(\log(X)\), then assume the analysis relationship is safe because the transformed column is correct whenever \(X\) is observed or imputed. The correction is that passive derivation enforces \(\log(X)\) as a function of \(X\), but it does not change how missing \(X\) values were drawn. If those draws came from a poorly specified linear model on the raw scale, the imputed joint relationship with \(Y\) can still be wrong.

Another mistake is to impute \(X\) and \(\log(X)\) as separate, unconstrained variables. That can produce completed records in which the two columns do not satisfy \(\log(X)\). Instead, impute the underlying predictor on a chosen scale, then derive the analysis transformation from each draw. When a simple transformed-scale conditional model is not adequate, a flexible conditional model or a substantive-model-compatible imputation approach may be considered; the choice depends on the outcome likelihood, predictor distribution, and complexity of the target.

Analysis targetPotential imputation strategyImportant limitation
Linear in raw \(X\)Model \(X\mid Y,Z\) with an appropriate linear-normal conditional model when its assumptions are credible.Normality and linearity assumptions may fail; the derivation depends on the model for \(X\mid Z\).
Linear in \(\log(X)\)Model on \(W=\log(X)\), then exponentiate draws and derive \(\log(X)\) from \(X\).The transformed-scale conditional model still needs suitable assumptions and may require richer terms.
Quadratic in \(X\)Use a conditional model able to represent the implied curved or multimodal \(X\mid Y,Z\) relationship; derive \(X^2\) passively.A routine linear-normal conditional model may miss distinct regions of high probability.

No transformation automatically solves all modeling problems. The log model requires a positive predictor and can be sensitive to values near zero. A polynomial can fit curvature over a limited range but may behave implausibly outside it. Flexible conditional models can improve shape representation, but may be unstable with sparse data or excessive complexity. In all cases, diagnostics complement—not replace—reasoned specification. The introductory material on nonlinear outcome models provides context for choosing an analysis form; here the emphasis is on carrying that specified form through imputation.

Key takeaway: Preserve the target regression relationship in the conditional distribution used to impute the incomplete predictor. Recomputing a transformed term is necessary for algebraic consistency, but it does not by itself make the imputation model compatible with the analysis.

Check Your Understanding

Answer each question, then compare your reasoning with the brief solutions.

  1. An analysis uses \(Y=\beta_0+\beta_1\log(X)+\varepsilon\). What restriction on \(X\) is required, and what scale is a natural candidate for modeling?
  2. Why does recalculating \(X^2\) after imputing \(X\) not guarantee that the imputation preserves a quadratic outcome relationship?
  3. For \(Y=5+2X-0.5X^2\), verify that \(X=1\) and \(X=3\) have the same fitted mean.
  4. In the raw linear normal example, name two distributional assumptions used to derive a normal conditional distribution for \(X\mid Y,Z\).

Solutions. (1) \(X\) must be positive; modeling \(W=\log(X)\) is a natural candidate, with draws transformed back to \(X\). (2) Recalculation guarantees the identity between \(X\) and \(X^2\), but the conditional model may still impose the wrong shape on \(X\mid Y,Z\). (3) At \(X=1\), the fitted mean is \(5+2-0.5=6.5\); at \(X=3\), it is \(5+6-4.5=6.5\). (4) The derivation assumes \(X\mid Z\) is normal and \(Y\mid X,Z\) is normal with a mean linear in \(X\) and constant variance.

Clinical Biostats