Tutorials › Multiple Imputation by Chained Equations (MICE) › The Conditional Update Sweep

Fully Conditional Specification · Tutorial 102 of 497

The Conditional Update Sweep

Work through a full MICE sweep and see how each conditional model is fitted, applied, and used by the next update.

Intermediate 10 min read

What You'll Learn

  • Define one complete conditional update sweep for a specified variable order.
  • Track which values are used to fit and apply each target-variable model.
  • Calculate fitted conditional probabilities and show how they produce imputations.
  • Explain why a later update uses the current dataset state, not a simultaneous snapshot.
  • Recognize model-fit and implementation problems that can undermine a sweep.
  • Distinguish a sweep from joint modeling and from pooling completed-data estimates.

From Conditional Models to a Sweep

Fully Conditional Specification (FCS) treats imputation as a sequence of conditional modeling steps. A sweep is one pass through the variables designated for imputation: for each variable in the chosen order, fit its conditional model and use that model to update its missing values. The key operational detail is that this is a sequence. Once a variable has been updated, its current values are available to the models fitted later in the same sweep.

This tutorial focuses on carrying out that pass. It does not decide which predictors belong in each model or which variable order is best; those are separate modeling choices. To make the mechanics explicit, each example states the models or predictors being used.

Definition: A conditional update sweep is one ordered pass through the incomplete variables. At each step, a conditional model for the target variable is fitted using its observed values and the specified predictors in their current state; the fitted model is then applied to update the target’s missing values. The next step uses the dataset state after that update.

The usual statistical requirements still matter: a conditional model must be suitable for the target’s scale and distribution, there must be enough observed target values to fit it, and the resulting predictions must be meaningful for the data. The inferential validity of the overall imputation procedure also depends on the missingness assumptions and model adequacy; a sweep by itself does not establish either. These are not guaranteed merely because the algorithm completes without an error.

The Order of Operations

Suppose the incomplete variables are \(A\) and \(B\), and the specified order is \(A\) then \(B\). Let \(D^{(0)}\) denote the current dataset state at the start of the sweep. The first update fits a model for \(A\) and produces \(D^{(1)}\); the second fits a model for \(B\) using \(D^{(1)}\), producing \(D^{(2)}\). Thus a sweep is a composition of updates, not a collection of updates all based on the same starting snapshot.

$$ D^{(1)} = U_A(D^{(0)}), \qquad D^{(2)} = U_B(D^{(1)}), \qquad D^{(2)} = (U_B \circ U_A)(D^{(0)}). $$

Here \(U_A\) and \(U_B\) stand for the respective fit-and-update operations, including whatever update rule the implementation uses. This notation is a bookkeeping device, not a claim that the update functions are fixed or that the sequence must converge. Reversing the order generally changes which current values are presented to each model, so it can produce a different sweep.

1
Begin with a current dataset state.
For every incomplete variable, the algorithm has a current value available where needed. At this point, no update in the present sweep has yet been made.
2
Fit the first target model.
Use cases with an observed value of that target to estimate its conditional model, with the predictors and model form specified for the target.
3
Apply the model to the target’s missing cases.
Use the fitted model’s update rule to replace the current missing entries for that target. Other variables are not the target of this update.
4
Continue through the order.
Fit and apply the next target model using the state now available, including updates already made in this sweep.

The model type depends on the target: a continuous target may call for a regression model, while a binary target may call for a binary-response model. The sweep structure is the same in either case. A fitted mean or probability is not automatically the imputed value; the procedure’s update rule determines how fitted distributions or predictions are turned into updated entries.

Worked Example: A Complete Two-Variable Binary Sweep

Consider this hypothetical dataset with two binary variables, \(A\) and \(B\). The order is \(A\) then \(B\). A question mark marks a missing value; the entries in parentheses are the current values available at the start of the sweep for missing \(B\). For this hand calculation, each conditional model estimates a separate Bernoulli probability for each value of its binary predictor. The update draws a binary value using the fitted probability and the stated uniform number.

RowAB at sweep start
111
200
3missing1
410
5missingmissing (0)
60missing (1)
701
810

