AnsRioSmart tools. Clear answers.
Home / Math & statistics / Simple linear regression
Math & statistics

Simple linear regression

Simple linear regression with an explained formula, a worked example and checks for invalid or unsupported inputs.

Make it your own ⌁ Runs on your device

Your inputs are processed locally and are not added to analytics or saved history.

YOUR RESULT
Ready when you are.

Enter your values, then select Calculate.

How it works

Ordinary least squares: slope = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)²; intercept = ȳ−slope×x̄. Predict y = intercept+slope×x.

Input definitions

X values
Plain text; maximum 200,000 characters.
Y values
Plain text; maximum 200,000 characters.
X value to predict
Enter the value in the labeled unit.

A worked example

X values
1, 2, 3
Y values
2, 4, 6
X value to predict
4
8

Assumptions & limits

One predictor and an intercept, paired finite numeric data. No uncertainty interval or significance test.

Sources & review

Maintained by AnsRio. Methods and examples use automated checks; this does not imply independent professional certification.

Method updated 2026-10-17. Content checked against the stated method and examples. Our verification approach.

Common questions

Does a high R² prove that X causes Y?

No. R² describes how much sample variation this straight-line fit explains. Confounding variables, selection effects and extrapolation can make a prediction misleading.

Why can statistical results differ between tools?

Denominator, interpolation and boundary conventions can differ. Use the method and assumptions on this page to compare the same definition; displayed decimals may also be rounded.

How does the Simple linear regression tool work?

Ordinary least squares: slope = Σ(x−x̄)(y−ȳ)/Σ(x−x̄)²; intercept = ȳ−slope×x̄. Predict y = intercept+slope×x.

What are the assumptions and limits of Simple linear regression?

One predictor and an intercept, paired finite numeric data. No uncertainty interval or significance test.

↗
Made for the question in front of you.

No sign-up. Tool inputs stay on your device.

How we work