在汽车库中使用scatterplotMatrix时,右上角的图和左下角的图有什么区别?

What is the difference between the plot at the upper right and the one at the lower left corner when using scatterplotMatrix in the car library?

为什么在汽车库中使用scatterplotMatrix时,右上角和左下角(附图)的回归线不同?

两者似乎都标记了相同的点,但轴互换了。那么为什么回归线不同。两者的回归线不应该相同吗?

不,他们不应该。例如,考虑 "Developed" 组。在左下角的情况下,我们有 Alcohol ~ Life.expectancy 意味着随着 Life.expectancy 的变化,回归线试图成为 Alcohol 可能值的 "in the middle"。因此,我们只涵盖 Alcohol 值的一小部分值,大约 (5.5, 9)。但是,在右上角的情况下,我们有 Life.expectancy ~ Alcohol,这意味着随着 Alcohol 的变化,回归线试图成为 Life.expectancy 可能值的 "in the middle"。根据定义,在这种情况下,我们涵盖酒精的所有值,即 (0, 15) 区间。

就系数而言,我们也没有理由得到类似的东西。例如,

set.seed(2)
y <- rnorm(100)
x <- rnorm(100, sd = 0.2)
coef(lm(y ~ x))
# (Intercept)           x 
# -0.02879037 -0.32651252 
cov(y, x) / var(x)
# [1] -0.3265125
coef(lm(x ~ y))
#  (Intercept)            y 
#  0.005553734 -0.009420632 
cov(y, x) / var(y)
# [1] -0.009420632

即用independent变量的协方差(两种情况相同)除以方差得到斜率,目的是使尺度相同。在您的情况下 Alcohol 显然与 Life.expectancy 具有不同的比例,因此结果不同。