By Debmedia Technologies LLP · Kolkata, India · Updated
What Is It and When Do You Need It?
Linear regression draws the best straight line through a cloud of points. It is used to spot trends, forecast sales, calibrate instruments and teach statistics.
Enter your pairs, one per line, and read the line and its quality.
How to Use This Tool
- Enter one x and y pair per line, separated by a space or comma.
- Optionally enter an x to predict.
- Press Calculate.
- Read the equation, R squared and the prediction.
How the Calculation Works
The slope is b = (n Σxy − Σx Σy) ÷ (n Σx² − (Σx)²) and the intercept is a = (Σy − b Σx) ÷ n. The correlation r measures the strength of the linear link, R squared is r², and the standard error of the estimate shows the typical distance of the points from the line.
Worked Example
The points (1, 2), (2, 4), (3, 5), (4, 4), (5, 5) give y = 2.2 + 0.6x, with r = 0.7746 and R squared = 0.6. At x = 6 the prediction is 5.8.
Common Uses
- Trend lines and forecasts.
- Science and lab work.
- Business analysis.
- Homework and teaching.
Tips and Common Mistakes
- Look at the points as well as R squared.
- Outliers can pull the line a lot.
- Do not extend far beyond your data.
Related Tools
Next, you may need the correlation calculator, confidence interval calculator, percentile calculator, standard deviation calculator.
Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.
Frequently Asked Questions
Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.