Tutorials › Multiple Imputation by Chained Equations (MICE) › Recomputing Passive Terms After Each Conditional Draw

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

Recomputing Passive Terms After Each Conditional Draw

Learn to update passive terms after each draw that changes an input, so later conditional models and completed data use values consistent with the current source-variable draws.

Advanced 10 min read

What You'll Learn

  • Identify which conditional draws require a passive term to be recalculated.
  • Place recalculation correctly within a chained-equations sweep.
  • Trace how a stale derived value can affect a later conditional model.
  • Distinguish deterministic recalculation from stochastic imputation.
  • Check stored passive values against their current inputs.
  • Recognize when recalculation alone cannot resolve a model or data problem.

Why Recalculation Timing Matters

A passive variable is a deterministic function of one or more source variables. Its value is not drawn from a separate conditional distribution: it is calculated from the current values of its inputs. In chained equations, however, those inputs can change one at a time as the algorithm updates variables with missing values. A passive value calculated earlier in the sweep can therefore become stale before the sweep is finished.

The practical rule is simple: after a conditional draw changes any input to a passive term, recalculate that term before a later conditional model uses it. Recalculating all affected passive terms immediately is a reliable implementation. At a minimum, recalculate them before each use and ensure they are current in every completed imputed data set.

Definition: Let \(D=f(X_1,\ldots,X_k)\) be a passive variable, where \(f\) is a specified deterministic function and the \(X_j\) are its source variables. At any point in a chained-equations sweep, \(D\) is current if its stored value equals \(f\) evaluated at the source-variable values currently in that record. Recalculation replaces the stored value of \(D\) with this current function value; it is not a new stochastic draw.

This timing rule applies to the changing state of the algorithm, not just to the final data export. If a later conditional model includes \(D\) as a predictor, that model should use the value corresponding to the source values available at that point in the sweep. Using an out-of-date value mixes two different states of the record.

Where Recalculation Fits in a Sweep

A chained-equations iteration visits variables with missing values and draws new values from their specified conditional models. Some variables in those models may be passive terms. Whenever a draw updates a source variable, every passive term depending on that source may need updating. If another source changes later, the affected terms need updating again.

For example, suppose \(D=f(A,B)\). If the algorithm updates \(A\), then \(D\) should be recomputed before the next conditional model that uses \(D\). If the algorithm subsequently updates \(B\), recompute \(D\) again before its next use. Once all source updates in a sweep are complete, recompute or verify the passive terms so the stored completed data are current.

1
Draw a source variable.
Use its specified conditional model to update the missing values in that variable. The draw may change inputs to one or more passive terms.
2
Update affected terms.
Recalculate each affected passive term from the source values now in the data. Do this before a subsequent model uses the term.
3
Continue the sweep.
Use current passive values in later conditional models where they are specified as predictors. Repeat the update whenever another source draw changes an input.
4
Check the stored state.
At the end of the sweep, verify that every stored passive value equals its defining function of the stored source values.

This procedure assumes that the deterministic definition is correctly specified, that its required inputs are available at the point of calculation, and that the conditional models and update order are otherwise defined appropriately. It does not establish that the imputation models are well specified, compatible with the intended analysis, or adequate for the missingness problem. Those are separate modeling questions.

Worked Example: Updating Before a Later Model Uses the Term

Consider a hypothetical record with passive term \(D=A+2B\). At the start of a sweep, \(A=2\) and \(B=3\), so \(D=2+2(3)=8\). Suppose a valid draw from the conditional model for \(A\) updates it to \(A=5\), while \(B\) is still 3.

Recalculate now: \(D=5+2(3)=11\). If the next conditional model uses \(D\), it should use 11, the value corresponding to the current \(A\) and \(B\).

Suppose the later conditional draw for \(B\) gives \(B=4\). The term then changes again: \(D=5+2(4)=13\). At the end of the sweep, the stored values should be \(A=5\), \(B=4\), and \(D=13\). Keeping the original value 8 would make \(D\) inconsistent with both updated source values.

The numbers 5 and 4 here represent hypothetical outputs of specified conditional models; recalculation does not choose them. It only evaluates the deterministic definition after the stochastic source draws.

Why a Stale Value Is Not a Small Bookkeeping Detail

A later conditional model is fitted or evaluated using the values supplied to it. If one of those values is a passive term that no longer reflects the current source variables, the model receives a predictor that does not describe the current record. The result is not equivalent to using the correctly recalculated term, even if the stale value was correct earlier in the same sweep.

A short algebraic check makes the point. Suppose \(D=A+2B\), and \(A\) changes from \(A_{\text{old}}\) to \(A_{\text{new}}\) while \(B\) stays fixed. The stale value is \(D_{\text{old}}=A_{\text{old}}+2B\), whereas the required current value is \(D_{\text{new}}=A_{\text{new}}+2B\). Their difference is

$$ D_{\text{old}}-D_{\text{new}} =(A_{\text{old}}+2B)-(A_{\text{new}}+2B) =A_{\text{old}}-A_{\text{new}}. $$

Thus, unless the draw leaves \(A\) unchanged, the stale value is not the value defined by the current inputs. The same reasoning applies to a general function \(D=f(A,B)\): after an input changes, the old value remains valid only if it happens to equal the function evaluated at the new inputs. Relying on that coincidence is not a valid update rule.

Worked Example: Recalculating After a Later Source Update

