Tutorials › Nonlinear Mixed-Effects Models (NLME) › Continuous-by-Continuous Covariate Interactions

Functional Forms for Covariates · Tutorial 503 of 797

Continuous-by-Continuous Covariate Interactions

Learn to parameterize a continuous-by-continuous interaction on a parameter scale and interpret how each covariate’s effect depends on the other covariate.

Intermediate 10 min read

What You'll Learn

  • Define a two-covariate interaction using centered and scaled continuous covariates.
  • Interpret main-effect coefficients at the other covariate’s reference value.
  • Derive conditional slopes on both the log and parameter scales.
  • Calculate parameter predictions at specified covariate combinations.
  • Distinguish a covariate interaction from additive effects and assess its limitations.

Why Model an Interaction Between Continuous Covariates?

A covariate effect need not be the same across the range of another covariate. For example, an increase in body weight might correspond to a larger change in a model parameter among older individuals than among younger individuals. A continuous-by-continuous interaction represents this dependence with a product term. It lets the slope for one covariate change smoothly as the other covariate changes.

In an NLME model, the interaction is usually specified in the covariate model for a structural parameter, such as clearance or volume. This tutorial uses a log link for a positive parameter. That choice makes the coefficients describe multiplicative effects while keeping the parameter positive. The conditional slopes can then be derived on both the log scale and the original parameter scale.

Definition: Let \(x_1\) and \(x_2\) be continuous covariates, with meaningful reference values \(c_1\) and \(c_2\) and scale constants \(s_1\) and \(s_2\). Define \(z_1=(x_1-c_1)/s_1\) and \(z_2=(x_2-c_2)/s_2\). A log-linear interaction model for a positive individual parameter \(\theta_i\) is
$$ \log(\theta_i)=\log(\theta_{\mathrm{ref}})+\beta_1 z_1+\beta_2 z_2+\beta_{12}z_1z_2+\eta_i. $$

Here, \(\theta_{\mathrm{ref}}\) is the typical parameter value when both covariates are at their reference values, \(\beta_1\) and \(\beta_2\) are main-effect coefficients, \(\beta_{12}\) is the interaction coefficient, and \(\eta_i\) is the individual random effect for this parameter. The model implies

$$ \theta_i=\theta_{\mathrm{ref}}\exp\left(\beta_1z_1+\beta_2z_2+\beta_{12}z_1z_2+\eta_i\right). $$

The scale constants determine the units of the coefficients. For instance, if \(s_1=10\) years, then a one-unit increase in \(z_1\) is an increase of 10 years in \(x_1\). Centering makes the main-effect coefficients refer to the stated reference values rather than to an arbitrary zero. In the usual mean-zero random-effects formulation, setting \(\eta_i=0\) gives the typical parameter; it is not generally the population arithmetic mean of \(\theta_i\).

Conditional Slopes and the Interaction Coefficient

The interaction coefficient changes the slope of each covariate according to the value of the other. Holding \(z_2\) fixed, the slope of \(\log(\theta_i)\) with respect to \(x_1\) is

$$ \frac{\partial \log(\theta_i)}{\partial x_1} =\frac{\beta_1+\beta_{12}z_2}{s_1}. $$

Similarly, holding \(z_1\) fixed, the slope with respect to \(x_2\) is

$$ \frac{\partial \log(\theta_i)}{\partial x_2} =\frac{\beta_2+\beta_{12}z_1}{s_2}. $$

These are slopes on the log-parameter scale, in inverse units of the relevant covariate. On the original scale, the chain rule gives

$$ \frac{\partial \theta_i}{\partial x_1} =\theta_i\frac{\beta_1+\beta_{12}z_2}{s_1}, \qquad \frac{\partial \theta_i}{\partial x_2} =\theta_i\frac{\beta_2+\beta_{12}z_1}{s_2}. $$

Thus the original-scale slope depends both on the conditional log-scale slope and on the parameter value at that covariate combination. A positive log-scale slope means the parameter increases locally as that covariate increases, while a negative one means it decreases locally. The interaction coefficient alone does not determine whether either slope is positive or negative throughout the observed range.

Interpretation: \(\beta_1\) is the change in \(\log(\theta_i)\) for a one-unit increase in \(z_1\) specifically at \(z_2=0\), the reference value of \(x_2\). At a fixed \(z_2\), increasing \(z_1\) by one unit multiplies the typical parameter by \(\exp(\beta_1+\beta_{12}z_2)\). The coefficient \(\beta_{12}\) describes how the conditional log-scale slope changes as the other standardized covariate changes.

