You are on page 1of 14

Regression Analyis: Fundamentals and Practical Applications

Basic Regression Calculations - Blank Workboo

Notes
This Excel model is for educational purposes only and should not be used for any othe
All content is Copyright material of CFI Education Inc.

https://corporatefinanceinstitute.com/

© 2019 CFI Education Inc.


All rights reserved. The contents of this publication, including but not limited to all writt
international copyright and trademark laws. No part of this publication may be modified
including photocopying, recording, or other electronic or mechanical methods, without
uses permitted by copyright law.
l Applications

Blank Workbook

d not be used for any other reason.

g but not limited to all written material, content layout, images, formulas, and code, are protected under
ublication may be modified, manipulated, reproduced, distributed, or transmitted in any form by any means,
hanical methods, without prior written permission of the publisher, except in the case of certain noncommercial
ected under
m by any means,
rtain noncommercial
Linear Regression - Line of Best Fit
Raw Data Task: Create a scatter plot and trend line
YearsExperience Salary 1) Plot Years of Experience (X) against Salary (Y) using a basic scatter chart.
1.1 39343
1.3 46205
1.5 37731 Chart Title
2 43525 140000
2.2 39891
120000
2.9 56642
3 60150 100000
3.2 54445 80000
Salary
3.2 64445
60000
3.7 57189
3.9 63218 40000
4 55794 20000
4 56957
0
4.1 57081 0 2 4 6 8 10 12
4.5 61111 Axis Title
4.9 67938
5.1 66029
5.3 83088
5.9 81363
6 93940
6.8 91738
7.1 98273
7.9 101302
8.2 113812
8.7 109431
9 105582
9.5 116969
9.6 112635
10.3 122391
10.5 121872
basic scatter chart.

10 12
Linear Regression - Manual Calculations
Raw Data Regression
YearsExperience Salary Regression Line Error Squared Error
1.1 39343 24,900 -14,443 208,600,249
1.3 46205 26,700 -19,505 380,445,025
1.5 37731 28,500 -9,231 85,211,361
2 43525 33,000 -10,525 110,775,625
2.2 39891 34,800 -5,091 25,918,281
2.9 56642 41,100 -15,542 241,553,764
3 60150 42,000 -18,150 329,422,500
3.2 54445 43,800 -10,645 113,316,025
3.2 64445 43,800 -20,645 426,216,025
3.7 57189 48,300 -8,889 79,014,321
3.9 63218 50,100 -13,118 172,081,924
4 55794 51,000 -4,794 22,982,436
4 56957 51,000 -5,957 35,485,849
4.1 57081 51,900 -5,181 26,842,761
4.5 61111 55,500 -5,611 31,483,321
4.9 67938 59,100 -8,838 78,110,244
5.1 66029 60,900 -5,129 26,306,641
5.3 83088 62,700 -20,388 415,670,544
5.9 81363 68,100 -13,263 175,907,169
6 93940 69,000 -24,940 622,003,600
6.8 91738 76,200 -15,538 241,429,444
7.1 98273 78,900 -19,373 375,313,129
7.9 101302 86,100 -15,202 231,100,804
8.2 113812 88,800 -25,012 625,600,144
8.7 109431 93,300 -16,131 260,209,161
9 105582 96,000 -9,582 91,814,724
9.5 116969 100,500 -16,469 271,227,961
9.6 112635 101,400 -11,235 126,225,225
10.3 122391 107,700 -14,691 215,825,481
10.5 121872 109,500 -12,372 153,066,384
Regression Parameters
Sum of Squared Errors Intercept Slope
6,199,160,122 15,000 9,000

Task: Manually create a line of best fit, using the example parameters
1) Use the example parameters to construct an example line of best fit
2) Experiment with the values of slope and intercept to see what effect it has on the sum

Regression Line
140000

120000

100000

80000
Salary ($)

60000

40000

20000

0
0 2 4 6 8 10
Years Experience

Salary Regression Line


parameters
ne of best fit
e what effect it has on the sum of squared errors

ne

8 10 12
ence