In another hypothetical sweep, let \(D=3A-B\). A record currently has \(A=4\) and \(B=1\), so \(D=3(4)-1=11\). A conditional draw updates \(B\) to 2.5 while \(A\) remains 4.

Recalculate after the draw: \(D=3(4)-2.5=12-2.5=9.5\). If a subsequent conditional model includes \(D\), it should receive 9.5, not the stale value 11. The arithmetic uses the updated value of \(B\), while the value of \(A\) has not changed.

At the end of the sweep, if a later draw also changes \(A\), the same rule applies again: compute \(D\) from the newly updated \(A\) and the current \(B\). A term is not “recalculated for the sweep” just once if one of its inputs changes again after that calculation.

Worked Example: Two Passive Terms Updated in Sequence

Suppose a hypothetical record has two deterministic terms, \(D=A+2B\) and \(E=D-C\). At the start of the relevant part of a sweep, \(A=1\), \(B=2\), and \(C=4\). Therefore \(D=1+2(2)=5\) and \(E=5-4=1\).

A conditional draw updates \(A\) to 3. First update \(D\): \(D=3+2(2)=7\). Then update \(E\) from the current \(D\) and \(C\): \(E=7-4=3\). If a later conditional draw updates \(C\) to 6, \(D\) remains 7 because neither of its inputs changed, while \(E\) must be recalculated: \(E=7-6=1\).

The order matters because \(E\) uses \(D\). Recomputing \(E\) using the new \(C\) but a stale \(D\), or using an old \(E\) after \(C\) changes, would not produce the value defined by the current inputs. This example illustrates update timing; it does not prescribe which passive terms should be included in any particular conditional model.

Implementation Checks and Common Failure Modes

A useful diagnostic is a direct consistency check on the stored data. For each record and each passive term, evaluate its defining function from the source values in that record and compare the result with the stored term. For exact deterministic arithmetic, the values should agree, allowing only for any explicitly specified rounding convention. Run this check after source draws and again on the completed imputed data sets.

A second check concerns timing: inspect the sequence of updates and confirm that a passive term is refreshed before any later conditional model that uses it. A final end-of-sweep check cannot show that every intermediate model used current predictors. If practical, log the source values, the recalculated term, and the point in the sweep at which it was used. Discrepancies that repeatedly appear after particular draws often identify a missed update.

  • Recalculating only at the end. This leaves stale values available to later conditional models during the sweep. Recalculate before their use, not only before saving the completed data.
  • Updating only once per iteration. A source variable may be updated again later in the same sweep. Recalculate affected terms after each such update before their next use.
  • Treating a passive term as another stochastic variable. Drawing it independently can break its defining relationship with its inputs. Recalculate it deterministically instead.
  • Assuming correct timing proves a correct model. Current values do not guarantee that the conditional models are suitable or compatible with the analysis. Recalculation addresses consistency of the stored inputs and terms, not all aspects of imputation quality.

An implementation could instead recalculate a term just before each model that needs it, rather than immediately after every source draw. That can be equivalent if the term is guaranteed current at every use and in every saved data set. Immediate recalculation is usually easier to audit. Recomputing only at the end is simpler but is inadequate whenever a later model has already used the stale value.

ApproachWhen it can be appropriateMain caution
Recalculate immediately after an input drawA clear, auditable default during a sweepRecalculate again if another input changes later
Recalculate just before each useWhen the software reliably refreshes every required term before model evaluationVerify that no use or saved data set can contain a stale value
Recalculate only at the end of the sweepOnly when no intervening conditional model uses the termOtherwise later models use values from an earlier state

There are also limits to what this rule can solve. If a deterministic function is undefined for some current source values, recalculation cannot supply a valid value without a separate, justified approach to the domain problem. If a term is used as a predictor in a model where its relationship to the source variable creates a modeling or identification problem, refreshing its numerical value does not remove that problem. The role and specification of passive terms in conditional models must be considered separately.

Common Mistake

Common mistake: “The passive term was correct when the iteration began, so it can stay fixed until the next iteration.” This is wrong whenever a source draw changes one of its inputs and a later model uses the term. The correction is to treat the passive value as a function of the current state: update it after input changes, before later use, and verify it at the end of the sweep.

In short, passive recalculation is a timing requirement within the chained-equations procedure. It ensures that a derived predictor represents the same current record as the source variables being updated. It does not replace the stochastic conditional draws for incomplete source variables, and it does not by itself validate the imputation strategy.

Check Your Understanding

For each question, decide when recalculation is required. Solutions follow each problem.

  1. A term \(D=A+B\) is current at the start of a sweep. A draw changes \(A\), and the next conditional model uses \(D\). When must \(D\) be recalculated?
  2. A term \(D=f(A,B)\) is recalculated after a draw of \(A\). Later in the same sweep, a draw changes \(B\). Is the earlier recalculation enough for the final stored data?
  3. A passive term is correct at the end of every sweep, but a later conditional model used a stale value during the sweep. Does the end-of-sweep check establish that the model used current values?
  4. In a record, \(D=2A+B\), with current \(A=3\) and \(B=4\). A draw changes \(A\) to 5. Calculate the required new \(D\).

Solutions. (1) Recalculate immediately after the draw of \(A\), before the next conditional model uses \(D\). (2) No. Since \(B\) is another input and has changed, recalculate \(D\) again before its next use and ensure it is current in the saved data. (3) No. The final check verifies the saved state only; it does not show what value the earlier model received. Check the update sequence as well. (4) \(D=2(5)+4=10+4=14\), so the current passive value is 14.

Clinical Biostats