Why am I getting same linear regression lines for 'x' on 'y' and 'y' on 'x'?
0
0
Entering edit mode
23 months ago
glyptonotus ▴ 20

Hi all,

I am plotting data instances attending to two different variables (x, y) and the linear regression line between them: lm(x~y). I don't understand why, when I plot the opposite relationship: lm(y~x), I get a very similar line, instead of a specular/opposed one. Showing figure 1 (x~y), I would expect a line like the green one in figure 2 (y~x), but I get the red line.

I have checked the linear regression code in both cases:

lm(formula=x~y, data=data) # for figure 1
lm(formula=y~x, data=data) # for figure 2

Could anyone suggest any possible mistake I am doing? Thank you.

enter image description here enter image description here

lm regression linear offtopic • 621 views
ADD COMMENT
1
Entering edit mode

This post does not fit the theme of this forum. Please consult stats SE.

ADD REPLY
0
Entering edit mode

Check the dataset, it looks quite symmetrical, maybe erroneously it really is the same in x and y.

ADD REPLY

Login before adding your answer.

Traffic: 3067 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6