Regression calculator

Linear, quadratic, exponential, power and log regression with R². Free, no sign-up.

Drag to pan, scroll to zoomOpen in graphing calculator
Quick answer

Paste x, y data and choose a model. The calculator finds the least-squares line or curve of best fit, for example y = 4.51x + 46.82 for the sample data, and reports R², the correlation coefficient r and the RMSE. It plots the data with the fitted curve and predicts y for any x.

How to use the regression calculator

  1. Paste or type your data: one x, y pair per line. Commas, spaces or tabs all work, and a header line is skipped.
  2. Choose a model: linear, quadratic, cubic, exponential, power or logarithmic.
  3. Read the fitted equation, R² and RMSE (and the correlation coefficient r for linear fits).
  4. Enter an x-value to predict y, then open the fit in the graphing calculator to keep exploring.

The least-squares line

For a linear fit, the slope is m = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² and the intercept is b = ȳ − m·x̄, where x̄ and ȳ are the means. Read the linear regression guide for what these numbers mean, and how to tell a good fit from a misleading one.

Frequently asked questions

What is R²?

The coefficient of determination: the share of the variation in y that the model explains. 1 is a perfect fit, 0 means the model explains nothing beyond the mean.

Which regression model should I choose?

Plot the data first. Straight-line trends suit linear; one bend suits quadratic; growth by a constant factor suits exponential; fast-then-slow growth suits logarithmic or power. Prefer the simplest model with a good R², and check that the curve makes sense outside your data.

How is the fit calculated?

By least squares: the parameters minimise the sum of squared differences between the data and the model. Nonlinear models are solved with the Levenberg–Marquardt algorithm, so exponential and power fits are fitted to the original data, not to logged data.

Can I do this in the graphing calculator?

Yes. Add a table, enter your data, and type y_1 ~ m x_1 + b (or any model using ~). The parameters, R² and the best-fit curve update as you edit the table.