【问题标题】:Removing slashes from column names in estout从 estout 中的列名中删除斜杠
【发布时间】:2018-04-07 07:26:40
【问题描述】:

我使用 community-contributed 命令estout 在 Stata 中创建一个汇总统计表。

我的代码在每个平均估计值下方的括号中显示标准差:

sysuse auto, clear

eststo clear
estpost summarize price mpg weight
esttab, cells(mean sd(par))

-------------------------
                      (1)

                  mean/sd
-------------------------
price            6165.257
               (2949.496)
mpg               21.2973
               (5.785503)
weight           3019.459
               (777.1936)
-------------------------
N                      74
-------------------------

如何消除斜线 (/),同时强制 meansd 重叠显示?

我还想将结果导出到LaTeX

【问题讨论】:

    标签: latex stata


    【解决方案1】:

    您可以使用以下选项来产生所需的结果:

    esttab, cells(mean sd(par)) mtitle("mean") collabels("sd") nonumbers
    
    -------------------------
                         mean
                           sd
    -------------------------
    price            6165.257
                   (2949.496)
    mpg               21.2973
                   (5.785503)
    weight           3019.459
                   (777.1936)
    -------------------------
    N                      74
    -------------------------
    

    对于LaTeX 输出,您还需要tex 选项:

    esttab, cells(mean sd(par)) mtitle("mean") collabels("sd") nonumbers tex
    
    {
    \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
    \begin{tabular}{l*{1}{c}}
    \hline\hline
                &\multicolumn{1}{c}{mean}\\
                &          sd\\
    \hline
    price       &    6165.257\\
                &  (2949.496)\\
    mpg         &     21.2973\\
                &  (5.785503)\\
    weight      &    3019.459\\
                &  (777.1936)\\
    \hline
    \(N\)       &          74\\
    \hline\hline
    \end{tabular}
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-29
      • 2020-02-13
      • 1970-01-01
      • 2016-01-03
      • 2019-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多