Quadratic Regression Calculator

Some relationships bend. Growth that accelerates, trajectories that arc, responses that rise and then fall — a straight line through such data does not merely fit badly, it lies in a patterned way, under-predicting at both ends and over-predicting in the middle. Quadratic regression fits the simplest curve that can bend once: the parabola y = a + bx + cx². Paste your data, and this calculator returns the three coefficients by least squares, the R² that grades the fit, and predictions at any x — with the residuals’ behaviour, the bend’s direction, and the limits of second-degree ambition all explained below.







Least Squares, Bent

The fitting principle is the one from linear regression — choose the curve minimising the sum of squared vertical errors — promoted one degree. Setting the three partial derivatives of that error sum to zero produces three normal equations in the unknowns a, b, c, built from the power sums of x (Σx through Σx⁴) and the cross sums (Σy, Σxy, Σx²y). The calculator assembles them exactly as printed in any statistics text and solves the 3×3 system by Gaussian elimination. Three structural facts follow. With exactly three points the fit is exact (the parabola passes through all of them, R² = 1 by construction) — which is why the form demands at least four points before it will call the result a regression. The sign of c governs the shape: positive opens upward, negative arches downward, and a c statistically indistinguishable from zero is the data declining the curve and voting for the line. And the vertex, at x = −b/(2c), is either a discovery (a genuine optimum inside the data) or an artefact waiting beyond the range to embarrass extrapolators — the note under the answer tells you which neighbourhood it lives in.

Worked Example: A Parabola Hiding in Plain Sight

The defaults are six points generated near the curve y = x² + 2 with realistic wobble: (1, 2.9), (2, 6.2), (3, 10.8), (4, 18.1), (5, 26.9), (6, 38.2). The calculator’s least-squares verdict: a = 2.06, b = −0.074, c = 1.014, R² = 0.9999 — it recovers the generating parabola (intercept 2, no linear term, unit curvature) to within the noise, as it should. The prediction at x = 7: 2.06 − 0.074×7 + 1.014×49 ≈ 51.2, against the generating curve’s exact 51. Two reading lessons. First, the fitted b is not exactly zero and never will be on real data — noise distributes itself across all three coefficients, and small nonzero terms are the sound of an honest fit, not an error. Second, a straight line fitted to the same six points manages R² ≈ 0.957 — superficially respectable, while its residuals march in the tell-tale arc (+, −, −, −, −, +) — under-predicting at both ends, over-predicting in the middle — that announces a bend unmodelled. The R² comparison, and better the hub’s dedicated Coefficient of Determination Calculator, is how the improvement is quantified; the residuals, via the Residual Calculator, are where it is seen.

When the Quadratic Is the Wrong Tool

Four failure modes patrol this calculator’s borders. Extrapolation: a parabola’s arms accelerate forever — fitted on x from 1 to 6, it will happily predict y at x = 60 with total confidence and no basis; predictions belong inside or just past the data’s range. Overfitting by degree: with few points, any polynomial can be made to thread them exactly (n points, degree n−1, R² = 1, knowledge = 0); the quadratic earns its keep only when the bend is a feature of the phenomenon, not of the sample. Saturating phenomena: growth that levels off (learning curves, market saturation, dose responses approaching a ceiling) bends once and then flattens — a parabola instead predicts a decline; logistic and exponential-family models live in the neighbouring hub items for those shapes. Two-regime data: a kink (one process, then another) is not a curve; a parabola will average the two regimes into a fiction that fits neither. The diagnostic habit that catches all four is unglamorous: plot the residuals. Structure in them is the data requesting a different model, in handwriting.

The Family Resemblance

Quadratic regression sits in a family this hub is populating degree by degree, and the kinship is computational: linear regression is the same normal-equation machinery with a 2×2 system; cubic and quartic extend it to 4×4 and 5×5 (the hub’s Cubic, Polynomial and Quartic items), each degree buying one more possible bend at the price of one more coefficient for noise to hide in. The selection principle across the family is parsimony with evidence: raise the degree only when the residuals of the lower fit show the bend and the R² gain exceeds what an extra parameter buys by chance. Statisticians formalise that instinct (adjusted R², information criteria, cross-validation), but its working form is the one this page practices: fit the line, look at the arc in the residuals, then — and only then — invite the parabola in.

