45 Polynomial Regression
Nitrogen does not help wheat yield indefinitely. Response curves in agronomy typically rise steeply at low doses, flatten out as the crop’s uptake capacity is reached, and can even turn downward at very high doses through lodging, delayed maturity, or greater disease pressure. A straight line cannot represent a curve that bends and then reverses direction. Polynomial regression can, by adding higher-degree terms of the same predictor:
\[ Y = \beta_0 + \beta_1 X + \beta_2 X^2 + \cdots + \beta_n X^n + \varepsilon \]
The \(X^2\), \(X^3\), and higher terms let the fitted curve bend, while the model is still fit using ordinary least squares, since it is linear in the coefficients even though it is not linear in \(X\).
45.1 Choosing the Degree
A degree-2 (quadratic) term is usually enough to capture a rise-then-plateau or rise-then-decline pattern, which covers most nitrogen response curves. Going higher, degree 3 or beyond, tends to chase noise in the sample rather than the true agronomic relationship, and the fitted curve can start to wiggle in ways that have no biological meaning. As a rule of thumb, add a higher-degree term only when a lower-degree model visibly fails to track the shape of the data, and always plot the fitted curve against the raw points before trusting it.
45.2 Worked Example
A different research trial tested a wider range of nitrogen doses than the earlier linear example, specifically to check whether yield keeps climbing at high doses or starts to level off.
| Nitrogen Dose (kg/ha) | Yield (quintals/ha) |
|---|---|
| 0 | 15 |
| 20 | 21 |
| 40 | 27 |
| 60 | 32 |
| 80 | 35 |
| 100 | 38 |
| 120 | 40 |
| 140 | 41 |
| 160 | 40 |
| 180 | 39 |
| 200 | 37 |
Yield rises through the middle of the range, peaks somewhere around 140 kg/ha, then declines at 160 and 180 kg/ha before falling further at 200. A straight line fit to this data would badly misrepresent both ends of the range: it would understate yield in the productive middle and overstate it at the highest doses.
45.3 Polynomial Regression in R
45.4 Interpreting the Fitted Curve
The fitted quadratic equation takes the form:
\[ \text{Yield} = \beta_0 + \beta_1 \times \text{Nitrogen} + \beta_2 \times \text{Nitrogen}^2 \]
The linear term \(\beta_1\) is positive, reflecting the initial rise in yield as nitrogen increases from zero. The quadratic term \(\beta_2\) is negative, which is what produces the eventual downturn: at low doses the positive linear term dominates, and as nitrogen grows the negative quadratic term increasingly pulls the curve back down. Setting the derivative of the fitted equation to zero gives the nitrogen dose at which predicted yield peaks, the agronomic optimum implied by this particular dataset. Reading that peak off the R output above, rather than quoting a fixed number here, is left as a check for the reader, since the exact figure depends on the precise coefficients the fitted model returns.
A Note on Extrapolation
A quadratic curve eventually turns downward on both ends by construction, whether or not that reflects biology. Predicting yield at, say, 400 kg/ha using this model would extrapolate far past the tested range and could produce a nonsensical negative yield. Polynomial models describe the relationship reasonably well within the range of doses actually tested; extrapolating beyond that range needs separate justification, ideally new field data.
Summary
| Concept | Description |
|---|---|
| Foundations | |
| Polynomial Regression | Adds higher-degree terms of the same predictor to fit a curved relationship, still estimated by least squares |
| Choosing the Degree | A quadratic term usually captures a rise-then-plateau or rise-then-decline pattern; higher degrees risk chasing noise |
| Worked Example | |
| Worked Example: Nitrogen Response Curve | Nitrogen doses from 0 to 200 kg/ha where yield rises, peaks, and then declines at the highest doses |
| Fitting a Quadratic Model in R | lm() with poly(x, 2, raw = TRUE) fits a quadratic model on the same dataset shown in the table |
| Interpreting the Linear and Quadratic Terms | A positive linear term and negative quadratic term together produce a rise, peak, and eventual decline |
| Cautions | |
| Risk of Extrapolation | A quadratic curve is only trustworthy within the range of doses actually tested in the data |