Regression Line Excel Template
Visit: www.educba.com
Email: info@educba.com
Let us take the example of a set of five patients whose glucose levels have been examined and presented
along with their respective ages. Based on the given information, build the regression line equation and
then calculate the glucose level for a person aged 77 by using the regression line equation.
Sr. No. X (Age) Y (Glucose Level) XY X²
1 45 105 4725 2025
2 23 68 1564 529
3 42 79 3318 1764
4 59 95 5605 3481
5 63 89 5607 3969
Sum is Calculated as
X (Age) Y (Glucose Level) XY X²
Sum (∑) 232 436 20819 11768
b is calculated using the formula given below
b = [n * (∑XY) - (∑X) * (∑Y)] / [n * (∑X 2) - (∑X)2]
b 0.59
a is calculated using the formula given below
a = [(∑Y) * (∑X2) - (∑X) * (∑XY)] / [n * (∑X2) - (∑X)2]
a 59.98
Regression Line is calculated using the formula given below
Regression Line Formula = Y = a + b * X
Regression Line (Y) 105.15
Let us take the example of a class with 10 students where their heights and weights
were measured to check if their weight had any liner relationship with their height.
The following information is available.
X
Sr. No. Y (Weight) XY X2
(Height)
1 157 62 9734 24649
2 172 72 12384 29584
3 153 81 12393 23409
4 165 78 12870 27225
5 169 71 11999 28561
6 149 56 8344 22201
7 178 67 11926 31684
8 172 82 14104 29584
9 161 69 11109 25921
10 155 59 9145 24025
Sum is Calculated as
X Y (Weight) XY X2
(Height)
Sum (∑) 1631 697 114008 266843
b is calculated using the formula given below
b = [n * (∑XY) - (∑X) * (∑Y)] / [n * (∑X 2) - (∑X)2]
b 0.40
a is calculated using the formula given below
a = [(∑Y) * (∑X2) - (∑X) * (∑XY)] / [n * (∑X2) - (∑X)2]
a 5.14