A Computational Refinement: Centring

One practical wrinkle deserves its paragraph because it startles everyone who compares software outputs: x and x² are strongly correlated over any positive range, which makes the raw coefficients a and b individually unstable — refit after adding a point and they swing, even while the curve itself barely moves. The standard remedy is centring: fit against (x − x̄) instead of x. Predictions, R² and the c coefficient are unchanged; a becomes the fitted value at the mean x (a much more meaningful “intercept”), and b becomes the slope at the centre of the data. This calculator fits the raw form — the form in the textbooks and in the question as usually asked — but a reader comparing its a and b against centred software output should expect different garnish on an identical curve. Judge fits by their predictions and residuals, which are representation-proof.

Testing Whether the Bend Is Real

Since a quadratic always fits at least as well as the line it contains, the honest question is whether the improvement exceeds what one free parameter buys by luck. The formal instrument is the extra-sum-of-squares F-test: compare the two fits’ residual sums, scaled by the error variance, against an F distribution with 1 and n − 3 degrees of freedom — in words, the squared-error reduction the cx² term achieved, taxed at the rate one parameter owes. Software reports this as the p-value on the quadratic term. The informal instruments, residual pattern and subject knowledge, usually agree with it; where they quarrel with the formal test, the quarrel itself is the finding — a bend that is statistically visible but physically inexplicable, or physically certain but statistically faint, both deserve their paragraph in any report.

Related Tools

More from the Statistics Calculators hub: the live Coefficient of Determination Calculator for grading any fit, the Residual Calculator for reading the errors, and the hub’s Descriptive Statistics Calculator for the data before any model touches it.

Frequently Asked Questions

How is quadratic regression different from linear regression?

One extra term and one possible bend. Linear regression fits y = a + bx (a straight line, constant rate of change); quadratic adds cx², letting the rate of change itself change at a constant pace — acceleration, in the physical dialect. The fitting machinery (least squares, normal equations) is identical, enlarged by one equation; the interpretive burden is the new term’s significance and the vertex’s location, both covered in the sections above.

What R² should I expect?

There is no universal pass mark — R² = 0.9999 in the worked example reflects data built near a true parabola; field data in the social sciences may be informative at 0.3. The meaningful comparisons are internal: quadratic versus linear on the same data (does the bend pay?), and the residuals’ pattern under each. A tiny R² gain for the curve, with structure still in the residuals, is the data declining both models politely.

Can the calculator predict beyond my data?

It will compute the parabola’s value at any x you enter — the arithmetic does not know where the data ended. You do, and the responsibility transfers accordingly: predictions just outside the range are wagers on the bend continuing; predictions far outside are numerology, since the arms of a parabola steepen without limit while real phenomena saturate, kink or stop.

Why does the fit need four or more points?

Because three points determine a parabola exactly — the “fit” would pass through all of them with zero residuals and an R² of 1 that certifies nothing. Regression begins where exactness ends: with more points than parameters, the residuals become evidence. More points also stabilise the coefficients; six to ten points spread across the range is a sane minimum for trusting the bend.

What if my relationship bends twice?

Then the quadratic is the wrong degree — an S or a rise-fall-rise wants a cubic (two bends), and the hub’s cubic item is the next stop. The symptom is recognisable in this calculator’s residuals: a wave pattern (the errors themselves bending twice) after the quadratic fit. Degree selection follows the bends in the phenomenon; the family exists so each shape has its instrument.

My c came out almost zero. What does that mean?

That the data, offered a bend, declined it: the least-squares parabola collapsed onto something very near the best straight line. Report the line (its coefficients are stabler and its story simpler), and keep the quadratic result as the evidence that the simpler model was tested, not assumed — a negative result with genuine value, of the kind good analysis collects deliberately.