Tutorials › Nonlinear Mixed-Effects Models (NLME) › Quadratic Covariate Effects and Turning Points

Functional Forms for Covariates · Tutorial 494 of 797

Quadratic Covariate Effects and Turning Points

You will fit and interpret a quadratic covariate effect on a model parameter, calculate its turning point, and distinguish an observed bend from an extrapolated one.

Intermediate 10 min read

What You'll Learn

  • Write a quadratic covariate effect on a model parameter using a meaningful reference value.
  • Interpret the linear and quadratic coefficients with their units.
  • Derive the covariate-specific slope and the turning point.
  • Determine whether a turning point falls within the observed covariate range.
  • Check positivity, data support, and uncertainty before interpreting a fitted curve.
  • Recognize when a quadratic relationship is an unsuitable functional form.

Why Model a Curved Covariate Effect?

A continuous covariate need not have the same direction or strength of association with a model parameter across its full range. For example, a parameter might increase at lower values of a covariate but level off and then decrease at higher values. A quadratic function can represent one such smooth bend. Its value is not that it guarantees a scientifically plausible curve; it gives a compact, interpretable way to express a particular shape and to check where that shape changes direction.

Here the quadratic relationship describes a model parameter as a function of a covariate. It does not mean that the observed response, such as concentration, is regressed directly on the covariate with a quadratic curve. The parameter remains part of the NLME model for the response, while the covariate helps explain differences in that parameter.

Definition and Interpretation

Definition: Let \(x_i\) be a continuous covariate for individual \(i\), and let \(x_{\mathrm{ref}}\) be a reference value. Write \(z_i=x_i-x_{\mathrm{ref}}\). A quadratic relationship on the parameter scale specifies the typical parameter as \(\theta_{\mathrm{typ}}(x_i)=\beta_0+\beta_1z_i+\beta_2z_i^2\). Here \(\beta_0\) is the typical parameter at the reference value, \(\beta_1\) is the slope there, and \(\beta_2\) determines how that slope changes with the covariate.

The coefficient units follow from the equation. If \(\theta\) is measured in L/h and \(x\) in kg, then \(\beta_0\) is in L/h, \(\beta_1\) in L/h per kg, and \(\beta_2\) in L/h per kg squared. Centering at a meaningful reference makes \(\beta_0\) interpretable and usually makes the linear coefficient easier to read: it is the local slope at \(x_{\mathrm{ref}}\), not an average slope over the whole covariate range.

For an individual with a positive parameter, one possible random-effects specification is \(\theta_i=\theta_{\mathrm{typ}}(x_i)\exp(\eta_i)\), where \(\eta_i\) is an individual random effect. If \(\eta_i\) is normally distributed with mean zero, \(\theta_{\mathrm{typ}}(x_i)\) is the conditional median parameter under this specification. The quadratic function is still on the parameter scale; applying a quadratic to the log parameter instead would be a different model. Whatever random-effects specification is used, the fixed covariate function and its interpretation should be stated clearly.

Slope and Turning Point

The slope describes how quickly the typical parameter changes for a small change in the covariate. Differentiating the quadratic function with respect to \(x\), and using \(z=x-x_{\mathrm{ref}}\), gives:

$$ \frac{d\theta_{\mathrm{typ}}}{dx}=\beta_1+2\beta_2(x-x_{\mathrm{ref}}). $$

The slope changes linearly with \(x\). If \(\beta_2>0\), it increases as \(x\) increases; if \(\beta_2<0\), it decreases. When \(\beta_2\ne 0\), the turning point is where the slope equals zero:

$$ x^*=x_{\mathrm{ref}}-\frac{\beta_1}{2\beta_2}. $$

Completing the square shows what this point means:

$$ \theta_{\mathrm{typ}}(x) =\beta_2\left[(x-x_{\mathrm{ref}})+\frac{\beta_1}{2\beta_2}\right]^2 +\beta_0-\frac{\beta_1^2}{4\beta_2}. $$

The squared term is smallest at zero. Thus, if \(\beta_2>0\), the turning point is a minimum; if \(\beta_2<0\), it is a maximum. If \(\beta_2=0\), the relationship is linear and has no unique turning point. A turning point calculated outside the observed covariate range is an extrapolation, not evidence that the data show a change of direction.

Worked Examples

Worked Example: A Maximum Outside the Observed Range

Suppose a hypothetical NLME fit estimates typical clearance as \(\theta_{\mathrm{typ}}(x)=5.0+0.040z-0.00050z^2\) L/h, where \(z=x-60\) and \(x\) is weight in kg. The individuals in the analysis have weights from 45 to 90 kg. Calculate the turning point and assess whether it is observed.

Here \(\beta_1=0.040\) L/h per kg and \(\beta_2=-0.00050\) L/h per kg squared. The turning point is:

$$ x^*=60-\frac{0.040}{2(-0.00050)} =60+40=100\text{ kg}. $$

Because \(\beta_2<0\), 100 kg is a maximum. Its predicted typical clearance is \(5.0+0.040(40)-0.00050(40^2)=5.0+1.6-0.8=5.8\) L/h. However, 100 kg is above the observed maximum of 90 kg, so this fitted maximum is not supported within the data range.

The slope at 90 kg is \(0.040+2(-0.00050)(90-60)=0.010\) L/h per kg, still positive. Thus the fitted relationship is increasing throughout the observed range; the fact that its extrapolated curve eventually turns downward should not be described as an observed decline.

Worked Example: A Minimum Just Beyond the Data

For a hypothetical model parameter measured in L, suppose the fitted function is \(\theta_{\mathrm{typ}}(x)=2.4-0.030z+0.00060z^2\), where \(z=x-50\) and \(x\) is a continuous covariate in the same units as the reference value 50. Observed values range from 30 to 70. Find the vertex and check the direction of change across the observed range.

Since \(\beta_2=0.00060>0\), the vertex is a minimum. Its covariate value is:

$$ x^*=50-\frac{-0.030}{2(0.00060)} =50+25=75. $$

The minimum is outside the observed range. At the lower endpoint, \(z=-20\), so the prediction is \(2.4-0.030(-20)+0.00060(400)=2.4+0.600+0.240=3.240\) L. At the upper endpoint, \(z=20\), giving \(2.4-0.600+0.240=2.040\) L.

The endpoint slopes are \(-0.030+2(0.00060)(-20)=-0.054\) L per covariate unit and \(-0.030+2(0.00060)(20)=-0.006\) L per covariate unit. Both are negative. The fitted parameter therefore decreases throughout the observed range, although its rate of decrease becomes smaller. Calling the data-supported pattern a U-shape would be misleading because the minimum at 75 lies beyond the observed maximum of 70.

Worked Example: A Turning Point Within the Observed Range

Consider a hypothetical typical parameter in L with fitted relationship \(\theta_{\mathrm{typ}}(x)=1.8+0.060z+0.0015z^2\), where \(z=x-50\). The observed covariate values range from 20 to 80. Calculate the turning point, its parameter value, and two endpoint predictions.

The turning point is \(x^*=50-0.060/[2(0.0015)]=50-20=30\). Because the quadratic coefficient is positive, this is a minimum. At the minimum, \(z=-20\), so the predicted value is \(1.8+0.060(-20)+0.0015(400)=1.8-1.2+0.6=1.2\) L.

At \(x=20\), \(z=-30\), and the prediction is \(1.8-1.8+0.0015(900)=1.35\) L. At \(x=80\), \(z=30\), giving \(1.8+1.8+1.35=4.95\) L. The minimum at 30 is inside the observed range, and the slope changes from negative below 30 to positive above it. The turning point is therefore within the range represented by the data, although its scientific credibility still depends on data density and model adequacy near 30.

Estimation, Checks, and Uncertainty

In an NLME analysis, the coefficients of the covariate function are estimated as part of the model fit, alongside the structural, random-effects, and residual-error parameters. The response observations and the fitted model inform those estimates; individual parameter estimates should not generally be treated as directly observed values and then used as if they were error-free data in an ordinary quadratic regression.

Before interpreting the fitted vertex, check that the quadratic form is plausible over the range of interest and that the data contain enough individuals across that range to inform the curvature. A fitted \(\beta_2\) can be weakly determined when the covariate values cluster near the reference or occupy only a narrow range. Also check predicted parameter values over the observed range. A direct quadratic on a positive parameter scale can predict zero or negative values; that is not acceptable for parameters that must be positive. A different parameterization may be needed if positivity cannot be maintained.

The turning point is itself estimated and can be unstable, especially when \(\beta_2\) is close to zero. For coefficient estimates \(\hat{\beta}_1\) and \(\hat{\beta}_2\), its estimate is \(\hat{x}^*=x_{\mathrm{ref}}-\hat{\beta}_1/(2\hat{\beta}_2)\). A first-order uncertainty approximation can be derived from the gradient of this function with respect to \((\beta_1,\beta_2)\):

$$ \nabla x^*= \left(-\frac{1}{2\beta_2},\frac{\beta_1}{2\beta_2^2}\right). $$

If the estimated covariance matrix of \((\hat{\beta}_1,\hat{\beta}_2)\) is \(V\), the delta-method approximate variance is \(\nabla x^* V (\nabla x^*)^\mathsf{T}\), evaluated at the estimates. When \(\hat{\beta}_2\) is near zero, the gradient can become very large, so this approximation and the point estimate may be unreliable. A point estimate inside the observed range alone does not establish a precisely located turning point.

Useful checks include plotting observed covariate support and model-based predictions, examining residual patterns across the covariate, and checking whether a small number of extreme covariate values are driving the curvature. If the fitted curve bends sharply where data are sparse, the apparent vertex may reflect extrapolation or model instability. These checks complement, rather than replace, the NLME model’s assessment of the response data.

Choosing and Interpreting the Functional Form

ApproachWhat it representsKey caution
Linear effect on the parameter scaleA constant change in the parameter per covariate unitCannot represent a change in direction
Quadratic effect on the parameter scaleA slope that changes linearly, with at most one turning pointCan behave implausibly outside the observed range
Exponential or power relationshipA multiplicative effect on the parameter scaleDoes not represent the same kind of bend as a quadratic on the parameter scale

A quadratic is a useful candidate when a single smooth bend is scientifically plausible and the observed data span the region needed to estimate it. It is not a flexible description of every nonlinear pattern: its curvature is constant, and it cannot represent multiple bends. Compare plausible forms using the same dataset and consider parameter interpretation, fit, stability, and clinical relevance together. A better numerical fit alone does not prove that the covariate relationship is real or clinically important.

Common Mistakes

  • Calling any quadratic vertex an observed turning point. Calculate \(x^*\), then compare it with the observed minimum and maximum covariate values. A vertex outside that range is extrapolated.
  • Ignoring the sign of the quadratic coefficient. Positive curvature gives a minimum; negative curvature gives a maximum.
  • Interpreting \(\beta_1\) as the slope everywhere. It is the slope at \(x_{\mathrm{ref}}\); elsewhere the slope is \(\beta_1+2\beta_2(x-x_{\mathrm{ref}})\).
  • Assuming a quadratic guarantees a valid parameter. Check predictions over the domain, particularly when the parameter must remain positive.
  • Treating a precise-looking vertex as certain. If curvature is weakly estimated, the turning point can be highly uncertain even when the fitted curve has a vertex.
Key takeaway: A quadratic covariate effect has a slope that varies with the covariate and a single mathematical turning point when \(\beta_2\ne0\). Interpret that point as data-supported only after checking that it lies in a well-represented part of the observed covariate range.

Check Your Understanding

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

  1. For \(\theta_{\mathrm{typ}}=4+0.08z-0.002z^2\), with \(z=x-10\), find the turning point in \(x\) and state whether it is a maximum or a minimum.
  2. For \(\theta_{\mathrm{typ}}=3-0.04z+0.001z^2\), with \(z=x-20\), calculate the slope at \(x=30\).
  3. If the observed covariate range is 5 to 25 and a fitted quadratic has its minimum at 31, what can and cannot be concluded about a change of direction?
  4. Why is a quadratic relationship on the parameter scale different from a quadratic relationship on the log-parameter scale?
  5. Name two checks that are important before interpreting a fitted turning point.

Solutions. (1) \(z^*=-0.08/[2(-0.002)]=20\), so \(x^*=10+20=30\). Since \(\beta_2<0\), it is a maximum. (2) The slope is \(-0.04+2(0.001)(30-20)=-0.020\) parameter units per covariate unit. (3) The minimum at 31 is outside the observed range, so the fitted curve does not show an observed change of direction between 5 and 25; it may predict a change beyond the data, but that is extrapolation. (4) A quadratic on the parameter scale models \(\theta\) as a polynomial, whereas a quadratic on the log scale models \(\log(\theta)\) as a polynomial and therefore gives a different relationship after exponentiation. (5) Examples include checking that the vertex is within a well-supported covariate range, inspecting data density near it, checking parameter predictions for positivity, and assessing residual patterns and curvature stability.