Skip to content
Worked Examples · Example 2
Q.

Fit a straight-line trend by the method of least squares to the following data on a shop's sales, and estimate the trend value for 2022.

Year20172018201920202021
Sales (₹ lakh)1820222832
Puducherry TnboardTextbookSubjectiveImportance★★★★★
26% · 10/39 Questions
✓ Free question

Step 1 — Code the years. With 5 years, take the middle year (2019) as X=0X=0, so 2017 = −2-2, 2018 = −1-1, 2019 = 00, 2020 = 11, 2021 = 22. This makes ∑X=−2−1+0+1+2=0\sum X = -2-1+0+1+2 = 0.

Step 2 — Build the working table:

YearXXYYXYXYX2X^2
2017−2-218−36-364
2018−1-120−20-201
20190022000
2020112828281
2021223264644
Total0012012036361010

Step 3 — Apply the simplified normal equations (valid because ∑X=0\sum X = 0):

a=∑Yn=1205=24b=∑XY∑X2=3610=3.6a = \dfrac{\sum Y}{n} = \dfrac{120}{5} = 24 \qquad b = \dfrac{\sum XY}{\sum X^2} = \dfrac{36}{10} = 3.6

So the fitted trend line is Y=24+3.6XY = 24 + 3.6X.

Step 4 — Read off the trend values by substituting each XX:

Year20172018201920202021
Trend24−7.2=16.824-7.2=16.824−3.6=20.424-3.6=20.4242427.627.631.231.2

Step 5 — Forecast 2022. 2022 codes to X=3X=3: Y=24+3.6(3)=24+10.8=34.8Y = 24 + 3.6(3) = 24 + 10.8 = 34.8.

Verification: substituting the normal-equation values back, ∑Y\sum Y should equal na+b∑X=5(24)+3.6(0)=120na + b\sum X = 5(24)+3.6(0)=120 ✓ (matches the table total), and ∑XY\sum XY should equal a∑X+b∑X2=24(0)+3.6(10)=36a\sum X + b\sum X^2 = 24(0)+3.6(10)=36 ✓ (matches the table total) — both check out, confirming a=24,b=3.6a=24, b=3.6 are correct.

✓Final answer

Trend line: Y=24+3.6XY = 24 + 3.6X (X measured from 2019, in years); estimated trend value for 2022 = ₹34.8 lakh.

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.