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.


These are fairly unrelated concepts.
In the first equation, that is the slope of the line connecting two points.
In the second, you are finding a line that fits multiple points best (according to a particular and common definition of best). This line is called the ordinary least squares regression line. This is what is produced by “add trendline” in Excel. Unlike in the first case, your “trendline” might not hit any of the points.
The two will coincide if you have two points and fit a “trendline” to those points (aside from a technicality if the points have the same $x$- or $y$-coordinate), but I’d say that the similarities mostly end there.
