
How do you calculate the slope and intercept of a regression line?
Answer
546.6k+ 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
Two men on either side of the cliff 90m height observe class 10 maths CBSE

What happens to glucose which enters nephron along class 10 biology CBSE

Cutting of the Chinese melon means A The business and class 10 social science CBSE

Write a dialogue with at least ten utterances between class 10 english CBSE

Show an aquatic food chain using the following organisms class 10 biology CBSE

A circle is inscribed in an equilateral triangle and class 10 maths CBSE

Trending doubts
Why is there a time difference of about 5 hours between class 10 social science CBSE

Write a letter to the principal requesting him to grant class 10 english CBSE

What is the median of the first 10 natural numbers class 10 maths CBSE

The Equation xxx + 2 is Satisfied when x is Equal to Class 10 Maths

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

State and prove converse of BPT Basic Proportionality class 10 maths CBSE

