R线性回归模型的不同摘要结果

发布于 2025-01-24 06:32:54 字数 674 浏览 1 评论 0原文

这是我的代码:

m1 <- lm(Y ~ dummy, data)

“虚拟”包含12个不同的变量(A1,A2,A3,A4,B1,B2,B2,B3,B4,B4,B5,B6,B6,B7,C)。我们正在使用相同的数据,但得到不同的结果。这是我的mod的摘要:

Coefficients:
                 Estimate Std. Error t value Pr(>|t|)    
(Intercept)      
a2     
a3     
a4     
b1    
b2     
b3      
b4   
b5   
b6     
b7    
c   

这是我的队友得到的结果:

Coefficients:
                 Estimate Std. Error t value Pr(>|t|)    
(Intercept)        
b7    
b6     
b5      
b4   
b3   
b2     
b1
c
a1     
a2     
a3         

从我的角度来看,我的模型是“ A1”作为比较,而另一个模型则将“ A4”作为比较,这就是不同的。

如果我必须获得与队友相同的摘要结果,那么我该怎么办?

Here is my code:

m1 <- lm(Y ~ dummy, data)

The 'dummy' contains 12 distinct variables (a1,a2,a3,a4,b1,b2,b3,b4,b5,b6,b7,c). We are using same data but get different result. Here is the summary of my mod:

Coefficients:
                 Estimate Std. Error t value Pr(>|t|)    
(Intercept)      
a2     
a3     
a4     
b1    
b2     
b3      
b4   
b5   
b6     
b7    
c   

Here is the result my teammate got:

Coefficients:
                 Estimate Std. Error t value Pr(>|t|)    
(Intercept)        
b7    
b6     
b5      
b4   
b3   
b2     
b1
c
a1     
a2     
a3         

From my perspective, my model is making 'a1' as the comparison while the other model is making 'a4' as the comparison and that's the difference.

If I have to get the summary result same as my teammate, what can I do in R ?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文