I am outputting regression results from Stata to Latex. The problem is that, no matter how many columns I have, the spacing between the last column and the rest of the table is wider than other columns. I believe this is because I include a long note via the eesttab option in Stata:
addnote("\begin{minipage}[t]{\columnwidth} 4-line CAPTION \end{minipage}")
Here is an example of Latex output:
\begin{document}
\begin{landscape}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\setlength{\tabcolsep}{1pt}
\renewcommand{\arraystretch}{.9}
\begin{longtable}{l*{8}{c}}
\caption{OLS: \% Managed Care (All Models)}\\
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}&\multicolumn{1}{c}{(6)}&\multicolumn{1}{c}{(7)}&\multicolumn{1}{c}{(8)}\\
& b/t & b/t & b/t & b/t & b/t & b/t & b/t & b/t \\
\hline
Emergency Fund Shock& -0.00156 & -0.00207\sym{**} & -0.00293\sym{***}& -0.00264\sym{***}& -0.0000396 & 0.000367 & 0.000420\sym{***}& 0.000420\sym{***}\\
& (-0.52) & (-3.13) & (-3.71) & (-3.62) & (-0.18) & (0.67) & (4.20) & (4.60) \\
\end{longtable}
}
\end{landscape}
\end{document}
Is there a better way to add a caption to tex tables via esttab in Stata? I am trying to avoid having to edit each table by hand.
Best Answer
I fixed your code because it doesn't typeset as is, I also changed some things to make the table "cleaner". I also removed the
\multicolumn
commands you added, which were useless considering you only had single columns. This command is useful if your header refers to 2 or more columns, but for a single one, it's not needed.I personally don't see particularly long space before the last column. Let me know if what you see below is what you see when you typeset.
The space I see between (7) and (8) is the same I see between (3) and (4) and between (4) and (5). I think it's just a matter of the amount of content.
One last thing, I commented out this command
\setlength{\tabcolsep}{1pt}
. The reason is that setting the column space to 1 point, it makes it even smaller than the default one. The table looked a bit better after removing that command. You could increase the value, but the spacing between columns will remain proportional, therefore pretty much unchanged.