简体   繁体   English

如何在观星台上组合列?

[英]How combine columns on stargazer?

I want to make a table with stargazer. 我想和注视者做一张桌子。 First I assigned the outcome of my formula to rAgg . 首先,我将公式的结果分配给rAgg After this I want to make a stargazer table with the following commands: 之后,我想用以下命令制作一个观星台:

a <- rAgg$ors.ctx
b <- rAgg$ors.indiv
c <-rAgg$lik
rbind(a,b,c)  

An example of the outcomes of a are: OR l95 u95 (Intercept) 0.007148468 0.006327645 0.008075768 statusscore14 0.996612498 0.971742666 1.022118825 meanGroente 1.068326524 1.046027113 1.091101319 a的结果示例如下: OR l95 u95 (Intercept) 0.007148468 0.006327645 0.008075768 statusscore14 0.996612498 0.971742666 1.022118825 meanGroente 1.068326524 1.046027113 1.091101319

This gives the outcome: 结果如下:

> rbind(a,b,c)
#                        OR          l95          u95
# (Intercept)   7.148468e-03 6.327645e-03 8.075768e-03
# statusscore14 9.966125e-01 9.717427e-01 1.022119e+00
# meanGroente   1.068327e+00 1.046027e+00 1.091101e+00
# pHerkomst     4.682304e-01 3.552017e-01 6.172260e-01
# pOuderPersoon 2.969725e+00 2.509198e+00 3.514775e+00
# c             4.686703e+03 4.686703e+03 4.686703e+03

However, I would prefer an outcome like this 但是,我希望这样的结果

                        rAgg      
(Intercept)   7.148468e-03 (6.327, 8.075)
statusscore14 9.966125e-01 (9.717, 1.022)
meanGroente   1.068327e+00 (1.046, 1.091)
pHerkomst     4.682304e-01 (3.552, 6.172)
pOuderPersoon 2.969725e+00 (2.509, 3.514)
c             4.686703e+03 (4.6867, 4.686)`

In other words, combine the three columns into one (and make use of brackets). 换句话说,将三列合并为一列(并使用方括号)。 I hope there is a convenient way to do this. 我希望有一个方便的方法可以做到这一点。

Help is much appreciated! 非常感谢帮助!

Basically @rawr gave the answer already. 基本上@rawr已经给出了答案。 Only a was missing in his comment. 他的评论中只缺少a So the complete answer would be sprintf("%f (%.3f and %.3f)", a, b, c) . 因此,完整的答案将是sprintf("%f (%.3f and %.3f)", a, b, c) PS: I avoid naming objects like functions (and c is a function). PS:我避免命名诸如函数之类的对象(而c是一个函数)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM