Tutorials › Multiple Imputation by Chained Equations (MICE) › Common Errors in Passive and SMC-FCS Implementations

Passive Imputation and Substantive-Model-Compatible Methods · Tutorial 331 of 497

Common Errors in Passive and SMC-FCS Implementations

Learn a practical framework for checking whether passive and SMC-FCS updates preserve deterministic identities and target the intended conditional distributions.

Advanced 10 min read

What You'll Learn

  • Distinguish a stale passive variable from a correctly refreshed deterministic term.
  • Check whether transformations and their parameterizations agree across imputation and analysis.
  • Explain how omitting the substantive likelihood changes an SMC-FCS update.
  • Verify proposal support and the acceptance correction for an asymmetric proposal.
  • Use targeted diagnostics to separate coding errors from model limitations.

Implementation Errors Can Change the Imputation Target

Passive imputation and substantive-model-compatible fully conditional specification (SMC-FCS) can fail even when the model formulas look reasonable. A derived variable may no longer equal the function of its source variables; an update may use a different transformation from the analysis; or a proposed covariate value may be accepted without the correction needed to target its intended conditional distribution. These are not cosmetic discrepancies. They can change the completed data and the estimand’s fitted relationship to the outcome.

The earlier material on verifying deterministic identities and diagnosing SMC-FCS draws provides useful checks on completed data and sampled distributions. Here the emphasis is on implementation errors: what each error does, how to identify it, and how to check a correction.

Definition: A passive variable is a deterministic quantity computed from other variables, such as \(D=g(X)\). A passive update recomputes \(D\) from the current value of \(X\); it does not draw \(D\) independently. In SMC-FCS, an incomplete covariate \(X\) is updated using a target conditional distribution that combines its covariate model with the substantive-model likelihood.

For a single incomplete \(X_i\), a common target, conditional on observed outcome \(Y_i\), other covariates \(Z_i\), and model parameters, is proportional to

$$ p(X_i\mid Y_i,Z_i;\psi,\beta) \ \propto\ p(Y_i\mid X_i,Z_i;\beta)\,p(X_i\mid Z_i;\psi). $$

This expression assumes that the specified substantive likelihood and covariate conditional model are the intended components of the update, that the likelihood is evaluated at the proposed \(X_i\), and that the proposal procedure samples from or correctly targets the resulting distribution. If an implementation omits a factor or evaluates a different model, its draws need not have this conditional distribution. In practice, parameters may also be updated; the expression describes the covariate update conditional on their current values.

Stale Passive Values and Inconsistent Transformations

A passive variable is valid only for the current values of its inputs. If \(X_i\) changes during an iteration, every derived variable depending on \(X_i\) must be refreshed before it is used in a subsequent update or in the substantive model. Recomputing only at the end of a chain does not repair calculations already made with stale values.

Worked Example: A Stale Quadratic Term

Suppose a hypothetical analysis includes a continuous covariate \(X\), its square \(D=X^2\), and the linear predictor \(\eta=0.4X-0.05D\). During an imputation update, \(X\) changes from 2 to 3. The passive rule is \(D=X^2\).

Before the update, \(D=2^2=4\). After the update, the correct passive value is \(D=3^2=9\), so the correct linear predictor is

$$ \eta=0.4(3)-0.05(9)=1.2-0.45=0.75. $$

If the program retains the stale value \(D=4\), it instead uses

$$ \eta_{\text{stale}}=0.4(3)-0.05(4)=1.2-0.20=1.00. $$

The stale calculation differs by \(1.00-0.75=0.25\) on the linear-predictor scale. The discrepancy is not harmless rounding: the substantive model has been evaluated at a pair \((X,D)=(3,4)\) that violates the required identity \(D=X^2\). A direct diagnostic is to compute \(D-X^2\) for every record after each update that changes \(X\); it must equal zero up to any explicitly intended numerical tolerance.

A related error is to use different definitions of a transformation in different parts of the program. For example, the imputation code might use a centered square \((X-c)^2\), while the analysis code uses \(X^2\), or one part might standardize \(X\) using a fixed reference mean while another recomputes the mean within each completed data set. Different parameterizations can be legitimate, but they must represent the same intended model and be translated consistently. Record the exact function, centering constant, scale, units, and update timing, then check the derived values against that definition.

