Why Parameterization Matters
A regression coefficient is defined by the model's parameterization. For a categorical predictor, changing the reference category or the numerical contrast assigned to categories can change the reported coefficients, including an interaction coefficient. That does not necessarily mean the fitted relationship has changed: two coefficient vectors may describe exactly the same fitted values and category-specific slopes.
This distinction matters in MICE when the analysis model includes a categorical interaction. Compatibility concerns the substantive relationship represented by the model, not whether its coefficients have the same names or numerical values under every coding. The comparison is valid only when the two specifications really are alternative parameterizations of the same model. If a coding change alters the restrictions on the category-specific relationships, it is a model change, not merely a change of coordinates.
A Binary Predictor: The Interaction Depends on Scale
Let \(G=0\) denote one group and \(G=1\) the other, and let \(X\) be a quantitative predictor. Consider the linear regression model
The model has a separate intercept and slope for each group. For \(G=0\), the intercept is \(\beta_0\) and the slope with respect to \(X\) is \(\beta_X\). For \(G=1\), the intercept is \(\beta_0+\beta_G\) and the slope is \(\beta_X+\beta_{GX}\). Thus \(\beta_{GX}\) is the difference in the two \(X\)-slopes, in the original \(G=0\) versus \(G=1\) direction.
Now define centered coding \(C=G-\tfrac12\). Then \(G=C+\tfrac12\). Substituting that identity into the model gives
The interaction coefficient remains \(\beta_{GX}\) with this particular centered coding, but the intercept and \(X\) main-effect coefficient change. The \(X\) coefficient now describes the slope at \(C=0\), which is the midpoint of the two groups, rather than the slope in the reference group.
A different coding changes the interaction coefficient's scale as well. Define \(D=2G-1\), so \(G=(D+1)/2\). Substitution yields
The coefficient of \(DX\) is half the original coefficient of \(GX\), because a one-unit change in \(D\) corresponds to a half-unit change in \(G\). The group-specific slopes and their difference have not changed. In the \(D\) parameterization, the slope difference from \(G=0\) to \(G=1\) is \(2\) times the coefficient of \(DX\).
Worked Example: Translating a Binary Interaction
Suppose a hypothetical analysis uses \(G=0\) for usual care and \(G=1\) for a new care pathway. The fitted conditional mean is \(Y=10+2G+3X+4GX\), where \(Y\) is an outcome in points and \(X\) is a predictor measured in hours. Check the assumptions: this calculation uses the stated linear mean model and assumes the same \(X\) scale in both groups; it makes no claim that the model is a correct causal model.
Under treatment coding, the usual-care slope is \(3\) points per hour. The new-pathway slope is \(3+4=7\) points per hour. Their difference, new pathway minus usual care, is \(7-3=4\) points per hour.
With \(D=2G-1\), the transformed coefficients are
Thus the same model is \(Y=11+D+5X+2DX\). At \(G=0\), \(D=-1\), so the \(X\)-slope is \(5-2=3\) points per hour. At \(G=1\), \(D=1\), so it is \(5+2=7\) points per hour. The slope difference remains \(7-3=4\) points per hour, equivalently \(2(2)=4\). Reporting the coefficient \(2\) as the group slope difference would be incorrect because it uses the wrong coding scale.
More Than Two Categories
The same principle applies to a factor with \(K\) categories. A full categorical-by-\(X\) interaction allows each category to have its own intercept and its own \(X\)-slope. Treatment coding expresses those quantities relative to a reference category. Other full-rank contrast systems express them through different linear combinations.
For example, let a three-category factor have levels A, B, and C. Under treatment coding with A as reference, write the category-specific slopes as
Here \(\beta_{BX}\) and \(\beta_{CX}\) are slope differences from A. Under a sum-to-zero contrast system, the coefficients instead describe a common component and deviations expressed using contrasts whose values sum to zero across categories. The numerical interaction coefficients need not equal the treatment-coded differences; the three slopes they jointly imply must agree if the models are equivalent.
Worked Example: Comparing Three Category-Specific Slopes
Suppose a hypothetical treatment-coded model estimates slopes of \(2\), \(5\), and \(1\) outcome points per hour for categories A, B, and C, respectively. The treatment-coded coefficients for the slope are therefore \(\beta_X=2\), \(\beta_{BX}=5-2=3\), and \(\beta_{CX}=1-2=-1\). These values fully specify the three slopes.
For an alternative contrast system, assign \((q_1,q_2)\) as follows: A has \((1,0)\), B has \((0,1)\), and C has \((-1,-1)\). These contrast columns each sum to zero. Write the slope as \(s=\gamma_X+\gamma_1q_1+\gamma_2q_2\). To reproduce the same three category slopes, solve
Adding the equations gives \(3\gamma_X=8\), so \(\gamma_X=8/3\). Then \(\gamma_1=2-8/3=-2/3\) and \(\gamma_2=5-8/3=7/3\). The implied C slope is \(8/3-(-2/3)-7/3=1\), as required. The alternative interaction coefficients, \(-2/3\) and \(7/3\), differ from the treatment-coded coefficients \(3\) and \(-1\); the category-specific slopes are nevertheless exactly \(2\), \(5\), and \(1\) points per hour. This is a reparameterization because all three category slopes remain freely represented.
Why Equivalent Codings Preserve the Model
The algebraic reason is that changing a full-rank contrast basis is an invertible change of coordinates. For a \(K\)-level factor, let the design columns consist of an intercept and \(K-1\) contrast columns. If a second coding spans the same contrast space, its columns can be obtained through an invertible linear transformation of those columns, possibly with a corresponding shift in the intercept representation. The interaction columns are the products of the contrasts with \(X\). Applying the same transformation to those columns preserves their span as well. Thus the full design matrices have the same column space, so each can represent the same fitted means.
This argument depends on including the full set of required terms. With an intercept, a full set of factor contrasts, \(X\), and all factor-by-\(X\) interactions, the model permits a separate intercept and slope for each category. If an interaction is omitted, or a constraint is imposed that ties slopes together, a coding change may not preserve the same space unless the corresponding constraint is also transformed.
Implications for MICE and Pooled Inference
When an analysis model contains a categorical interaction, an imputation procedure should preserve the substantive relationships represented by that model. Merely using a different valid contrast basis does not create a different target relationship if the model's column space is unchanged. For instance, a conditional model expressed with treatment contrasts and one expressed with a full-rank alternative contrast basis can encode the same category-specific slopes.
However, equivalent parameterizations must be distinguished from superficially similar formulas that impose different restrictions. Omitting an interaction, including only some contrast-by-\(X\) products, or using a constrained model can change which category-specific relationships are possible. These are substantive model differences, not harmless recodings. Also, finite-sample fitting details or coefficient priors that are not transformed consistently may prevent two implementations from behaving identically, even when their fixed-effect model spaces match.
Inference and pooling require a common estimand. If \(Q\) is a vector of coefficients under one coding and the desired coefficients under another coding are \(Q^*=LQ\), then the within-imputation covariance matrix must transform as \(U^*=LUL^{\mathsf T}\). Rubin's pooling calculations should be performed on estimates of the same quantity and its corresponding variance. For an estimand such as a category-specific slope difference, calculate or transform that difference within each imputed data set before pooling; do not average coefficients that represent different contrasts.
A joint test of an interaction is also invariant under a nonsingular reparameterization when the null hypothesis and covariance are transformed together. For a coefficient vector \(Q\) with covariance \(V\), the Wald statistic for \(Q=0\) is \(Q^{\mathsf T}V^{-1}Q\). If \(Q^*=LQ\) and \(V^*=LVL^{\mathsf T}\), with \(L\) invertible, then
The equality follows from \((LVL^{\mathsf T})^{-1}=(L^{\mathsf T})^{-1}V^{-1}L^{-1}\). This invariance applies to the same joint null, such as no interaction across the full set of contrasts. It does not mean that tests of individual coefficients with different meanings are interchangeable.
Worked Example: Transforming a Pooled Interaction Estimate
Suppose a hypothetical multiple-imputation analysis estimates a treatment-coded slope difference as \(\bar{Q}=4.0\) points per hour, with pooled standard error \(0.80\) points per hour. Under \(D=2G-1\), the corresponding interaction coefficient is half as large: \(Q^*=Q/2\). The transformed estimate is \(4.0/2=2.0\) points per hour on the \(D\)-coefficient scale. Because variance scales by the square of a multiplier, its standard error is \(0.80/2=0.40\) points per hour on that scale.
For the original substantive slope difference, convert back: \(2\bar{Q}^*=2(2.0)=4.0\) points per hour, with standard error \(2(0.40)=0.80\) points per hour. Both parameterizations therefore give the same estimate and uncertainty for the same group slope difference. The coefficient \(2.0\) alone is not that difference; it is the coefficient attached to \(DX\), whose scale requires multiplication by two.
Checks, Limitations, and Common Mistakes
A useful check is to compute the fitted intercept and slope for every factor category under each coding. If those values agree, the intended relationship has been preserved. For a numerical check, choose representative values of \(X\), calculate the fitted mean for each category, and verify that both formulas produce the same result. In an imputation workflow, compare the conditional relationships of interest rather than expecting raw coefficient tables to match.
This check can expose a missing interaction column, a contrast matrix that is not full rank, or a changed reference and interpretation that was not accounted for. It cannot establish that the model itself is scientifically adequate, that missingness assumptions hold, or that an imputation procedure is correctly specified. Equivalent coding preserves a model; it does not validate that model.
- Mistake: treating every coefficient as a coding-invariant effect. A coefficient is defined by its model term and coding. Translate it to a category-specific slope or contrast before comparing interpretations.
- Mistake: comparing interaction coefficients without checking their scale. With \(D=2G-1\), the coefficient of \(DX\) is half the \(G=0\)-to-\(G=1\) slope difference. Apply the correct multiplier.
- Mistake: assuming any recoding leaves the model unchanged. Verify full rank and confirm that all category-specific intercepts and slopes remain representable. A reduced or constrained interaction model may differ.
- Mistake: pooling unlike coefficients. Transform estimates and covariance matrices to the same estimand before pooling or comparing results.
Check Your Understanding
Answer each question, then check the solution immediately below it.
- A binary predictor is coded \(G=0,1\), and the coefficient of \(GX\) is \(6\). If \(D=2G-1\), what is the coefficient of \(DX\), and what is the slope difference from \(G=0\) to \(G=1\)?
Solution: Since \(G=(D+1)/2\), the coefficient of \(DX\) is \(6/2=3\). The slope difference is \(2(3)=6\) units of outcome per unit of \(X\), matching the original coding. - Under treatment coding for a three-level factor, the slopes are \(4\), \(1\), and \(6\) units per unit of \(X\) for A, B, and C. What are the two interaction coefficients when A is the reference?
Solution: The B-versus-A slope difference is \(1-4=-3\). The C-versus-A slope difference is \(6-4=2\). These are the treatment-coded interaction coefficients. - Two contrast systems give different coefficient values, but the computed slope for each category agrees. What does this indicate, and what does it not establish?
Solution: It indicates that the two parameterizations represent the same category-specific slopes, consistent with an equivalent model space. It does not establish that the model is scientifically adequate or that missing-data assumptions hold. - Why should the coefficient of \(DX\) not automatically be reported as the group slope difference when \(D=2G-1\)?
Solution: A change from \(G=0\) to \(G=1\) changes \(D\) from \(-1\) to \(1\), a two-unit change. Therefore the slope difference is twice the \(DX\) coefficient. - A coefficient vector is transformed by \(Q^*=LQ\). What covariance transformation is required to preserve its uncertainty representation?
Solution: Transform the covariance as \(U^*=LUL^{\mathsf T}\). When pooling, use estimates and variances that correspond to the same transformed estimand.