least squares problem



Can someone please explain to me how to solve for least squares? I am
trying to calculate a linear trendline in a chart.

If this helps, the x-values are consecutive integers starting with 1.

Please explain it in a way that would be not be difficult to translate
into computer code.

Thank you

.



Relevant Pages