如何读取SAS中PROC LOGISTIC和PROC REG输出的相关矩阵?

发布于 2024-11-11 14:39:41 字数 205 浏览 8 评论 0原文

如您所知,通过选项 CORRB,您可以让 SAS 中的逻辑回归或线性回归输出估计矩阵的相关性。有趣的是,我不知道如何阅读这个矩阵。我有两个明显强正相关的变量。从PROC CORR中,我可以看到这两个变量的皮尔逊相关系数为0.7+。但是逻辑回归和线性回归的估计矩阵给我-0.7。相关性的强度大致相似,但符号相反。任何人都可以解释一下吗?非常感谢。

As you know, with an option CORRB, you can let logistic regression or linear regression in SAS to output a correlations of estimates matrix. Interestingly, I am not sure how to read this matrix. I have two variables which are clearly strongly positive correlated. From PROC CORR, I can see the pearson correlation coefficient of these two variables is 0.7+. But the estimates matrix from both logitistic regression and linear regression give me -0.7. The strengh of the correlation is about similar but the sign is reversed. Anyone can explain it? Many thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

诗化ㄋ丶相逢 2024-11-18 14:39:41

您正确地读取了这些值,它们只是意味着不同的东西。 PROC CORR 给出变量的相关性,而 CORRB 是模型中这些变量的系数的相关性。

这是对为什么正相关预测变量将具有负相关系数的直观解释。假设 y = a + b1*x1 + b2*x2 + eps。如果将 b1 从回归获得的最佳值稍微增加一点,那么 y 的预测值也会增加(对于正 x1)并且会让整体的契合度变得更差。补偿该问题并使预测值更接近观测值的一种方法是减少 b2:因为 x1 的高值与x2 的值较高,您将恢复到接近原始的贴合度。这表明 b2 中的不确定性与 b1 中的不确定性负相关:增加一个而减少另一个将导致类似的拟合。

查看完美相关的极端情况可能会有所启发:x2=x1。那么以下内容将为您提供完全相同的预测:

y = 1 + 2*x + 3*x
y = 1 + 3*x + 2*x
y = 1 + 9*x + (-4)*x
etc

因此 b2 = 5-b1 和系数具有完美的负相关性。

You are reading the values correctly, they just mean different things. PROC CORR gives you the correlation of the variables, while CORRB is the correlation of the coefficients of these variables in the model.

Here is an intuitive explanation of why positively correlated predictors will have negatively correlated coefficients. Suppose y = a + b1*x1 + b2*x2 + eps. If you increase b1 a little from its best value obtained from the regression, then the predicted value for y will also increase (for positive x1) and will make the overall fit worse. One way to compensate for that and move the predicted values closer to the observed ones is to decrease b2: since high values of x1 are associated with high values of x2, you will get back close to the original fit. This shows that the uncertainty in b2 is negatively correlated with the uncertainty in b1: increasing one while decreasing the other will lead to similar fits.

It might be instructive to look at the extreme case of perfect correlation: x2=x1. Then the following will give you exactly the same predictions:

y = 1 + 2*x + 3*x
y = 1 + 3*x + 2*x
y = 1 + 9*x + (-4)*x
etc

So b2 = 5-b1 and the coefficients have a perfect negative correlation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文