You are on page 1of 4

STA101 Lesson 18 Notes

STA101 Lesson 18
Introduction to Linear Trend Analysis

18.0 – Least Squares Method: Introduction


Linear Trend
• Secular trend represents the long-term change / direction of the series.
• The secular trend often approximates a straight line
• The trend line can be expressed as
𝑦̂ = 𝑎 + 𝑏𝑥

Least Squares Method


Following from linear regression, we know the least square estimate is expressed by:
𝑌̂ = 𝑎̂ + 𝑏̂𝑋
Where,
∑𝑋𝑌 − 𝑛𝑋̅𝑌̅
𝑏̂ =
∑𝑋 2 − 𝑛𝑋̅ 2
𝑎̂ = 𝑌̅ − 𝑏̂𝑋̅

However, when using the Least Squares Method for time series, we may translate the independent
variable 𝑋 (time) such that ∑𝑋 = 0, and hence 𝑋 = 0. Therefore, the least square regression
coefficients may be simplified as,
∑𝑋𝑌
𝑏̂ =
∑𝑋 2
𝑎̂ = 𝑌̅

Translating or Coding of Time


In most of the cases, translating or recoding of the given time values is required for computational
convenience. The necessary steps of translating time depend on whether the time series consists of
odd number of periods or even number of periods.

STA101 (Introduction to Statistics) _Lesson Note 18_Summer 2022


STA101 Lesson 18 Notes

18.1 – Least Squares Method: Odd Number of Period


In a time series, we have the values of time (𝑇) in terms of years, months, weeks, days, etc. Before
conducting a linear trend analysis on the data, we first need to translate the 𝑇 values into coded 𝑋
values which are easier to use in calculations. When there are odd numbers of periods in the time
series, the procedure will be as follows.
1. First calculate the mean value of time,
∑𝑇
𝑇=
𝑛
2. Then, the coded vale of time can be expressed as
𝑋 =𝑇−𝑇

Example
The close price of Alphabet Inc. (GOOG) shares on the last trading days of each year is represented by
the following time series. Find the linear equation that describes the trend and estimate the close
price for 2014

Solution
2308
𝑎=𝑌= = 256.44
9
∑𝑋𝑌 1468
𝑏= = = 24.47
∑𝑋 2 60
∴ 𝑌̂ = 256.44 + 24.47𝑥

For 𝑇 = 2014,
𝑋 = 2014 − 2008 = 6
∴ 𝑌̂ = 256.44 + (24.47 × 6) = 403.26

STA101 (Introduction to Statistics) _Lesson Note 18_Summer 2022


STA101 Lesson 18 Notes

18.2 – Least Squares Method: Even Number of Period


In a time series, we have the values of time (𝑇) in terms of years, months, weeks, days, etc. Before
conducting a linear trend analysis on the data, we first need to translate the 𝑇 values into coded 𝑋
values which are easier to use in calculations. When there are even numbers of periods in the time
series, the procedure will be as follows.
1. First calculate the mean value of time,
∑𝑇
𝑇=
𝑛
2. Then, the coded vale of time can be expressed as
𝑋 = 2 × (𝑇 − 𝑇)

Example
The close price of Alphabet Inc. (GOOG) shares on the last trading days of each year is represented by
the following time series. Find the linear equation that describes the trend and estimate the close
price for 2014

Solution
2867
𝑎=𝑌= 10
= 286.7
∑𝑋𝑌 5651.73
𝑏= = = 17.13
∑𝑋 2 330
∴ 𝑌̂ = 286.7 + 17.13𝑥

For 𝑇 = 2014,
𝑋 = 2 × (2014 − 2008.5) = 11
∴ 𝑌̂ = 286.7 + (17.13 × 11) = 475.13

STA101 (Introduction to Statistics) _Lesson Note 18_Summer 2022


STA101 Lesson 18 Notes

Practice Problems
Problem 1
Otobi is a furniture manufacturing company. Since they started the company, the number of tables
they have sold is represented by this time series:

Year 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996

Tables Sold 42 50 61 75 92 111 120 127 140 138

a. Find the linear equation that describes the trend in the number of tables sold by Otobi.
b. Estimates their sales of tables in 1998.
Answers:

a. 𝑌̂ = 95.6 + 5.9939𝑥
b. 173.5

Problem 2
The number of faculty owned computers at the university of Ohio increased dramatically between
1990 and 1995:

Year 1990 1991 1992 1993 1994 1995

No. of PC 50 110 350 1020 1950 3710

a. Develop a linear estimating equation that best describes the data.


b. Estimate the number of PCs that will be in use at the university in 1999
Answers:

a. 𝑌̂ = 1198.33 + 349.8571𝑥
b. 5746.47

STA101 (Introduction to Statistics) _Lesson Note 18_Summer 2022

You might also like