Update \(A\) using \(B\). Fit the conditional probabilities from rows with observed \(A\). Among those rows with \(B=1\), rows 1, 6, and 7 have \(A=1,0,0\), respectively. Therefore,

$$ \widehat{P}(A=1\mid B=1)=\frac{1}{3}. $$

Among observed-\(A\) rows with \(B=0\), rows 2, 4, and 8 have \(A=0,1,1\). Thus,

$$ \widehat{P}(A=1\mid B=0)=\frac{2}{3}. $$

Row 3 has missing \(A\) and \(B=1\). With a uniform draw \(u=0.20\), set \(A=1\) if \(u\) is less than the fitted probability; since \(0.20<1/3\), row 3 receives \(A=1\). Row 5 has missing \(A\) and current \(B=0\); with \(u=0.80\), it receives \(A=0\), since \(0.80\) is not less than \(2/3\). The updated \(A\) values are now available for the next model.

Update \(B\) using the current \(A\). Fit this model on rows with observed \(B\): rows 1, 2, 3, 4, 7, and 8. Row 3 is included with its newly updated \(A=1\). Among these rows with \(A=1\), \(B=1\) occurs twice (rows 1 and 3) among four cases (rows 1, 3, 4, and 8). Among cases with \(A=0\), \(B=1\) occurs once (row 7) among two cases (rows 2 and 7). Hence,

$$ \widehat{P}(B=1\mid A=1)=\frac{2}{4}=0.50, \qquad \widehat{P}(B=1\mid A=0)=\frac{1}{2}=0.50. $$

Rows 5 and 6 have missing \(B\), and their current \(A\) values are both 0. Using uniform draws \(u=0.20\) for row 5 and \(u=0.70\) for row 6, the first gives \(B=1\) and the second gives \(B=0\). One full sweep is complete: row 3 has updated \(A=1\), row 5 has \(A=0,B=1\), and row 6 has \(A=0,B=0\). The calculations assume the specified group-probability models are an adequate description for this illustration; the small group counts would make them unstable in a serious analysis.

Continuous Targets and Model Application

The same bookkeeping applies when a conditional model is continuous. The following calculation shows how a simple linear conditional model is fitted. For clarity, it focuses on the fitted conditional mean; a complete imputation procedure must also specify how its update rule accounts for uncertainty and residual variation.

Worked Example: Fitting a Conditional Mean for a Continuous Variable

In a hypothetical dataset, \(Y\) is incomplete and \(X\) is fully observed. The four cases with observed \(Y\) are \((X,Y)=(0,2),(1,4),(2,5),(3,7)\). Specify the linear model \(Y=\beta_0+\beta_1X+\varepsilon\), with errors having mean zero conditional on \(X\) and constant variance for the usual least-squares interpretation. These assumptions are imposed for the calculation, not established by four observations.

The observed-case means are \(\bar{x}=1.5\) and \(\bar{y}=4.5\). The least-squares slope and intercept are

$$ \hat{\beta}_1 = \frac{\sum (x_i-\bar{x})(y_i-\bar{y})} {\sum (x_i-\bar{x})^2} = \frac{3.75+0.25+0.25+3.75}{2.25+0.25+0.25+2.25} = \frac{8}{5} = 1.6, \qquad \hat{\beta}_0=4.5-(1.6)(1.5)=2.1. $$

The fitted conditional mean is \(\hat{Y}=2.1+1.6X\). If a missing-\(Y\) case has \(X=1.5\), its fitted mean is \(2.1+(1.6)(1.5)=4.5\). If another has \(X=2.5\), its fitted mean is \(2.1+(1.6)(2.5)=6.1\). These are fitted means, not a demonstration that the completed data should simply use those values as imputations. A real update must follow the specified imputation rule, and model adequacy should be checked using the available observed data and the imputation output.

This distinction is important in a sweep: fitting the conditional model is one operation, applying its update rule is another. Merely computing predictions for missing cases does not, by itself, describe a full MICE update. The binary example made the update rule explicit with Bernoulli draws; the linear calculation isolates the fitting arithmetic so that the distinction is visible.

