
How do you calculate the slope and intercept of a regression line?
Answer
545.7k+ views
Hint: To calculate the slope and intercept of a regression line, we are going to take a set of data having x and y values. We are taking x and y values because we have to calculate the slope and intercept of a straight line and the straight line is of the form $ y=mx+c $ where “m and c” corresponds to slope and intercept of the straight line. We are taking the set of x and y values $ \left( x,y \right) $ as: $ \left( {{x}_{1}},{{y}_{1}} \right),\left( {{x}_{2}},{{y}_{2}} \right),\left( {{x}_{3}},{{y}_{3}} \right)......\left( {{x}_{n}},{{y}_{n}} \right) $ . So, we are going to write the formula for slope and intercept of a regression line which are the expressions containing x, y and n.
Complete step by step answer:
Let us assume that we have drawn the regression line using the following set of x and y values:
$ \left( {{x}_{1}},{{y}_{1}} \right),\left( {{x}_{2}},{{y}_{2}} \right),\left( {{x}_{3}},{{y}_{3}} \right)......\left( {{x}_{n}},{{y}_{n}} \right) $
The above coordinates are plotted on the graph where in each bracket, first coordinate is the x coordinate and the second coordinate is the y coordinate.
We know that the equation of a straight line contains a slope and intercept and in the below, we are writing the formula for slope and intercept of a regression line.
The formula for slope of the regression line is as follows:
$ m=\dfrac{n\sum{xy}-\left( \sum{x} \right)\left( \sum{y} \right)}{n\sum{{{x}^{2}}}-{{\left( \sum{x} \right)}^{2}}} $
Now, using the above set of x and y in the above equation we get,
$ m=\dfrac{n\left( {{x}_{1}}{{y}_{1}}+{{x}_{2}}{{y}_{2}}+{{x}_{3}}{{y}_{3}}+.....{{x}_{n}}{{y}_{n}} \right)-\left( {{x}_{1}}+{{x}_{2}}+{{x}_{3}}+....{{x}_{n}} \right)\left( {{y}_{1}}+{{y}_{2}}+{{y}_{3}}+....{{y}_{n}} \right)}{n\left( {{x}_{1}}^{2}+{{x}_{2}}^{2}+{{x}_{3}}^{2}+....{{x}_{n}}^{2} \right)-{{\left( {{x}_{1}}+{{x}_{2}}+{{x}_{3}}+....{{x}_{n}} \right)}^{2}}} $
The formula for intercept of the regression line is as follows:
$ c=\dfrac{\sum{y}-m\sum{x}}{n} $
Substituting the values of data sets of x and y in the above equation we get,
$ c=\dfrac{\left( {{y}_{1}}+{{y}_{2}}+{{y}_{3}}+.....+{{y}_{n}} \right)-m\left( {{x}_{1}}+{{x}_{2}}+{{x}_{3}}+....+{{x}_{n}} \right)}{n} $
In the above formula, substitute the value of m (which is the slope of the regression line) which we have calculated above.
In this way, we have shown the calculation of slope and intercept of a regression line for the given set of x and y.
Note:
Regression line we have to draw when we have a dependent and independent variable. The independent variable we have plotted on the x-axis and the dependent variable we have plotted on the y axis and then to get the best fit line which is passing through these points we need this slope and intercept formula. This is the example where we require calculating the slope and intercept of a regression line.
Complete step by step answer:
Let us assume that we have drawn the regression line using the following set of x and y values:
$ \left( {{x}_{1}},{{y}_{1}} \right),\left( {{x}_{2}},{{y}_{2}} \right),\left( {{x}_{3}},{{y}_{3}} \right)......\left( {{x}_{n}},{{y}_{n}} \right) $
The above coordinates are plotted on the graph where in each bracket, first coordinate is the x coordinate and the second coordinate is the y coordinate.
We know that the equation of a straight line contains a slope and intercept and in the below, we are writing the formula for slope and intercept of a regression line.
The formula for slope of the regression line is as follows:
$ m=\dfrac{n\sum{xy}-\left( \sum{x} \right)\left( \sum{y} \right)}{n\sum{{{x}^{2}}}-{{\left( \sum{x} \right)}^{2}}} $
Now, using the above set of x and y in the above equation we get,
$ m=\dfrac{n\left( {{x}_{1}}{{y}_{1}}+{{x}_{2}}{{y}_{2}}+{{x}_{3}}{{y}_{3}}+.....{{x}_{n}}{{y}_{n}} \right)-\left( {{x}_{1}}+{{x}_{2}}+{{x}_{3}}+....{{x}_{n}} \right)\left( {{y}_{1}}+{{y}_{2}}+{{y}_{3}}+....{{y}_{n}} \right)}{n\left( {{x}_{1}}^{2}+{{x}_{2}}^{2}+{{x}_{3}}^{2}+....{{x}_{n}}^{2} \right)-{{\left( {{x}_{1}}+{{x}_{2}}+{{x}_{3}}+....{{x}_{n}} \right)}^{2}}} $
The formula for intercept of the regression line is as follows:
$ c=\dfrac{\sum{y}-m\sum{x}}{n} $
Substituting the values of data sets of x and y in the above equation we get,
$ c=\dfrac{\left( {{y}_{1}}+{{y}_{2}}+{{y}_{3}}+.....+{{y}_{n}} \right)-m\left( {{x}_{1}}+{{x}_{2}}+{{x}_{3}}+....+{{x}_{n}} \right)}{n} $
In the above formula, substitute the value of m (which is the slope of the regression line) which we have calculated above.
In this way, we have shown the calculation of slope and intercept of a regression line for the given set of x and y.
Note:
Regression line we have to draw when we have a dependent and independent variable. The independent variable we have plotted on the x-axis and the dependent variable we have plotted on the y axis and then to get the best fit line which is passing through these points we need this slope and intercept formula. This is the example where we require calculating the slope and intercept of a regression line.
Recently Updated Pages
Master Class 10 General Knowledge: Engaging Questions & Answers for Success

Master Class 10 Science: Engaging Questions & Answers for Success

Master Class 10 Social Science: Engaging Questions & Answers for Success

Master Class 10 Maths: Engaging Questions & Answers for Success

Master Class 10 English: Engaging Questions & Answers for Success

Master Class 10 Computer Science: Engaging Questions & Answers for Success

Trending doubts
Which of the following does not have a fundamental class 10 physics CBSE

State and prove the Pythagoras theorem-class-10-maths-CBSE

State BPT theorem and prove it class 10 maths CBSE

A triangle ABC is drawn to circumscribe a circle of class 10 maths CBSE

What is Contraception List its four different methods class 10 biology CBSE

Difference between mass and weight class 10 physics CBSE

