Nellie M. answered 05/06/22
UC Berkeley Math & CS Grad | Tutor for All Levels
step 1: Find the slope of the line of best fit (this is the hardest step and after you finish this its smooth sailing)
- start by calculating the average of the x's and y's
- let xa denote the average of the x's: Xa= the sum of all the x's/ the number of x's = (1+2+3)/3= 2
- let Ya denote the average of the y's: Ya= the sum of all the Y's/ the number of Y's = (2+3+5)/3= 10/3
- Then, the formula for the slope of the line of best fit is the sum of each (x-xa)(y-ya)/the sum of each (x-xa)(x-xa)
- Calculate each (x-xa) and (y-ya)
- (1,2): (x1-xa)= 1- 2= -1 and (y1-ya) = (2- 10/3) = -4/3
- (2,3): (x2-xa)= 2-2 =0 and (y2-ya) =(3 -10/3)= -1/3
- (3,5): (x3-xa)= 3-2=1 and (y3-ya) =(5- 10/3)= 5/3
- Calculate each (x-xa)(x-xa) and (x-xa)(y-ya)
- (1,2): (x1-xa)(x1-xa)= (-1)(-1)=1 and (x1-xa)(y1-ya) = (-1)(-4/3)=4/3
- (2,3): (x2-xa)(x2-xa)= (0)(0)= 0 and (x2-xa)(y2-ya) = (0)(-1/3)=0
- (3,5): (x3-xa)(x3-xa)= (1)(1)=1 and (x3-xa)(y3-ya) = (1) (5/3)=5/3
- Calculate the sum of every (x-xa)(x-xa)
- [(x1-xa)(x1-xa)] + [(x2-xa)(x2-xa)] + [(x3-xa)(x3-xa)] = 1+0+1=2
- Calculate the sum of every (x-xa)(y-ya)
- [(x1-xa)(y1-ya)]+[(x2-xa)(y2-ya)]+[(x3-xa)(y3-ya)] = 4/3+0+5/3 = 9/3=3
- Calculate the slope: [(x1-xa)(y1-ya)]+[(x2-xa)(y2-ya)]+[(x3-xa)(y3-ya)] / [(x1-xa)(x1-xa)] + [(x2-xa)(x2-xa)] + [(x3-xa)(x3-xa)] = 3/2
step 2: calculate the y-intercept using the formula ya= a(xa)-b where b= to the y-intercept and a=slope
- ya= a(xa)-b: 10/3= a(2)-b
- plug in slope
- 10/3= (3/2)(2)- b
- solve for b
- b= - (1/3)
step 3: plug the slope and y-intercept into y= a(x)-b
- y=(3/2)x - (-1/3) = (3/2)x+1/3