Quantitative Techniques to Transport PlanningCourses IndexOffline index pageNetTel@Africa
Page 36 of 88 pages. Chapter: 7: Regression More information about chapter

Calculating the Equation of the Line

To specify the equation of any straight line we need two values:

  • The slope or gradient of the line
  • The point at which the line cuts the y axis

Calculating the equation of the line needs the same values to be calculated as for the correlation coefficient.  To do this, we can use a spreadsheet with a regression option – in this case, all you have to worry about is interpreting the coefficients, or a calculator, in which case you will need to calculate the extra columns and work out the column totals in order to find the coefficients.

For a straight line equation: 

Slope:

Intercept:

Example 6.1:

We will calculate the regression coefficient for the following data:

Advertising
Expenditure(MWK’00)

Sales
(MWK’000)

10

22

12

25

18

26

15

30

8

23

17

27

20

32

15

27

11

25

19

29

Since we will wish to find the effect of advertising expenditure on sales, the advertising expenditure is the independent variable x, and the resulting sales are the dependent variable y.

By plotting the scatter chart and fitting the linear trend line, the ‘best fit’ line will be plotted on the chart. It is also possible to display the r 2 value and the regression equation on the chart.

Figure 6.3 Scatter Chart of Advertising and Sales

If you don’t have a regression option, or are using a calculator, you need to calculate the means and SDs for x values and the y values, together with  and  and substitute into the formulae on the previous page.

Advertising Expenditure
(MWK hundreds)
x

Sales
(MWK thousands)
y

xy

x2

10

22

220

100

12

25

300 

144

18

26

468

324

15

30

450

225

8

23

184

64

17

27

459

289

20

32

640

400

15

27

405

225

11

25

275

121

19

29

551

361

Total

-

-

3952

2253

Mean

14.500

26.6

-

-

SD

3.879

2.939 

-

-

Slope:

Intercept:

Alternatively . . .

Slope:

Hence;  y = 17.4476 + 0.6312x

Go to previous pageOrganizers for courseStudy question for this pageGo live and check course documents folderGo live and access discussion forumGo to next page