# Quadratic Regression Calculator

URL: https://speedycalculator.com/calculators/statistics/quadratic-regression/
Last updated: 2026-10-30

> The quadratic regression calculator fits the parabola y = a₂x² + a₁x + a₀ to your data by least squares. It returns the equation, each coefficient with its standard error, R², adjusted R², the residual table, a chart of the curve through the points and a prediction at any x.

## Inputs

- x values
- y values — Same number of values as x
- Predict y at x = — Optional – leave empty to skip the prediction
- Precision (significant figures)

## Results

- Regression equation
- Scatter plot with the fitted curve
- Coefficient a₂ (x²)
- Coefficient a₁ (x)
- Coefficient a₀ (constant term)
- Coefficient of determination (R²)
- Adjusted R²
- Residual standard error
- Overall F-test
- Predicted y at the chosen x
- 95% prediction interval for a new y
- 95% confidence interval for the mean y
- Interpolation or extrapolation?
- Coefficients with standard errors and t-tests
- Fitted values and residuals
- Sum of squared residuals (SSE)
- Number of points

## Formula

```
Minimise Σ(y − a₀ − a₁x − a₂x²)² · normal equations (XᵀX)β = Xᵀy with columns 1, x, x² · vertex at x = −a₁ ÷ (2a₂)
```

## Explanation

Many relationships rise and then fall, or fall and then rise: the height of a thrown ball over time, crop yield against fertiliser, fuel consumption against speed, profit against price. A straight line cannot follow such a bend, but a parabola can. Quadratic regression finds the parabola y = a₂x² + a₁x + a₀ that sits as close as possible to all the points in the least-squares sense.

The sign of a₂ tells you the shape: negative for a hill (a maximum), positive for a valley (a minimum). The turning point lies at x = −a₁ ÷ (2a₂), which is often the most useful number of the whole analysis – the speed with the best fuel economy, the price with the highest profit.

Although the curve is bent, the model is still linear in its coefficients, so the same machinery as linear regression applies: the calculator solves a 3 × 3 system of normal equations, reports R² and adjusted R², gives the standard error and a t-test for each coefficient (a significant x² term means the curvature is real) and lists every residual so you can check the fit.

### How to use the Quadratic Regression Calculator

- **x values**
- **y values** — Same number of values as x
- **Predict y at x =** — Optional – leave empty to skip the prediction
- **Precision (significant figures)**

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

### How it works

The calculator builds the design matrix with columns 1, x and x², centres and scales x to keep the arithmetic stable, solves the normal equations and converts the coefficients back to powers of x. SSE, R², adjusted R² = 1 − (1 − R²)(n − 1)/(n − 3) and coefficient standard errors follow from the residuals.

### Worked example

A ball is thrown upward and its height (m) is measured every second: t = 0…6 s, y = 1.5, 25.2, 38.9, 42.1, 36.4, 20.8, 0.3. The least-squares parabola is **y = −4.587x² + 26.99x + 2.262** with R² = 0.9963 and a residual standard error of 1.29 m. The vertex is at t = −26.99 ÷ (2 × −4.587) ≈ 2.94 s. At t = 2.5 s the model predicts 41.07 m (95% prediction interval 36.97 to 45.17 m). The x² coefficient −4.587 is close to −g/2 = −4.905, as physics suggests.

### When to choose a quadratic model

- The scatter plot shows one bend – a single peak or trough.
- Residuals from a straight line form a U or an upside-down U.
- Theory predicts a squared term (free fall, area against length, cost curves).
- For S-shapes use cubic regression; for constant percentage growth use exponential regression.

## Worked example

Inputs — x values: 0, 1, 2, 3, 4, 5, 6; y values: 1.5, 25.2, 38.9, 42.1, 36.4, 20.8, 0.3; Predict y at x =: 2.5; Precision (significant figures): 4.

Results — **Regression equation = y = −4.587x² + 26.99x + 2.262**; Coefficient a₂ (x²) = -4.586905; Coefficient a₁ (x) = 26.989286; Coefficient a₀ (constant term) = 2.261905; Coefficient of determination (R²) = 0.99629; Adjusted R² = 0.99443.

## Key terms

- **Parabola**: The graph of a second-degree polynomial.
- **Vertex**: The turning point of the parabola, at x = −a₁ ÷ (2a₂).
- **Design matrix**: The table of 1, x and x² values used in the normal equations.
- **Adjusted R²**: R² penalised for the number of coefficients, so extra terms must earn their place.

## FAQ

**How many points do I need for quadratic regression?**
At least three different x values. With exactly three the parabola passes through every point (R² = 1), so use four or more to measure the fit.

**How do I find the vertex of the fitted parabola?**
x = −a₁ ÷ (2a₂). For the default data, −26.99 ÷ (2 × −4.587) ≈ 2.94, where y reaches about 41.97.

**Is quadratic regression linear or non-linear?**
It is a linear model, because y is a linear combination of the coefficients – only the predictor x is squared.

**How do I know whether the x² term is needed?**
Check its p-value in the coefficient table, or compare adjusted R² with the linear fit. A tiny gain in R² does not justify the extra term.

**Why do I get a different equation in Excel?**
Excel's polynomial trendline uses the same least-squares fit, so the coefficients should match – check that x and y are paired in the same order.

**What does a negative a₂ mean?**
The parabola opens downward and has a maximum; positive a₂ means a minimum.

**Can I use it to forecast?**
Only cautiously. Parabolas shoot off to ±∞ outside the data, so extrapolations quickly become unrealistic.


## Sources

- [Penn State STAT 462 – Applied Regression Analysis](https://online.stat.psu.edu/stat462/)
- [NIST/SEMATECH e-Handbook of Statistical Methods](https://www.itl.nist.gov/div898/handbook/)
- [Wolfram MathWorld – Probability and statistics](https://mathworld.wolfram.com/topics/ProbabilityandStatistics.html)
