Are Equations for Linear Regression Right?

Click For Summary

Discussion Overview

The discussion revolves around the equations for linear regression, specifically the slopes of the regression lines for predicting y from x and vice versa. Participants are examining the correctness of these equations and the conditions under which they apply, including the implications of swapping variables.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant presents several equations for the slope of the regression line for y on x and asks for confirmation of their correctness.
  • Another participant suggests that the equations are correct if the variables are swapped appropriately when considering the regression of x on y.
  • Some participants emphasize the need to swap both x and y along with their means when determining the regression line for x on y.
  • There is a reference to the geometric definition of a straight line, indicating that the form of the equation remains consistent regardless of the variable being dependent or independent.
  • One participant notes that changing the axes affects the relationship between the slopes of the lines, mentioning that the slopes are not necessarily perpendicular when the axes are swapped.
  • Another participant acknowledges the previous point about the relationship between the slopes when axes are changed.

Areas of Agreement / Disagreement

Participants express differing views on whether both variables and their means should be swapped when transitioning between the regression of y on x and x on y. The discussion remains unresolved regarding the implications of these swaps on the equations presented.

Contextual Notes

Participants reference the geometric interpretation of linear equations and the relationship between slopes, but there are no explicit resolutions to the mathematical claims made. The discussion highlights the complexity and nuances involved in linear regression equations.

iVenky
Messages
212
Reaction score
12
I read about "Linear regression" and I want to make sure that what I read is right

Just tell if these equations are right-

Slope of line of regression for y on x is given by

[itex]m=\frac{E(XY)-E(X)E(Y)}{E(X^{2})-[E(X)]^{2}}<br /> <br /> \\ m=\frac{Cov(XY)}{Var(X)}<br /> <br /> \\ m=\frac{ρσ_{x}σ_{y}}{σ_{x}^{2}}<br /> <br /> \\ m=\frac{ρσ_{y}}{σ_{x}}<br /> <br /> \\and\ the\ equation\ is<br /> <br /> \\y-\bar{y}= m (x-\bar{x})<br /> [/itex]

Similarly the slope of line of regression of x on y is given by

[itex] \\<br /> <br /> \\ m=\frac{ρσ_{x}}{σ_{y}}\\and\ the\ equation\ is<br /> <br /> \\x-\bar{x}= m (y-\bar{y})[/itex]Just tell me if the above equations are right.

Thanks a lot
 
Last edited:
Physics news on Phys.org
Hey iVenky and welcome to the forums.

Those look correct if you swap the x's and x_bar's with the y's and y_bar's. So think about y - y_bar = m(x - x_bar) instead.

Also, we usually we write B0 = y_bar - B1_hat*x_bar (this is obtained by setting x = 0 and solving for y) and B1_hat = m (the gradient).
 
I mean, you should swap
[itex]x\ and\ \bar{x}\ with\ y\ and\ \bar{y}[/itex] for finding out the line of regression for x on y (not y on x) right?
 
No you need to swap both.

Recall that the definition of a straight line in two dimensions has one form which is y - y0 = m(x - x0) and this is something from high school geometry. In this definition (x,y) is a point on the line and (x0,y0) is a specific point on the line with m being the gradient.
 
chiro said:
No you need to swap both.

Recall that the definition of a straight line in two dimensions has one form which is y - y0 = m(x - x0) and this is something from high school geometry. In this definition (x,y) is a point on the line and (x0,y0) is a specific point on the line with m being the gradient.

Please note that I have written the equation for two cases

i) Y is a function of X and the equation is given by the one that you have written
ii) X is a function of Y. By which I mean I have taken the values of Y along the X axis and values of X along the Y axis. If that is the case you have to swap them.

See my question. I have written the equation for both cases. :)
Thanks a lot
 
If you changing the axis then recall that in two dimensions m1*m2 = -1 where m2 is the gradient of the line perpendicular to that involving the gradient m1.
 
If I change the axis the slope won't be perpendicular to the one before. For eg: Y increases as X increases (slope is positive). This means that X increases as Y increases. (once again slope is positive and not negative)
 
Ohh yes, sorry you are spot on.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 30 ·
2
Replies
30
Views
5K
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 13 ·
Replies
13
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K