Omitting the Substantive Likelihood

In an SMC-FCS covariate update, the substantive likelihood contributes information about a missing covariate through the observed outcome. Omitting it generally leaves only the covariate-model distribution, which is not the target conditional distribution given the outcome. The result can be an implementation that appears to impute plausible covariates but does not preserve the intended outcome model.

Worked Example: The Outcome Likelihood Changes a Binary Update

Consider a hypothetical record with \(Y=1\), binary incomplete covariate \(X\in\{0,1\}\), and covariate-model probabilities \(P(X=0)=P(X=1)=0.5\). Suppose the substantive model is

$$ \operatorname{logit}\{P(Y=1\mid X)\}=(\log 3)X. $$

For \(X=0\), the outcome probability is \(\operatorname{logit}^{-1}(0)=0.5\). For \(X=1\), it is \(\operatorname{logit}^{-1}(\log 3)=3/(1+3)=0.75\). Since the observed outcome is 1, these are the likelihood contributions for the two candidate values. The conditional probabilities are proportional to likelihood times covariate probability:

$$ P(X=1\mid Y=1) =\frac{0.5(0.75)}{0.5(0.50)+0.5(0.75)} =\frac{0.375}{0.625} =0.6000. $$

The remaining probability is \(P(X=0\mid Y=1)=0.250/0.625=0.4000\). If the implementation omits the substantive likelihood, it uses the covariate-model probabilities alone and assigns probability 0.5000 to each value. That is a different distribution: the correct update gives \(X=1\) probability 0.6000, not 0.5000.

This check assumes the stated probabilities and model parameters are the ones used for this update. In a real implementation, inspect the calculation for a single record and verify that the outcome likelihood is evaluated for each proposed value of \(X\), using the observed \(Y\) and the current parameter values. Also verify that the outcome contribution is included for each record whose incomplete covariate is being updated, not just for records where the outcome itself is missing.

A code path that silently drops the likelihood for a particular outcome category, covariate pattern, or missingness pattern can be harder to spot than a completely omitted term. Useful diagnostics include logging the covariate-model and substantive-likelihood contributions separately for a small set of records, checking that their product is used in the target, and comparing the update against a hand-calculated case where the support is small enough to enumerate.

Invalid Proposals and Missing Corrections

A proposal distribution is a computational device, not the target distribution. The chain must be able to reach every value in the target support through proposal paths and satisfy the usual irreducibility conditions; a proposal need not propose every target value from every current state. For an asymmetric proposal, the transition probability must also include the proposal correction. If either requirement is violated, the resulting chain may visit values at the wrong frequencies or exclude valid values altogether.

For a Metropolis–Hastings update from current value \(x\) to proposed value \(x'\), let \(\pi(x)\) denote the desired conditional target and \(q(x'\mid x)\) the proposal probability or density. The acceptance probability is

$$ a(x,x')=\min\left\{1,\, \frac{\pi(x')q(x\mid x')}{\pi(x)q(x'\mid x)} \right\}. $$

The reverse-proposal factor is essential unless the proposal is symmetric. If some target values cannot be reached from the current state through any sequence of proposals, no acceptance correction can recover them.

Worked Example: An Asymmetric Proposal Needs a Correction

Use the binary example above, whose target probabilities are \(\pi(0)=0.4\) and \(\pi(1)=0.6\). Suppose a sampler proposes a change from 0 to 1 with probability \(q(1\mid0)=0.8\), and from 1 to 0 with probability \(q(0\mid1)=0.2\). For a proposed move from 0 to 1, the correct acceptance probability is

$$ a(0,1) =\min\left\{1,\frac{0.6(0.2)}{0.4(0.8)}\right\} =\min\{1,0.375\} =0.375. $$

For the reverse move,

$$ a(1,0) =\min\left\{1,\frac{0.4(0.8)}{0.6(0.2)}\right\} =\min\{1,2.667\} =1. $$

The transition probability from 0 to 1 is therefore \(0.8(0.375)=0.300\), while the transition probability from 1 to 0 is \(0.2(1)=0.200\). The target is stationary because probability flows balance: \(\pi(0)(0.300)=0.4(0.300)=0.120\) and \(\pi(1)(0.200)=0.6(0.200)=0.120\). If the correction is omitted, both proposed moves are accepted; the corresponding flows are \(0.4(0.8)=0.320\) and \(0.6(0.2)=0.120\), which do not balance. Thus the intended target is not stationary for that erroneous transition rule.