Auditing a Sweep and Recognizing Failure

A useful audit records, for every target, the model fitted, the cases used to fit it, the predictors’ current values, and the values produced by the update. This makes it possible to detect errors that a final completed dataset might conceal. For example, a model fitted for \(B\) before the \(A\) update has been applied is not following an \(A\)-then-\(B\) sweep. Nor is a model for \(B\) using newly updated \(A\) in some rows and stale values in others unless that is explicitly part of the defined procedure.

Common warning signs include failed model fitting, separation or extremely sparse categories for a binary target, predictions outside the permitted range, implausible values for a continuous target, and updates that are identical for every missing case despite meaningful predictor differences. These signs call for investigation, not automatic acceptance of the output. They may reflect a misspecified model, insufficient information, coding errors, or a poor fit between the model and the data.

A sweep is also not the same as fitting one joint model for all variables. FCS fits separate conditional models and applies them in sequence; a joint-model approach specifies a joint distribution directly. Nor is a sweep the same as pooling: pooling combines estimates and uncertainty from multiple completed datasets, whereas a sweep is an operation within the iterative construction of imputed values. Rubin’s Rules concern the former, not the mechanics of this single pass.

Common pitfall: Treating the sweep as simultaneous, a learner might fit every conditional model using only the dataset at the start of the pass, then apply all fitted models together. That discards the defining sequential update: later conditional models should use the current state after earlier updates in the specified order. A different but equally serious error is to treat fitted means or probabilities as though they were automatically the missing values. Always distinguish model fitting from the update rule that applies the model.

A correctly executed sweep is still only one pass. Its completion is not evidence that the chain has stabilized, that the conditional models are mutually coherent, or that the imputations support valid inference. Those questions require assessment beyond the arithmetic and bookkeeping of a single sweep. In practice, save enough information to reproduce each update and inspect both model diagnostics and the resulting values.

Worked Example: Checking the Update Order

Suppose a sweep is ordered \(C\), then \(D\), where both variables are incomplete. At the start of the pass, a row has current \(C=0\) and missing \(D\). The \(C\) update assigns \(C=1\) for that row. When fitting the conditional model for \(D\), which value of \(C\) belongs to the row’s current state?

The value is \(C=1\), because the \(C\) update has already been applied. If the \(D\) model uses \(C\), it must use the updated value in this row, subject to the specified model and fitting data. Using \(C=0\) would use the start-of-sweep snapshot and would not implement the stated \(C\)-then-\(D\) sequence. This check concerns the sweep’s data flow; it does not determine whether \(C\) is a suitable predictor for \(D\).

Key takeaway: For each incomplete variable in the specified order, fit its conditional model, apply that model’s update rule to its missing entries, and carry the resulting dataset state forward. The sweep’s central feature is sequential use of the current state, not simultaneous replacement.

Check Your Understanding

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

  1. A sweep is ordered \(R\) then \(S\). After updating missing \(R\), which state of \(R\) should the \(S\) update use?
  2. A binary conditional model estimates \(\widehat{P}(T=1\mid W=1)=0.40\). Under the update rule that assigns 1 when \(u\) is less than this probability, what value is assigned for \(u=0.25\), and for \(u=0.65\)?
  3. A fitted linear model gives \(\hat{Y}=3+2X\). What fitted mean does it give at \(X=4\), and why is that not necessarily the imputed value?
  4. What is the main difference between a conditional update sweep and pooling estimates with Rubin’s Rules?

Solutions. (1) Use the current, updated \(R\) values: the \(S\) update follows the \(R\) update in the specified sequence. (2) For \(u=0.25\), \(0.25<0.40\), so assign \(T=1\); for \(u=0.65\), the inequality does not hold, so assign \(T=0\). (3) The fitted mean is \(3+(2)(4)=11\). It is a model prediction, not necessarily the imputed value, because the imputation update rule may account for uncertainty and residual variation. (4) A sweep sequentially updates missing values using conditional models; Rubin’s Rules combine estimates and uncertainty across completed datasets.

Clinical Biostats