考虑以下使用 Stata 的 auto 玩具数据集的示例:
sysuse auto, clear
eststo clear
eststo: quietly regress price weight
eststo: quietly regress price weight mpg
esttab
--------------------------------------------
(1) (2)
price price
--------------------------------------------
weight 2.044*** 1.747**
(5.42) (2.72)
mpg -49.51
(-0.57)
_cons -6.707 1946.1
(-0.01) (0.54)
--------------------------------------------
N 74 74
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
一般来说,列的宽度可以通过使用来控制
varwidth() 和/或modelwidth():
esttab, mlabels(none) varwidth(25)
---------------------------------------------------------
(1) (2)
---------------------------------------------------------
weight 2.044*** 1.747**
(5.42) (2.72)
mpg -49.51
(-0.57)
_cons -6.707 1946.1
(-0.01) (0.54)
---------------------------------------------------------
N 74 74
---------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
esttab, mlabels(none) modelwidth(25)
----------------------------------------------------------------------
(1) (2)
----------------------------------------------------------------------
weight 2.044*** 1.747**
(5.42) (2.72)
mpg -49.51
(-0.57)
_cons -6.707 1946.1
(-0.01) (0.54)
----------------------------------------------------------------------
N 74 74
----------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
上述两个选项也可以组合使用:
-----------------------------------------------------------------------------------
(1) (2)
-----------------------------------------------------------------------------------
weight 2.044*** 1.747**
(5.42) (2.72)
mpg -49.51
(-0.57)
_cons -6.707 1946.1
(-0.01) (0.54)
-----------------------------------------------------------------------------------
N 74 74
-----------------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001
对于LaTeX 输出,您需要在prehead() 或postfoot() 选项中酌情包含必要的标记。
在本例中,您可以按如下方式更改表格的字体大小:
esttab, mlabels(none) tex ///
prehead(`"\begin{table}"' `"\tiny"' ///
`"\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}"' ///
`"\begin{tabular}{l*{2}{c}}"') ///
postfoot(`"\end{tabular}"' `"\end{table}"')
同样,您可以通过更改低于{5pt}的值来控制列间距:
esttab, mlabels(none) tex ///
prehead(`"\setlength{\tabcolsep}{5pt}"' `"\begin{tabular}"')