1

I am having a few problems with the following code:

\documentclass{standalone}
\usepackage{booktabs}
\usepackage{siunitx}

\begin{document}
\begin{tabular}{
 l
  S[table-format = 4.2]
  S[table-format = 4.2] 
  S[table-format = 4.2]
  S[table-format = 4.2]
  S[table-format = 4.2]
  S[table-format = 4.2]
  S[table-format = 4.2]
  S[table-format = 4.2]
  S[table-format = 4.2]
}
\toprule
 &  \multicolumn{3}{c}{HF} &    \multicolumn{3}{c}{LF} &        \multicolumn{3}{c}{HF-LF} \\
 \midrule
Excess &    -0.79\textsuperscript{***} &                               &                               &    -0.90\textsuperscript{***} &                               &                               &                         -0.11 &                               &                               \\
 &                \tiny(0.152) &                               &                               &                  \tiny(0.161) &                               &                               &                  \tiny(0.066) &                               &                               \\
$\alpha$ &                             &    -0.77\textsuperscript{***} &    -0.79\textsuperscript{***} &                               &    -0.89\textsuperscript{***} &    -0.94\textsuperscript{***} &                               &      -0.13\textsuperscript{*} &     -0.16\textsuperscript{**} \\
 &                             &                  \tiny(0.161) &                  \tiny(0.172) &                               &                  \tiny(0.174) &                  \tiny(0.178) &                               &                  \tiny(0.066) &                  \tiny(0.069) \\
MKT &                              &                         -0.07 &                         -0.06 &                               &                         -0.02 &                         -0.00 &                               &       0.05\textsuperscript{*} &      0.06\textsuperscript{**} \\
 &                             &                  \tiny(0.056) &                  \tiny(0.064) &                               &                  \tiny(0.038) &                  \tiny(0.049) &                               &                  \tiny(0.028) &                  \tiny(0.027) \\
SMB &                              &                               &                          0.04 &                               &                               &                          0.04 &                               &                               &                          0.00 \\
 &                             &                               &                  \tiny(0.095) &                               &                               &                  \tiny(0.084) &                               &                               &                  \tiny(0.024) \\
HML &                              &                               &                          0.04 &                               &                               &                          0.11 &                               &                               &                          0.06 \\
 &                             &                               &                  \tiny(0.085) &                               &                               &                  \tiny(0.072) &                               &                               &                  \tiny(0.041) \\
\bottomrule
\end{tabular}
\end{document}

The result:

enter image description here

I would be grateful for any suggestions where to look in the docs and/or solutions and improvements.

The issues I cannot figure out how to fix:

  • The number in parenthesis are standard errors and should be right aligned with the bigger numbers above them. Basically, the ) should end before any asterisk. Any approximate result that improves is also ok.
  • The asterisks at the right end of the table are truncated (why?)
  • [minor] Can I improve the code and avoid typing \tiny for each entry in each second row?
  • [minor] Can I improve the code and avoid typing \textsuperscript{<asterisks>} by definying a special column format? I will only have this format at -#.##*** with variable length of the whole part.
1

I went with the following implementation which partly satisfies needs, although does not provide a generic solution to the problem:

\documentclass{standalone}
\usepackage{booktabs,tabu}
\usepackage{siunitx}

\begin{document}
    \begin{tabu}{l  
      *{9}{S[table-format          = -2.2,
             table-space-text-post = $^{***}$ ,
             table-align-text-post = false,
             table-text-alignment  = center]
             @{}
             }
      }
    \toprule
                            &\multicolumn{3}{c}{Low Frequency} &\multicolumn{3}{c}{High Frequency} &\multicolumn{3}{c}{HF-LF} \\
    \cmidrule(lr){2-4}\cmidrule(lr){5-7}\cmidrule(lr){8-10}
                     Excess &-0.79$^{***}$ &              &              &-0.90$^{***}$ &              &              &        -0.11 &              &              \\
    \rowfont{\footnotesize} &    {(0.152)} &              &              &    {(0.161)} &              &              &    {(0.066)} &              &              \\[3pt]
                   $\alpha$ &              &-0.77$^{***}$ &-0.79$^{***}$ &              &-0.89$^{***}$ &-0.94$^{***}$ &              &    -0.13$^*$ & -0.16$^{**}$ \\
    \rowfont{\footnotesize} &              &    {(0.161)} &    {(0.172)} &              &    {(0.174)} &    {(0.178)} &              &    {(0.066)} &    {(0.069)} \\[3pt]
                        MKT &              &        -0.07 &        -0.06 &              &        -0.02 &        -0.00 &              &     0.05$^*$ &  0.06$^{**}$ \\
    \rowfont{\footnotesize} &              &    {(0.056)} &    {(0.064)} &              &    {(0.038)} &    {(0.049)} &              &    {(0.028)} &    {(0.027)} \\[3pt]
                        SMB &              &              &         0.04 &              &              &         0.04 &              &              &         0.00 \\
    \rowfont{\footnotesize} &              &              &    {(0.095)} &              &              &    {(0.084)} &              &              &    {(0.024)} \\[3pt]
                        HML &              &              &         0.04 &              &              &         0.11 &              &              &         0.06 \\
    \rowfont{\footnotesize} &              &              &    {(0.085)} &              &              &    {(0.072)} &              &              &    {(0.041)} \\
    \bottomrule
    \end{tabu}
\end{document}

enter image description here

The main issue is that I cannot enforce a size on decimal entries that are in mathmode. To set the font size for the whole row I used the tabu solution explained on Different font sizes for different rows in table. However, I need the standard errors to be in text mode {(###)}, or the size command is not propagated (numeric entries are parsed by either siunitx or dcolumn and split in components, hence only the first component of the number is affected by the font command). The drawback in this solution is that alignment of the {text} part is somewhat hacky and fine-tuned for this specific application.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.