How To Calculate

Learn how to calculate anything
Menu
  • bmi
Home
statistics
How to Calculate Least Squares Regression Line.
statistics

How to Calculate Least Squares Regression Line.

Rosemary Njeri

Prior to discussing how to calculate least squares regression line let us define what a regression line is. A regression line is a straight line that describes how a response variable y changes as an explanatory variable x changes.

Ordinary least squares regression is a way to find the line of best fit for a set of data.

Formula to Calculate Squares Regression Line.

Since the line’s equation is y = mx + b, all we need to do is find the values of m (gradient) and b (y-intercept) using the following formulas.

Least Squares Regression Line.

N is the number of points

x,y are the values on the x and y axis.

 Least Squares Regression Line.

M is the gradient.

Example:

Suppose you found out how many hours of sunshine verse how many bottles of water were sold at the shop from Monday to Friday to be as follows;

Hours of Sunshine (x)Bottles of Water Sold (y)
612
510
48
57
59

Therefore, we will begin by finding the value of m.

We first need to find;

N = 5

Σx^2 = 625

Σy = 46

Σxy = 234

Σx = 25

Therefore m is;

 Least Squares Regression Line.

m = 0.00833

 Least Squares Regression Line.

Therefore, the y-intercept is 9.2.

If y = mx + b

Then y = 0.00833x + 9.2

Share
Tweet
Reddit
Pinterest
Email
Prev Article
Next Article

Related Articles

How to Calculate P Value from T.
P-value is the probability that a random chance generated the …

How to Calculate P Value from T.

How to Calculate Range.
We can define range of a list of numbers as …

How to Calculate Range.

Popular Posts

    Categories

    learntocalculate.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com.

    How To Calculate

    Learn how to calculate anything

    Pages

    • About Us
    • Contact Us
    • Privacy Policy
    Copyright © 2025 How To Calculate

    Ad Blocker Detected

    Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

    Refresh