What is the 'right' slope formula of a regression? deltas or Pearson? this may be a silly question, but still:

*

*I've been told that the slope formula equals the rise/run ratio, like this:

$$
m = \frac{rise}{run} = \frac{y_2 - y_1}{x_2 - x_1}
$$
in which rise equals detaY and run equals deltaX

*

*however, I've also seen it using Pearson's correlation coefficient, such as in many posts here, like this one or this one :

$$
b = r_{x,y} \frac{\sigma_y}{\sigma_x}
$$

*

*Probably they're the same thing and I'm not able to see it... but, how are these two equations the same? I'd really want to understand this.


For only two points they are the same.
The slope of simple linear regression is
$$
\hat \beta = \frac{\sum_i (x_i - \bar x) (y_i - \bar y)}{\sum_i (x_i - \bar x)^2}
$$
that is the same form you mentioned in the second bullet. Notice that when we have two points, then things like $x_1 - \bar x$ can be written as
$$
x_1 - \frac{x_1 + x_2}{2} = \frac{x_1 - x_2}{2}
$$
So we can re-write
$$
\require{cancel} 
\begin{align}
\hat \beta &= \frac{\frac{x_1 - x_2}{2}\frac{y_1 - y_2}{2} + \frac{x_2 - x_1}{2} \frac{y_2 - y_1}{2}}{ \frac{x_1 - x_2}{2}\frac{x_1 - x_2}{2} + \frac{x_2 - x_1}{2}\frac{x_2 - x_1}{2} } \\
&= \frac{
(\frac{x_1y_1}{4} - \frac{x_1y_2}{4} - \frac{x_2y_1}{4} + \frac{x_2y_2}{4})
+ (\frac{x_2y_2}{4} - \frac{x_2y_1}{4} - \frac{x_1y_2}{4} + \frac{x_1y_1}{4})
}{\cancel{2} \frac{x_1 - x_2}{\cancel 2}\frac{x_1 - x_2}{2}} \\
&= \frac{\frac{x_1 y_1 - x_1 y_2 - x_2 y_1 + x_2 y_2}{\cancel 2}}{ (x_1 - x_2)\frac{x_1 - x_2}{\cancel 2}} \\
&= \frac{\cancel{(x_1 - x_2)}( y_1 - y_2)}{\cancel{(x_1 - x_2)}(x_1 - x_2)} \\
&= \frac{y_1 - y_2}{x_1 - x_2} = \frac{y_2 - y_1}{x_2 - x_1}
\end{align}$$
They must have been the same because the regression line calculated for two points needs to pass through them as there's no "noise". Linear regression is a linear model, so they need to be algebraically the same.
If you have more than two points, as Dave mentioned, you cannot use the rise/run formula anymore.
