Tutorials › Regression Analysis (Undergraduate) › A Cubic Dose-Response Example

Polynomial Regression · Tutorial 435 of 991

A Cubic Dose-Response Example

Use a fitted cubic curve to trace how a hypothetical response changes with dose, including its local slopes and two turning points.

Intermediate 10 min read

What You'll Learn

  • Write and interpret a cubic dose-response regression model.
  • Calculate fitted responses at selected doses.
  • Differentiate a cubic curve to find its local slope at a dose.
  • Solve for stationary points and classify them as local maxima or minima.
  • Check whether calculated turning points lie within the observed dose range.
  • Distinguish a fitted association from evidence of a causal dose effect.

Why a Cubic Dose-Response Curve?

A dose-response relationship need not keep bending in one direction. A response might initially rise as dose increases, then fall, and then rise again. A cubic regression curve can represent this pattern because its slope can change direction at two distinct doses. This makes it useful for describing complex curvature over a specified range, while also making it important to interpret the curve carefully rather than treating its coefficients as stand-alone effects.

The example in this tutorial is entirely hypothetical. Suppose a researcher measures a response score, in points, at doses measured in milligrams. The analysis uses one independent observation per experimental unit, and the observed doses range from 0 to 4 mg. Assume the dose groups cover that range adequately and that plots of residuals show no strong pattern or change in spread. These checks support using a cubic mean curve with independent, mean-zero errors of roughly constant variance as a working model. They do not prove the model is exactly correct. The calculations below describe the fitted curve; they do not by themselves establish that changing dose causes a response change.

The Cubic Model and Its Interpretation

Definition: A cubic regression model for response \(Y_i\) at dose \(x_i\) is \(Y_i=\beta_0+\beta_1x_i+\beta_2x_i^2+\beta_3x_i^3+\varepsilon_i\). Here \(\beta_0,\beta_1,\beta_2,\beta_3\) are coefficients, and \(\varepsilon_i\) is the error for observation \(i\). The model assumes the conditional mean response follows the cubic expression, errors have mean zero and constant variance, and observations are independent. Normal errors are an additional assumption when using normal-theory inference, but are not needed to calculate fitted values or slopes.

For a fitted model, the predicted mean response at dose \(x\) is \(\hat{y}(x)=\hat{\beta}_0+\hat{\beta}_1x+\hat{\beta}_2x^2+\hat{\beta}_3x^3\). The squared and cubed dose terms let the curve bend; the coefficients should be interpreted together, not as separate constant changes in response per milligram. In particular, the slope depends on the dose.

Suppose a least-squares analysis of hypothetical observations produces the fitted equation \(\hat{y}(x)=12+4x-3x^2+0.5x^3\), where \(x\) is dose in mg and \(\hat{y}\) is response in points. This curve is to be interpreted over the observed 0-to-4 mg range. The intercept, 12 points, is its fitted response at zero dose. The remaining coefficients combine to determine predictions and slopes at other doses.

Worked Example: Calculating Fitted Responses

Using the hypothetical fitted curve \(\hat{y}(x)=12+4x-3x^2+0.5x^3\), calculate fitted responses at doses 1, 2, and 4 mg. Each dose is within the observed range, so these are interpolations rather than predictions beyond the studied doses.

At 1 mg, substitute \(x=1\): \(\hat{y}(1)=12+4(1)-3(1^2)+0.5(1^3)=12+4-3+0.5=13.5\) points.

At 2 mg: \(\hat{y}(2)=12+4(2)-3(2^2)+0.5(2^3)=12+8-12+4=12\) points.

At 4 mg: \(\hat{y}(4)=12+4(4)-3(4^2)+0.5(4^3)=12+16-48+32=12\) points.

The fitted response at 1 mg is 13.5 points and at both 2 and 4 mg is 12 points. These are model predictions of the mean response, not claims that every individual at those doses would have exactly that score. The dose range and residual checks described above make the curve a reasonable summary for this example, but do not guarantee accurate predictions for every observation.

Local Slopes and Turning Points

The derivative of a fitted curve gives its local slope: the rate at which the fitted response changes for a small increase in dose at a specified dose. For the general cubic fitted curve, differentiation gives

$$ \frac{d\hat{y}(x)}{dx}=\hat{\beta}_1+2\hat{\beta}_2x+3\hat{\beta}_3x^2. $$

If dose is measured in mg and response in points, the derivative is measured in points per mg. A positive derivative means the fitted response is increasing at that dose; a negative derivative means it is decreasing. Its magnitude describes the local rate, not the total response change across a wide dose interval.

A stationary point occurs where the derivative is zero. For a cubic, the derivative is a quadratic, so it can have no more than two real roots. A stationary point is a local maximum or minimum if the derivative changes sign there. The second derivative, \(2\hat{\beta}_2+6\hat{\beta}_3x\), can help distinguish them: a negative value at a stationary point indicates a local maximum, and a positive value indicates a local minimum.

Derivation: For the fitted curve \(12+4x-3x^2+0.5x^3\), differentiate each term: the constant has derivative 0, \(4x\) has derivative 4, \(-3x^2\) has derivative \(-6x\), and \(0.5x^3\) has derivative \(1.5x^2\). Thus the slope is \(4-6x+1.5x^2\). Setting it equal to zero gives \(1.5x^2-6x+4=0\). By the quadratic formula, \(x=[6\pm\sqrt{(-6)^2-4(1.5)(4)}]/[2(1.5)]=(6\pm\sqrt{12})/3=2\pm2/\sqrt{3}\). These are the only stationary points because this derivative is quadratic.

