Hi everyone,
I am trying to create a table in LaTeX using -estout- to export my results. In the following example, there is no problem:
Now, I add a hypothesis column to the table, but -@span- does not understand there is an extra column that has been added, and consequently the line segments below the header are one column off. Is there a way to make -@span- increase by one, so that I do not have to manually change -erepeat(\cmidrule(lr){@span})-?
In LaTeX, I am using:
Any idea is appreciated. Thanks,
Albert
I am trying to create a table in LaTeX using -estout- to export my results. In the following example, there is no problem:
Code:
sysuse auto
eststo: quietly reg price weight if foreign==0
eststo: quietly reg price weight mpg if foreign==0
eststo: quietly reg price weight if foreign==1
eststo: quietly reg price weight mpg if foreign==1
estout using "example.tex", ///
cells(b(star) t(par)) stats(r2 N) ///
prehead("\begin{tabular}{lc*{@M}{c}}" "\hline\hline") posthead(\hline) prefoot(\hline) postfoot(\hline\hline) ///
mgroups("Domestic" "Foreign", pattern(1 0 1 0) span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) ///
style(tex) label nolegend collabels(none) mlabel(none) numbers eqlabels(none) varlabels(_cons Constant) starlevels(* 0.10 ** 0.05 *** 0.01) replace
eststo clear
Code:
sysuse auto
eststo: quietly reg price weight if foreign==0
eststo: quietly reg price weight mpg if foreign==0
eststo: quietly reg price weight if foreign==1
eststo: quietly reg price weight mpg if foreign==1
estout using "example.tex", ///
cells(b(star) t(par)) stats(r2 N) ///
prehead("\begin{tabular}{lc*{@M}{c}}" "\hline\hline") posthead(\hline) prefoot(\hline) postfoot(\hline\hline) ///
mgroups("Domestic" "Foreign", pattern(1 0 1 0) span prefix(\multicolumn{@span}{c}{) suffix(}) erepeat(\cmidrule(lr){@span})) ///
style(tex) label nolegend collabels(none) mlabel(none) numbers eqlabels(none) varlabels(_cons Constant) starlevels(* 0.10 ** 0.05 *** 0.01) replace ///
labcol(+ +, title("" Hyp.))
eststo clear
Code:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\input{example}
\end{tabular}
\end{document}
Albert

Comment