Professional Documents
Culture Documents
Overview:
In this Unit, you will learn how to forecast using Linear Regression Analysis.
Module Objective:
After successful completion of this Unit, you should be able to:
Course Materials:
• Handout: Linear Regression Forecasting
Read:
In this Unit, we will just limit our discussion on simple linear regression analysis. That
is, we will consider only:
1. Two variables: the dependent variable, y, being either demand or sales; and the
independent variable, x, being any factor deemed to influence demand or sales;
these factors, also referred to as predictors of y may include: time (indirect
predictor, of course, since other factors which are changing through time could
be the direct predictors), product price, promotion expenditures, population rate
(which, in turn, is affected by immigration, emigration, birth, and death rates),
inflation rate, seasons of the year (which could be expressed in terms of
quantifiable factors, such as temperature, precipitation, etc.), and so many other
ecological, economic, socio-cultural, politico-legal and technological factors.
Predictors should be quantifiable, so they could prove useful for quantitative
forecasting purposes.
Linear regression is a statistical tool used to help predict future values from past values
of y based on its response to changes in x. A linear regression trendline uses the least
squares method to plot a straight line through plotted (x, y) data pairs, such that the
distances between the points and the resulting trendline are minimized.
https://www.excel-easy.com/examples/trendline.html
When x is not time, however, the regression line may be validly used for forecasting
purposes only within the relevant range; i.e., only within the range of x values in the
given x and y data pairs. Referring to the Figure on the next page, the relevant range is
only within the minimum advertising expenditure of around $45 to a maximum of $100.
Forecasting sales corresponding to advertising expenditures lower than $45 or greater
than $100 may no longer be as accurate as when the values of the predictor variable
are within the relevant range, say, at $70.
Relevant Range
https://www.ablebits.com/office-addins-blog/2018/10/03/make-scatter-plot-excel/
Simple linear regression forecasting involves searching for a variable x that has a linear
relationship with y; establishing that linear relationship by calculating the correlation
coefficient, r; deriving the equation of the regression line; and using that derived
equation to forecast values of y given values of x.
Step 1. Gather pairs of x and y data, where y is demand or sales and x is any variable
that is likely to affect y. Bear in mind that there could be a time lag between x and y, so
the decision on which x data is to be paired with which y data is crucial. For example,
the impact of an intensified product promotion done this month may only be felt 3
months later, so if you pair the promotion expenses for, say, March with the sales in
March, your data set may not be reflective of reality and your forecasting efforts could
be in vain.
Step 2. Verify if the relationship between x and y is linear; that is, calculate the
correlation coefficient, r. If |r| < 0.7, better not use linear regression forecasting and
use other forecasting methods or models. If |r | ≥ 0.7, you may proceed to Step 3.
Step 3. Derive the equation of the regression line, which is of the form: y = a + bx.
Step 4. Use the derived linear regression equation to forecast demand or sales given
values of x.
Calculate:
LINEAR REGRESSION FORECASTING EXERCISE
Shakey’s is interested in establishing the relationship between its advertising and sales
based on the following data:
Advertising Sales
Quarter (P100,000) (P Million)
1 4 1
2 10 4
3 15 5
4 12 4
5 8 3
6 16 4
7 5 2
8 7 1
9 9 4
10 10 2
1. Can Shakey’s use linear regression analysis to forecast its future sales given a
planned advertising expenditure?
2. Determine the estimated equation of the regression line that defines the
relationship between sales and advertising.
4. If Shakey’s spends 5% of sales on pizza boxes, how much boxes, in peso volume,
should its operations manager order for the next quarter?
Solution
1. Can Shakey’s use linear regression analysis to forecast its future sales given a
planned advertising expenditure?
Advertising Sales
Quarter (P100,000) (P Million)
xi yi xi yi xi2 yi2
1 4 1 4*1=4 42 = 16 12 =1
2 10 4 10 * 4 = 40 102 = 100 42 = 16
3 15 5 15 * 5 = 75 152 = 225 52 = 25
4 12 4 12 * 4 = 48 122 = 144 42 = 16
5 8 3 8 * 3 = 24 82 = 64 32 = 9
6 16 4 16 * 4 = 64 162 = 256 42 = 16
7 5 2 5 * 2 = 10 52 = 25 22 = 4
8 7 1 7*1=7 72 = 49 12 = 1
9 9 4 9 * 4 = 36 92 = 81 42 = 16
10 10 2 10 * 2 = 20 102 = 100 22 = 4
∑𝑥𝑥 = 96 ∑𝑦𝑦 = 30 ∑𝑥𝑥𝑥𝑥 = 328 ∑x2 =1060 ∑y2 =108
(∑𝑥𝑥)2 = 9216 (∑𝑦𝑦)2 = 900
• Since r = 0.801 > 0.7, there’s strong correlation or linear relationship between x
(advertising expenditures) and y (sales); therefore, Shakey’s can use linear
regression to forecast y given values of x. (Note, however, that this conclusion is
valid only within the relevant range or the range of x values between P400,000
and P1,600,000; see the given data).
2. Determine the estimated equation of the regression line that defines the
relationship between sales and advertising.
• The linear regression equation is of the form: y = a + bx, where a is the y-intercept
of the line, and b is the slope of the line.
• Next, we calculate the y-intercept of the regression line using the equation
∑ 𝑦𝑦 − 𝑏𝑏 ∑ 𝑥𝑥 30 − 0.289(96)
𝑎𝑎 = = = 0.226
𝑛𝑛 10
• Since a is the y-intercept or the value of y when x is zero, we may interpret a as:
Shakey’s may expect quarterly sales of around P226,000 even if they don’t
advertise.
• Note that we cannot immediately substitute the value P1,100,000 as x into the
linear regression equation because x is supposed to be expressed in P100,000.
Hence, the value of x should be 11, since there are 11 P100,000 in P1,100,000.
4. If Shakey’s spends 5% of sales on pizza boxes, how much boxes, in peso volume,
should its operations manager order for the next quarter?
• Let B = the budget for pizza boxes for the next quarter (Quarter 11)
• B = 0.05(P3,405,000) = P170,250
If you’re interested, the procedure for using the built-in Linear Regression formulas in
your scientific calculator is found in the Appendix below.
Activities/Assessments:
Activity 9. Do the Exercise below:
Appendix
Note: The keys to press may vary depending on the calculator model or brand that you are using.
REG LIN
x2 y2
, M+
x3 y3
, M+
xn yn
, M+
STAT A+BX
x y
Step 4: Encode Data:
1
2
3
4
5
:. :. :.
n
Step 5: AC
REG
Step 6: Determine the value of r: SHIFT 1 5 3 =
REG
REG
Step 8: Determine the value of b: SHIFT 1 5 2 =