1
$\begingroup$

Am trying to find linear regression slope (angle) of a line with the following set of coordinates.

x axis    y axis 
123.4415,  5
123.4414,  4
123.4413,  3
123.4412,  2
123.4411,  1

the slope am getting is: 9999.9238554096.. Is it possible to have such an angle? or what am i missing about linear regression?

$\endgroup$

1 Answer 1

0
$\begingroup$

The points are exactly aligned and the relation is $$y=-1234410+10000\,x$$ $10000$ is not an angle (as you wrote, it is just the slope). Concerning the angle $$\tan^{-1}(10000)=\frac \pi 2-\tan^{-1}\left(\frac 1{10000}\right)$$ Now, you can easily approximate the last term using Taylor series of $\tan^{-1}(x)$ for $x$ close to $0$.

This should give you (more or less) $$\tan^{-1}\left(\frac 1{10000}\right)=\frac{299999999}{3000000000000}$$ corresponding to an "almost" vertical line (just as a scatter plot of the data would show).

$\endgroup$
2
  • $\begingroup$ You are right, the arctangent of the slope value 9999.9238554096 is 89.99427038 degrees, just like you stated, "almost" vertical line. I thought the slope is the angle, silly me. One has to find the arctangent of the slope to find the angle. $\endgroup$
    – Gatimu
    Dec 9, 2016 at 17:58
  • $\begingroup$ @Gatimu. You face serious roundoff errors. Try the same defining $X=x-123.4411$ or make the numbers rational and compute exactly the required sums. You should get $10000.00000$ $\endgroup$ Dec 9, 2016 at 18:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .