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.

Enter your values ⌁ Runs on your device

Your inputs stay in this browser and are not saved to an account.

YOUR RESULT
Ready when you are.

Enter your values, then select Calculate.

QUICK ANSWER

8

Use the inputs above for your own values. The result follows the method and assumptions shown below.

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 are reviewed against the stated formula; this is not professional certification.

Method updated 2026-11-18. Reviewed against the stated method and example. Our verification approach.

Report an issue with this tool or suggest an improvement ↗

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.

↗
Private tools for everyday decisions.

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

How we work