I have a TI-83 Plus CE that I can use to calculate the line of best fit for a set of points. However, I cannot force that line to go through (0,0). I was wondering how I should find the line of best fit that goes through (0,0) by hand or with a calculator. Thanks in advance.
Asked
Active
Viewed 1,929 times
2 Answers
4
The regression line $y=ax$ can be fitted using the least square method:$$a =\frac{\sum{x_i y_i}}{\sum{x_i^2}}$$
WaveX
- 5,440
0
No idea about the calculator. However, I can offer two options:
X = [1 2 3 4 5 6 7 8 9 10]'; Y = [2 4 6 8 10 12 14 16 18 20]'; inv(X'*X)*X'*Y
Copy that code (replacing the coordinates, of course) and run it. The result is your slope.
- By hand:
Calculate the sum of squares of the $X$ coordinates. Calculate the sum of $X_iY_i$. Multiply both numbers. That's equivalent to what the code above does.
tobwin
- 141