I have a question about Latex tables and dcolumn package and I was hoping you could help me fix my problem. I am using dcolumn package to align my regression results from the decimal point. Everything looks fine but I also have a row that includes string values (Yes, No, etc.). For these strings, I use \multicolumn command to center align them with the rest of the column but, as you see in the minimal code and its output, the code aligns them with the numbers INCLUDING the significance stars and that is why the string values are pushed too much to the right. How can I revise this code so I still have the same format for the numeric values but the Yes, No values are center aligned with only numbers EXCLUDING the significance stars? Thanks for your help!
This is the minimal code:
\documentclass[11pt]{article}
\usepackage{amssymb,amsmath,color,booktabs,dcolumn,caption}
\usepackage[left=1in, right=1in, top=1in, bottom=1in]{geometry}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{document}
\begin{table}[h]\centering\small
\caption{Falsification Tests: Non-Fed-Regulated Firms}
\begin{tabular*}{\textwidth}{@{\hskip\tabcolsep\extracolsep\fill}l*{6}{d{2.6}}}
\toprule
&\multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} &\multicolumn{1}{c}{(3)} &\multicolumn{1}{c}{(4)} &\multicolumn{1}{c}{(5)} &\multicolumn{1}{c}{(6)} \\
\midrule
Post $\times$ Small Non-Fin.& -0.026 & -0.042 & -0.046 & 0.066 & 0.050 & 0.041 \\
& (0.051) & (0.055) & (0.047) & (0.082) & (0.083) & (0.071) \\ \addlinespace
log Assets & & -0.185\sym{***}& -0.197\sym{***}& & -0.288\sym{***}& -0.304\sym{***}\\
& & (0.059) & (0.041) & & (0.083) & (0.084) \\
Other Controls & \multicolumn{1}{c}{{No}} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{Yes} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{No} &\multicolumn{1}{c}{Yes} \\
\bottomrule
\end{tabular*}
\end{table}
\end{document}
And this is the output:
Best Answer
I could obtain what you want, with the
S
column type and the relevant parameters, defined bysiunitx
, which has more possibilities for fine-tuning. A simplification is that a non-numerical contents in anS
column is centred by just enclosing it in a pair of braces. I also simplified your definition of\sym
and some parts of your preamble, and usedtabularx
in the place oftabular*
.