加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

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

(2012-01-12 10:33:46)
标签:

导出结果

latex

财经

分类: 导出结果

【问题】

Tips 28:corrtex将相关系数矩阵导入Latex

可是,我们更为常用的是将回归结果导入Latex

【方法】

比较方法的是利用esttab

【例子】

*安装相关命令

ssc install esttab,replace

use auto,clear
reg  price mpg rep78 trunk
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
            &\multicolumn{1}{c}{(1)}\\
            &\multicolumn{1}{c}{price}\\
\hline
mpg             -252.3\sym{***}\\
               (-3.56)         \\
[1em]
rep78            650.1         \\
                (1.88)         \\
[1em]
trunk            42.47         \\
                (0.48)         \\
[1em]
\_cons          8711.3\sym{***}\\
                (3.64)         \\
\hline
\(N\)               69         \\
\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 :esttab将回归结果导入Latex" TITLE="Tips 29 :esttab将回归结果导入Latex" />

*再加一列

reg  price mpg length trunk
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
            &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}\\
            &\multicolumn{1}{c}{price}&\multicolumn{1}{c}{price}\\
\hline
mpg             -252.3\sym{***}&      -173.7         \\
               (-3.56)            (-1.97)         \\
[1em]
rep78            650.1                            \\
                (1.88)                            \\
[1em]
trunk            42.47             -0.855         \\
                (0.48)            (-0.01)         \\
[1em]
length                              21.40         \\
                                   (0.79)         \\
[1em]
\_cons          8711.3\sym{***}&      5854.0         \\
                (3.64)             (0.97)         \\
\hline
\(N\)               69                 74         \\
\hline\hline
\multicolumn{3}{l}{\footnotesize \textit{t} statistics in parentheses}\\
\multicolumn{3}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}
}
*运行后效果

http://s5/middle/629bb758h78a12b8ae674&69029 :esttab将回归结果导入Latex" TITLE="Tips 29 :esttab将回归结果导入Latex" />


0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有