Regression Line
Linear Regression - Calculating Parameters using Formulas
Raw Data Regression
YearsExperience Salary Regression Line Error Squared Error
1.1 39343 36,187 - 3,156 9,959,334
1.3 46205 38,077 -8,128 66,061,926
1.5 37731 39,967 2,236 5,000,339
2 43525 44,692 1,167 1,362,180
2.2 39891 46,582 6,691 44,771,051
2.9 56642 53,197 -3,445 11,867,398
3 60150 54,142 -6,008 36,095,017
3.2 54445 56,032 1,587 2,518,822
3.2 64445 56,032 -8,413 70,777,229
3.7 57189 60,757 3,568 12,731,058
3.9 63218 62,647 -571 325,980
4 55794 63,592 7,798 60,809,576
4 56957 63,592 6,635 44,023,882
4.1 57081 64,537 7,456 55,592,618
4.5 61111 68,317 7,206 51,926,878
4.9 67938 72,097 4,159 17,297,411
5.1 66029 73,987 7,958 63,329,892
5.3 83088 75,877 -7,211 51,998,514
5.9 81363 81,547 184 33,848
6 93940 82,492 -11,448 131,057,296
6.8 91738 90,052 -1,686 2,842,785
7.1 98273 92,887 -5,386 29,009,721
7.9 101302 100,447 -855 731,192
8.2 113812 103,282 -10,530 110,883,191
8.7 109431 108,007 -1,424 2,028,139
9 105582 110,842 5,260 27,666,139
9.5 116969 115,567 -1,402 1,966,046
9.6 112635 116,512 3,877 15,029,877
10.3 122391 123,127 736 541,419
10.5 121872 125,017 3,145 9,889,796
Helper Functions Regression Parameters
Sum of Squared Errors Mean of X Mean of Y Intercept Slope
938,128,552 5.31 76,003 25,792 9,450

Task: Calculate the optimal regression parameters: intercept an slope using the formula
1) Notice that the intercept and slope can both be calculated mathematically, using the a
2) The mean of X inputs and the mean of Y outputs are used as part of the formula.

Regression Line
140000

120000

100000

80000
Salary ($)

60000

40000

20000

0
0 2 4 6 8 1
Years Experience

Salary Regression Line


an slope using the formulas provided
mathematically, using the above formulas.
s part of the formula.

8 10 12
nce

egression Line
Linear Regression - Making Predictions
Raw Data Regression
YearsExperience Salary Regression Line Error Squared Error
1.1 39343 36,187 - 3,156 9,959,334
1.3 46205 38,077 -8,128 66,061,926
1.5 37731 39,967 2,236 5,000,339
2 43525 44,692 1,167 1,362,180
2.2 39891 46,582 6,691 44,771,051
2.9 56642 53,197 -3,445 11,867,398
3 60150 54,142 -6,008 36,095,017
3.2 54445 56,032 1,587 2,518,822
3.2 64445 56,032 -8,413 70,777,229
3.7 57189 60,757 3,568 12,731,058
3.9 63218 62,647 -571 325,980
4 55794 63,592 7,798 60,809,576
4 56957 63,592 6,635 44,023,882
4.1 57081 64,537 7,456 55,592,618
4.5 61111 68,317 7,206 51,926,878
4.9 67938 72,097 4,159 17,297,411
5.1 66029 73,987 7,958 63,329,892
5.3 83088 75,877 -7,211 51,998,514
5.9 81363 81,547 184 33,848
6 93940 82,492 -11,448 131,057,296
6.8 91738 90,052 -1,686 2,842,785
7.1 98273 92,887 -5,386 29,009,721
7.9 101302 100,447 -855 731,192
8.2 113812 103,282 -10,530 110,883,191
8.7 109431 108,007 -1,424 2,028,139
9 105582 110,842 5,260 27,666,139
9.5 116969 115,567 -1,402 1,966,046
9.6 112635 116,512 3,877 15,029,877
10.3 122391 123,127 736 541,419
10.5 121872 125,017 3,145 9,889,796
25,792 25,792 0 0
25,792 25,792 0 0
25,792 25,792 0 0
25,792 25,792 0 0
25,792 25,792 0 0
Helper Functions Regression Parameters
Sum of Squared Errors Mean of X Mean of Y Intercept Slope
938,128,552 5.31 76,003 25,792 9,450

Task: See how the regression line can be used to make predictions
1) Add new data points and see what predictions are made

Regression Line
140000

120000

100000

80000
Salary ($)

60000

40000

20000

0
0 2 4 6 8 10
Years Experience

Salary Regression Line Predicted Points

`
e

8 10 12
nce

Predicted Points

You might also like