A least-squares line is recomputed from the shown rows. This lesson adds one displayed row and shows the exact sums and coefficients move.
highlighted = computed this step
Base rows give y equals x
The base rows are (0, 0), (1, 1), and (2, 2). Their least-squares line has intercept 0 and slope 1, so it is y=x.
a=0,b=1
Add one row and recompute sums
Add the row (3, 0). The new sums are n=4, sum x=6, sum y=3, sum x times x=14, and sum x times y=5.
b=4⋅14−624⋅5−6⋅3=1/10
Compare before and after
The shifted fit has intercept 3/5 and slope 1/10. Before the added row, the line was y=x; after the added row, the line is y=3/5 plus 1/10x. This is a fit to the shown rows, not a future-prediction claim and not a robust-method recommendation.