Do the points follow a curve instead of a straight line? (curve fitting, growth, dose-response)
In brief
If the points in the scatter plot do not follow a straight line, a curve may fit better. Statable calculates several shapes and shows the R² (how much of the spread of y the curve explains) for all on the scale of y, so that they are comparable.
When
Two number columns whose relationship looks curved, for example growth that approaches saturation, or a dose-response curve. Some shapes need x > 0 or y > 0; Statable says why a shape is missing.
How it works in Statable
- Run the card "Are two things related?" with the two number columns; under the scatter plot appears the section "Curve instead of a straight line? (curve fitting)".
- Under "Which curve to show?" choose a shape: straight line, parabola (quadratic), logarithm, exponential, power, logistic growth, Gompertz or dose-response (4PL).
Reading the result
- The table "Comparison of the curves" gives the equation, R² and the adjusted R² for each shape. The adjusted R² allows for the fact that a shape with more numbers (the parabola has three) always hits the points better than a straight line.
- In the chart the chosen curve lies over the points, with the straight line dashed beside it. For the shapes with saturation or dose-response a further table shows the coefficients (for example upper limit K, steepness r, midpoint x₀) with standard error and 95% interval.
What is often misunderstood
- The simplest shape that suits the matter is best. A curve is no explanation.
- Outside the data (extrapolation) curves often predict nonsense: a parabola turns round, an exponential curve grows without limit.
- Statable calculates exponential and power via the logarithms of y (as Excel does). The curve then minimises the deviations of the logarithms, not of the original values. The R² is nevertheless on the scale of y.
- The intervals of the coefficients are approximations (Wald); with few points or flat curves they can be too narrow.
Reporting the result
Report: the form of the curve with equation, the method (least squares, for nonlinear forms with starting values), the number of points, the coefficients with standard error and 95% interval, R² and adjusted R². Also: the comparison with the straight line and with the other forms tried (the choice of form should be justified, not rest only on the highest R²), the range of x values for which the curve holds, and the note that R² is only a rough guide for nonlinear models (Spiess & Neumeyer 2010, BMC Pharmacology 10, 6).
The relationship between … (x) and … (y) was described with [a straight line/a parabola/a logistic curve/…], y = … (n = …). The coefficients were K = … (SE = …, 95% CI […, …]), r = …, x₀ = …; R² = …, adjusted R² = … (straight line for comparison: R² = …). The curve holds in the range x = … to ….
For specialists
Least squares (normal equations) for line, parabola and the linearised shapes; logistic y = K / (1 + e^(-r (x - x₀))), Gompertz y = K e^(-b c^x) and 4PL y = u + (o - u) / (1 + (x / e)^b) with nonlinear least squares (Levenberg-Marquardt). R² = 1 - Σ residual² / Σ total² on the scale of y. Reference values: R lm(), SSgompertz, drc::LL.4.
Sources
Ritz, C., Baty, F., Streibig, J. C. & Gerhard, D. (2015). Dose-response analysis using R. PLoS ONE, 10(12), e0146021. Seber, G. A. F. & Wild, C. J. (1989). Nonlinear regression. Wiley.