我可以将strate命令的结果输出到LaTeX吗?
使用Stata命令时,是否可以将其输出导出到我可以将strate命令的结果输出到LaTeX吗?,latex,stata,Latex,Stata,使用Stata命令时,是否可以将其输出导出到LaTeX表 例如,社区贡献的命令系列也可以这样做。使用strate命令的output()选项和esttab可以实现您想要的功能 考虑以下玩具示例: webuse diet, clear stset dox, origin(time doe) id(id) scale(365.25) fail(fail==1 3 13) stsplit ageband, at(40(10)70) after(time=dob) trim preserve temp
LaTeX
表
例如,社区贡献的命令系列也可以这样做。使用
strate
命令的output()
选项和esttab
可以实现您想要的功能
考虑以下玩具示例:
webuse diet, clear
stset dox, origin(time doe) id(id) scale(365.25) fail(fail==1 3 13)
stsplit ageband, at(40(10)70) after(time=dob) trim
preserve
tempfile myfile
strate ageband, per(1000) output(`myfile')
use `myfile', clear
mkmat *, matrix(A)
restore
esttab matrix(A), title("Summary results") ///
mlabels(, none) ///
varlabels(r1 " " r2 " " r3 " ")
Summary results
------------------------------------------------------------------------------------------
ageband _D _Y _Rate _Lower _Upper
------------------------------------------------------------------------------------------
40 6 .9070062 6.61517 2.971936 14.72457
50 18 2.107042 8.542783 5.382317 13.55906
60 22 1.493292 14.73255 9.700656 22.37457
------------------------------------------------------------------------------------------
est选项卡的tex
选项将产生所需的LaTeX
输出:
esttab matrix(A), title("Summary results") ///
mlabels(, none) ///
varlabels(r1 " " r2 " " r3 " ") ///
tex
\begin{table}[htbp]\centering
\caption{Summary results}
\begin{tabular}{l*{6}{c}}
\hline\hline
& ageband& \_D& \_Y& \_Rate& \_Lower& \_Upper\\
\hline
& 40& 6& .9070062& 6.61517& 2.971936& 14.72457\\
& 50& 18& 2.107042& 8.542783& 5.382317& 13.55906\\
& 60& 22& 1.493292& 14.73255& 9.700656& 22.37457\\
\hline\hline
\end{tabular}
\end{table}
你试过Est2Tex吗?你可以直接在Stata中搜索/下载。我试过了。但是,在strate
之后运行est2vec
会给我一个错误:未找到上一次估算值
。答案对您无效est2tex
(SSC)如文件所述用于评估结果,而strate
不是e级命令。故事到此为止。我没有比这更积极的建议了。