For continuous covariates, support errors require particular care. If the target assigns probability only to positive values, for instance, a proposal that generates negative values must reject them or otherwise enforce the positive support. A proposal that never generates some positive region with nonzero target density is also invalid for exploring the full target. Always check support, proposal density evaluation, and any forward-to-reverse proposal ratio used in the code.

A Practical Audit and the Main Alternatives

A compact audit should trace one covariate update from inputs to stored values. State the intended conditional target first; identify the proposal and its support; check the substantive likelihood and covariate-model terms; apply the correct proposal correction; then refresh every passive quantity before the next calculation that uses it. The assumptions are substantive as well as computational: the chosen conditional models and substantive likelihood must be suitable for the intended analysis, and the update must be implemented as specified. Correct code cannot compensate for a misspecified model.

1
Check the data identity.
After changing a source variable, recompute each dependent passive term and test the identity on every record.
2
Check the model definition.
Compare transformations, units, reference values, and coding across the imputation and substantive-analysis components.
3
Check the target calculation.
For a hand-checkable record, verify that both the covariate-model probability and the outcome likelihood enter the update.
4
Check the sampling step.
Confirm proposal support and any required acceptance ratio; compare sampled frequencies with a small enumerated target when possible.

The main alternatives address different problems. Passive imputation enforces an exact deterministic identity, but passive recalculation alone does not guarantee that the conditional distribution of the incomplete source variable respects the substantive model. SMC-FCS incorporates the substantive likelihood into that covariate update, but relies on correct likelihood evaluation and a valid proposal or sampling step. A conventional fully conditional specification may be simpler to implement, but its conditional models do not automatically preserve a particular substantive model. Choosing among these approaches is a modeling decision; none removes the need for implementation checks.

Diagnostics can reveal symptoms without identifying their cause. Check identity residuals such as \(D-g(X)\); inspect trace plots and marginal summaries for sampled covariates; compare observed and imputed distributions; and examine whether results change when correcting a suspected coding discrepancy. A constant identity residual often suggests a stale or differently defined passive term. Implausible draws near or outside the covariate’s allowable range suggest a support problem. A covariate distribution that barely responds to the observed outcome, when the specified substantive model predicts it should, can prompt a check for a missing likelihood contribution. These signals are reasons to inspect the update, not proofs of a particular error.

Finally, distinguish coding correctness from model adequacy. A perfectly refreshed square can still be a poor representation of a nonlinear relationship; an exactly implemented conditional model can still be misspecified; and a sampler with the correct stationary target can mix too slowly for reliable Monte Carlo summaries. Record the model formula and transformation definitions, test small cases independently, and monitor both deterministic identities and stochastic behavior.

Key takeaway: Check three separate things: passive values must match their defining functions, the SMC-FCS target must include the intended substantive likelihood, and the sampling mechanism must reach that target with valid support and proposal corrections.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. If \(D=2X\) and an update changes \(X\) from 4 to 5, what value must be used for \(D\) in the next model calculation?
  2. In a binary update, the covariate model assigns probability 0.3 to \(X=1\) and 0.7 to \(X=0\). The outcome likelihoods are 0.8 for \(X=1\) and 0.2 for \(X=0\). What is \(P(X=1\mid Y,\ldots)\) after normalization?
  3. Why can a proposal that never generates a region with positive target density fail even if every proposed value is accepted or rejected using a likelihood ratio?
  4. For the asymmetric proposal in the worked example, what error results from accepting every proposed move?

Solutions. (1) Recompute \(D=2(5)=10\); retaining the old value 8 is stale. (2) The unnormalized weights are \(0.3(0.8)=0.24\) and \(0.7(0.2)=0.14\), so \(P(X=1\mid Y,\ldots)=0.24/(0.24+0.14)=0.6316\). (3) The sampler cannot visit values it never proposes, so it cannot represent positive target probability in that region. (4) The transition flows are \(0.4(0.8)=0.32\) from 0 to 1 and \(0.6(0.2)=0.12\) from 1 to 0; their inequality shows that the intended target is not stationary.

Clinical Biostats