Are Equations for Linear Regression Right?

In summary: I made a mistake.Yeah, the equations you have written seem to be correct. The first one is the general formula for slope of regression line for Y on X, and the second one is the formula for slope of regression line for X on Y. The equations for the lines of regression also seem to be correct. In summary, the equations provided for calculating the slope of regression for Y on X and X on Y are correct, and the equations for the lines of regression are also accurate. It is important to remember to swap the variables accordingly when finding the line of regression for X on Y.
  • #1
iVenky
212
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}}

\\ m=\frac{Cov(XY)}{Var(X)}

\\ m=\frac{ρσ_{x}σ_{y}}{σ_{x}^{2}}

\\ m=\frac{ρσ_{y}}{σ_{x}}

\\and\ the\ equation\ is

\\y-\bar{y}= m (x-\bar{x})

[/itex]

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

[itex]
\\

\\ m=\frac{ρσ_{x}}{σ_{y}}\\and\ the\ equation\ is

\\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
  • #2
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).
 
  • #3
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?
 
  • #4
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.
 
  • #5
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
 
  • #6
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.
 
  • #7
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)
 
  • #8
Ohh yes, sorry you are spot on.
 

Related to Are Equations for Linear Regression Right?

1. What is linear regression and how is it used in science?

Linear regression is a statistical method used to model the relationship between two or more variables. It is commonly used in science to analyze and predict the relationship between independent and dependent variables.

2. How do you determine if the equations for linear regression are right?

To determine if the equations for linear regression are right, you can use statistical measures such as the coefficient of determination (R-squared) and the residual standard error. These measures can help assess how well the model fits the data and if the equations are appropriate for the data.

3. What are the assumptions of linear regression?

The main assumptions of linear regression include linearity, independence of errors, homoscedasticity (equal variance), and normality of errors. These assumptions must be met in order for the equations for linear regression to be accurate.

4. Can linear regression be used for any type of data?

Linear regression is best suited for continuous, numerical data. It may not be appropriate for categorical or discrete data, as the assumptions of linearity may not hold. It is important to assess the data and determine if linear regression is the most appropriate method of analysis.

5. How can you improve the accuracy of linear regression equations?

To improve the accuracy of linear regression equations, you can try transforming the data, including more variables in the model, or using a different type of regression (e.g. polynomial regression). It is also important to ensure that the assumptions of linear regression are met and that the model is appropriate for the data.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
118
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
30
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
895
  • Set Theory, Logic, Probability, Statistics
Replies
23
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
855
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
Back
Top