Including the (0,0) point in regression

41 Views Asked by At

I have run a simple linear regression in Rstudio with two variables and got the following relation:

y = 30000+1.95x

Which is reasonably fair. My only concern is that, practically the (0,0) point should be included in the model.

Is there any math help I can get please ?

2

There are 2 best solutions below

0
On BEST ANSWER

The best fit equation $y = mx$ for a list of data points $(x_i,y_i)$ has $$\displaystyle m = \frac{\sum x_iy_i}{\sum x_i^2}$$

0
On

You want to minimize $s = \sum (y_i-ax_i)^2$.

$ds/da =\sum -2x_i(y_i-ax_i) =2a\sum x_i^2-2\sum x_iy_i $ so $ds/ds=0$ when $a=\sum x_iy_i/\sum x_i^2$.