▚DATAJIN

Simple linear regression calculator

Simple linear regression fits the straight line that best predicts one variable (Y) from another (X) by least squares. It tells you how much Y changes for each unit of X (the slope), where the line crosses the axis (the intercept) and how much of the variation in Y the line explains (R²).

No sign-up, nothing to install. Calculations run in your browser; the worksheets, results and charts you create are stored by AI Walay to improve DATAJIN.

When to use it

  • Calibration curves and standard curves in the lab.
  • Predicting one measurement from another, such as weight from height.
  • Estimating a rate of change over time.

Assumptions

  • The relationship between X and Y is linear.
  • Residuals are independent, roughly normal and have constant variance.
  • X is measured with little error compared with Y.

How to run it in DATAJIN

  1. Put X in one column and Y in the next, one observation per row.
  2. Open Analyze and choose Simple linear regression.
  3. Select X first, then Y, and click Run. Use Graphs → XY scatter with a linear trendline to see the fit.

Example: open the Old Faithful geyser dataset (Old Faithful eruption duration (X) against waiting time (Y)) and follow the steps above.

What you get

  • Intercept and slope with standard errors and 95% confidence intervals
  • R², adjusted R² and residual standard error
  • F statistic and p-value for the slope, and N

How to interpret the result

The slope is the expected change in Y per one-unit increase in X; if its p-value is below 0.05 (and its 95% CI excludes 0) the relationship is significant. R² is the share of the variation in Y explained by X. Report, for example: Y = 2.1 + 0.84X, R² = 0.72, F(1, 18) = 46.3, p < 0.001.

Frequently asked questions

What is a good R² value?

It depends on the field: calibration curves often exceed 0.99, while social-science models with R² of 0.2–0.3 can still be useful. A high R² does not prove the model is right; check the scatter plot.

Regression or correlation?

Correlation measures the strength of association symmetrically. Regression predicts Y from X and gives the slope in real units. For simple linear regression, R² equals the square of Pearson’s r.

What if the relationship is curved?

Try polynomial regression, or nonlinear regression with a model such as exponential growth or a dose–response curve.