Tips 29 :esttab将回归结果导入Latex

标签:
导出结果latex财经 |
分类: 导出结果 |
【问题】
可是,我们更为常用的是将回归结果导入Latex
【方法】
比较方法的是利用esttab
【例子】
*安装相关命令
ssc install esttab,replace
use auto,clear
reg
est store m1
esttab m1 using esttab1.tex, replace
*tex文件
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{1}{c}}
\hline\hline
\hline
mpg
[1em]
rep78
[1em]
trunk
[1em]
\_cons
\hline
\(N\)
\hline\hline
\multicolumn{2}{l}{\footnotesize \textit{t} statistics in
parentheses}\\
\multicolumn{2}{l}{\footnotesize \sym{*} \(p<0.05\),
\sym{**} \(p<0.01\), \sym{***}
\(p<0.001\)}\\
\end{tabular}
}
*运行后结果
http://s11/bmiddle/629bb758hb64baece970a&69029
*再加一列
reg
est store m2
esttab m1 m2 using esttab1.tex, replace
*tex代码
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{2}{c}}
\hline\hline
\hline
mpg
[1em]
rep78
[1em]
trunk
[1em]
length