A useful way to see what the product term contributes is to compare four predictions. For the typical parameter, let \(\theta_{ab}\) denote the prediction at \(z_1=a\) and \(z_2=b\). The interaction contrast is

$$ \log(\theta_{11})-\log(\theta_{10})-\log(\theta_{01})+\log(\theta_{00})=\beta_{12}, \qquad \frac{\theta_{11}\theta_{00}}{\theta_{10}\theta_{01}}=\exp(\beta_{12}). $$

This is a difference-in-differences on the log scale, or equivalently a ratio of ratios on the parameter scale. It isolates the interaction from the two main effects in this model.

Worked Predictions and Conditional Effects

Worked Example: Clearance at a Specific Age and Weight

Suppose a hypothetical model for clearance \(CL_i\), measured in L/h, is

$$ CL_i=5.00\exp\left(0.08z_1+0.12z_2-0.05z_1z_2+\eta_i\right), \quad z_1=\frac{\text{age}-50}{10}, \quad z_2=\frac{\text{weight}-70}{10}. $$

Age is measured in years and weight in kg. Consider the typical prediction at age 50 years and weight 80 kg, so set \(\eta_i=0\). Then \(z_1=0\) and \(z_2=1\). Substitution gives

$$ CL_{\mathrm{typ}}=5.00\exp\left(0.08(0)+0.12(1)-0.05(0)(1)\right) =5.00\exp(0.12)=5.637\ \text{L/h}. $$

At this weight, the log-clearance slope per 10-year increase in age is \(0.08-0.05(1)=0.03\). The slope per year is \(0.03/10=0.003\ \text{year}^{-1}\). At the specified covariate combination, the local clearance slope is therefore

$$ \frac{\partial CL}{\partial \text{age}} =5.637(0.003)=0.01691\ \text{L/h per year}. $$

This is a local slope at age 50 years and weight 80 kg, not a constant increase in clearance across all ages and weights. The log-scale slope changes with weight, and the original-scale slope also changes with the predicted clearance.

Worked Example: Comparing Four Covariate Combinations

For a hypothetical positive parameter \(V_i\) in L, suppose

$$ V_i=1.20\exp\left(0.04z_1+0.10z_2+0.06z_1z_2+\eta_i\right), \quad z_1=\frac{\text{age}-40}{10}, \quad z_2=\frac{\text{weight}-60}{10}. $$

Compute typical predictions by setting \(\eta_i=0\). At the reference combination \((z_1,z_2)=(0,0)\), \(V_{00}=1.20\) L. At \((1,0)\), the exponent is \(0.04\), so \(V_{10}=1.20\exp(0.04)=1.249\) L. At \((0,1)\), \(V_{01}=1.20\exp(0.10)=1.326\) L. At \((1,1)\), the exponent includes both main effects and the interaction: \(0.04+0.10+0.06=0.20\), giving \(V_{11}=1.20\exp(0.20)=1.466\) L.

The interaction contrast is

$$ \log(V_{11})-\log(V_{10})-\log(V_{01})+\log(V_{00})=0.20-0.04-0.10+0=0.06. $$

Equivalently, \(V_{11}V_{00}/(V_{10}V_{01})=\exp(0.06)=1.062\), approximately. Thus the combined one-unit increases in the two standardized covariates produce a ratio about 1.062 times the ratio that would follow from multiplying their separate reference-level effects. These are model-based predictions, not evidence that changing age or weight causes a parameter change.

Worked Example: A Conditional Slope Can Change Sign

Suppose a hypothetical parameter \(Q_i\) in mg/h follows

$$ Q_i=4.00\exp\left(0.06z_1+0.02z_2-0.04z_1z_2+\eta_i\right), \quad z_1=\frac{x_1-30}{10}, \quad z_2=\frac{x_2-50}{10}. $$

At the reference value \(z_2=0\), the log-\(Q\) slope for a one-unit increase in \(z_1\) is \(0.06\). At \(z_2=2\), it is \(0.06-0.04(2)=-0.02\). Since one unit of \(z_1\) is 10 units of \(x_1\), the log-scale slope per unit of \(x_1\) at \(z_2=2\) is \(-0.02/10=-0.002\). At this covariate value, a one-unit increase in \(x_1\) multiplies the typical parameter by \(\exp(-0.002)=0.9980\), approximately, holding \(x_2\) fixed.

The conditional log-scale slope is zero when \(0.06-0.04z_2=0\), or \(z_2=1.5\), corresponding to \(x_2=50+10(1.5)=65\). The model therefore predicts a changing direction of association across \(x_2\), provided this value and the relevant covariate combinations are supported by the data. A mathematical turning point outside the observed covariate range should not be treated as an established empirical feature.

Derivation, Assumptions, and Practical Checks

The conditional-slope result follows directly by differentiating the specified covariate model. With \(\eta_i\) held fixed, its log form is

$$ \log(\theta_i)=\log(\theta_{\mathrm{ref}})+\beta_1\frac{x_1-c_1}{s_1} +\beta_2\frac{x_2-c_2}{s_2} +\beta_{12}\frac{(x_1-c_1)(x_2-c_2)}{s_1s_2}+\eta_i. $$

Differentiating with respect to \(x_1\), while holding \(x_2\) fixed, gives \(\beta_1/s_1+\beta_{12}(x_2-c_2)/(s_1s_2)\), which equals \((\beta_1+\beta_{12}z_2)/s_1\). Differentiating the exponential expression for \(\theta_i\) then multiplies this log-scale derivative by \(\theta_i\), giving the original-scale slope. The result assumes the chosen log-linear form is an adequate description over the covariate region being interpreted.

The model also relies on defensible reference values and scales, an adequately specified random-effects and residual model, and enough observed covariate combinations to distinguish the product term from the main effects. In particular, strong correlation between the covariates or a narrow range in one covariate can make the interaction difficult to estimate precisely. Centering can make coefficients easier to interpret, but does not create information or remove correlation from the data.

Useful checks include plotting the observed combinations of \(x_1\) and \(x_2\), examining whether predictions are being made within their supported range, and checking whether conditional predictions show systematic discrepancies across combinations. A trend in residual diagnostics with one covariate that differs by the other can suggest that the interaction form is inadequate. Also inspect uncertainty in the interaction estimate and the resulting conditional slopes: an estimated slope that changes sign may be poorly determined even when its point estimate crosses zero.

An additive model on the log-parameter scale omits \(\beta_{12}z_1z_2\), forcing the log-scale slope for each covariate to remain constant across the other. A continuous-by-categorical interaction instead allows slopes to differ across discrete groups; it does not represent a smoothly changing slope over a second continuous variable. An additive model on the original parameter scale is a different functional form, with different coefficient interpretations and potentially different predictions. The appropriate choice depends on the parameter scale selected for the scientific and modeling purpose, as in the earlier material on choosing parameter scales.

Common Mistake and Limitations

Common mistake: Interpreting \(\beta_1\) as the effect of \(x_1\) at every value of \(x_2\). In an interaction model, \(\beta_1\) is the log-scale effect for a one-unit increase in \(z_1\) only when \(z_2=0\). At other values, the corresponding coefficient is \(\beta_1+\beta_{12}z_2\). Calculate and report the conditional slope at the covariate value of interest.

The product term is a specific, bilinear interaction on the log-parameter scale. It does not guarantee that the true relationship has that shape, and it can imply implausible behavior when extrapolated far beyond the observed data. The model’s interpretation also depends on the selected scale: an interaction on the log scale is not the same as an interaction on the original parameter scale. Finally, a covariate relationship in a structural parameter does not translate automatically into the same slope in the measured outcome, because the structural model maps parameters to observations nonlinearly.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. In a log-linear parameter model, what does the main-effect coefficient for \(z_1\) represent when an interaction term is present?
  2. If \(\beta_1=0.05\), \(\beta_{12}=0.02\), and \(z_2=1.5\), what is the conditional log-parameter slope per unit of \(z_1\)?
  3. For \(\theta=\theta_{\mathrm{ref}}\exp(0.03z_1+0.04z_2-0.01z_1z_2)\), calculate the typical parameter at \((z_1,z_2)=(1,1)\) when \(\theta_{\mathrm{ref}}=2.00\) units.
  4. Why does centering covariates help interpret main effects, and what does centering not accomplish?
  5. What does a negative interaction coefficient alone establish about the conditional slope of \(z_1\)?

Solutions. (1) It is the log-parameter change for a one-unit increase in \(z_1\) when \(z_2=0\); elsewhere the slope is \(\beta_1+\beta_{12}z_2\). (2) \(0.05+0.02(1.5)=0.08\) per unit of \(z_1\). (3) The exponent is \(0.03+0.04-0.01=0.06\), so \(\theta=2.00\exp(0.06)=2.124\) units. (4) Centering makes zero correspond to a chosen meaningful reference value, so the main effects refer to that value. It does not add information or guarantee that the covariates are uncorrelated. (5) It establishes that the conditional log-scale slope for \(z_1\) decreases as \(z_2\) increases; it does not by itself establish whether that slope is positive or negative at any particular \(z_2\).