Worked Example: Finding and Classifying Two Turning Points

Find the stationary points of the fitted curve and decide whether each is a local maximum or minimum. The observed dose range is 0 to 4 mg, so check whether each calculated dose lies in that range.

The stationary doses from the derivation are \(2-2/\sqrt{3}\) and \(2+2/\sqrt{3}\). Since \(2/\sqrt{3}\approx1.155\), they are approximately \(0.8453\) mg and \(3.155\) mg. Both lie between 0 and 4 mg.

The second derivative is \(-6+3x\). At \(x\approx0.8453\), it is \(-6+3(0.8453)\approx-3.464\), which is negative; this is a local maximum. At \(x\approx3.155\), it is \(-6+3(3.155)\approx3.464\), which is positive; this is a local minimum.

The corresponding fitted responses can be evaluated using the curve. For a convenient calculation, write \(x=2+t\). Expanding the fitted equation gives \(\hat{y}(2+t)=12-2t+0.5t^3\). At the stationary points, \(t=\pm2/\sqrt{3}\). Therefore the fitted response at the first point, where \(t=-2/\sqrt{3}\), is \(12+4/\sqrt{3}-4/(3\sqrt{3})=12+8/(3\sqrt{3})\approx13.54\) points. At the second point it is \(12-8/(3\sqrt{3})\approx10.46\) points.

Within the observed range, the fitted curve reaches a local maximum of about 13.54 points near 0.845 mg and a local minimum of about 10.46 points near 3.155 mg. These describe features of the fitted mean curve, not necessarily the largest or smallest individual observed scores.

Worked Example: Comparing Local and Average Slopes

Calculate the local slope at 1, 2, and 3 mg, then compare the slope at 2 mg with the average fitted change from 1 to 3 mg.

The derivative is \(\hat{y}'(x)=4-6x+1.5x^2\). At 1 mg, \(\hat{y}'(1)=4-6+1.5=-0.5\) points per mg. At 2 mg, \(\hat{y}'(2)=4-12+6=-2\) points per mg. At 3 mg, \(\hat{y}'(3)=4-18+13.5=-0.5\) points per mg. The negative slopes indicate that the fitted response is decreasing locally at each of these doses.

From the first example, \(\hat{y}(1)=13.5\) points and \(\hat{y}(3)=12+12-27+13.5=10.5\) points. The average fitted change per mg from 1 to 3 mg is \((10.5-13.5)/(3-1)=-3/2=-1.5\) points per mg.

The average slope over that interval is \(-1.5\) points per mg, whereas the local slope at 2 mg is \(-2\) points per mg. They differ because the slope changes across the interval. A local derivative should not be described as the total response change over a multi-milligram increase.

Reading the Dose Pattern Responsibly

The derivative also makes the overall pattern easier to summarize. For this fitted curve, the slope is positive at dose 0 mg, negative between the two stationary doses, and positive again above the second stationary dose. Thus the fitted response first increases, then decreases, then increases over the observed range. The two stationary doses mark the changes in direction. A cubic can have fewer than two stationary points if its derivative has fewer than two real roots, and stationary points outside the observed range should not be described as observed-range turning points.

This kind of summary can help compare a simple monotone description with a pattern that has more curvature. However, the polynomial form is an approximation, not a biological mechanism. Even when dose was assigned experimentally, interpretation of causal effects depends on the study design and its assumptions; a fitted cubic alone cannot establish causation. The curve should also be used cautiously outside the dose range represented by data.

Key takeaway: A fitted cubic describes a dose-dependent mean curve. Evaluate the curve for fitted responses, differentiate it for local slopes, and solve its derivative for stationary doses. Interpret each result with its units and check whether the dose lies within the observed range.

Common Mistakes

  • Reading a coefficient as a constant dose effect. The coefficient of \(x\) is not the slope at every dose. The actual slope is \(\hat{\beta}_1+2\hat{\beta}_2x+3\hat{\beta}_3x^2\).
  • Calling every stationary point a maximum or minimum without checking. A zero derivative identifies a stationary point. Check the derivative's sign change or the second derivative to classify it.
  • Ignoring the observed dose range. A mathematically calculated turning point outside the data range is not evidence of a turning point among the observed doses.
  • Confusing a local slope with an interval change. A derivative is a rate at one dose. For a finite interval, calculate the difference in fitted responses and divide by the dose difference.
  • Claiming causation from the curve alone. Regression describes a modeled relationship; causal interpretation requires support from the study design and its assumptions.

Check Your Understanding

Use the fitted curve \(\hat{y}(x)=12+4x-3x^2+0.5x^3\) where helpful.

  1. What is the fitted response at 3 mg? Show the substituted values and arithmetic.
  2. Write the derivative of the fitted curve and give its units.
  3. Why can a cubic have at most two stationary points?
  4. How would you classify a stationary point where the second derivative is positive?
  5. Explain why a stationary dose outside the observed 0-to-4 mg range should be interpreted cautiously.