The line of best fit using the Least Squares Method has the form y=a+bx.
| Year (x) | 2010 | 2011 | 2012 | 2013 | 2014 |
|---|
| Profit (y) | 10 | 12 | 14 | 16 | 13 |
Number of data points: n=5
Calculate the required sums:
∑x=2010+2011+2012+2013+2014=10,060
∑y=10+12+14+16+13=65
∑xy=(2010×10)+(2011×12)+(2012×14)+(2013×16)+(2014×13)
∑xy=20,100+24,132+28,168+32,208+26,182=130,790
∑x2=20102+20112+20122+20132+20142
∑x2=4,040,100+4,044,121+4,048,144+4,052,169+4,056,196=20,240,730
The slope is given by:
b=n∑x2−(∑x)2n∑xy−(∑x)(∑y)
b=5(20,240,730)−(10,060)25(130,790)−(10,060)(65)
b=101,203,650−101,203,600653,950−653,900
b=5050
b=1
The intercept is given by:
a=n∑y−b(∑x)
a=565−1(10,060)
a=565−10,060
a=5−9,995
a=−1999
The equation of the straight line trend is:
y=a+bx
y=−1999+x
y=x−1999