2

TableI would like to use the following code to make a nice table, but I'm irritated by the inability to make the footnote of the table look nicer. FYI, I have printed this code directly from Stata using esttab, just the way I like it, so I'm not concerned about the table per se, rather only with the footnote. Any thoughts? Thanks!

The issue is that my fourth column shifts too far to the right. If I make many rows in the footer of the table, I can solve this problem, but then it looks ridiculously long. I would like to try to space out these four columns more evenly, so that I can reduce the height of the footnote.

\begin{table}[htbp]\centering \footnotesize
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Rural Determinants of Gold Expenditure Incidence: comparing Pooled OLS with FE and RE models}
\begin{tabular}{l*{3}{c}}
\hline\hline
                    &\multicolumn{1}{c}{Pooled OLS}&\multicolumn{1}{c}{FE Model}&\multicolumn{1}{c}{RE Model}\\
\hline
$MPCE_{nt}$           &       0.931\sym{**} &       0.883\sym{***}&       0.983\sym{***}\\
                    &     (0.356)         &     (0.319)         &     (0.325)         \\
[1em]
$MPCE^{2}_{nt}$       &      -0.017\sym{**} &      -0.018\sym{**} &      -0.017\sym{*}  \\
                    &     (0.007)         &     (0.007)         &     (0.010)         \\
[1em]
$MaleWage_{nt}$      &       0.520         &       0.479         &       0.670\sym{***}\\
                    &     (0.450)         &     (0.332)         &     (0.233)         \\
[1em]
$MaleWage^{2}_{nt}$   &      -0.008         &      -0.008         &      -0.010\sym{***}\\
                    &     (0.006)         &     (0.005)         &     (0.004)         \\
[1em]
$FemaleWage_{nt}$     &      -1.794\sym{***}&      -1.418\sym{***}&      -1.513\sym{***}\\
                    &     (0.465)         &     (0.424)         &     (0.397)         \\
[1em]
$FemaleWage^{2}_{nt}$ &       0.061\sym{***}&       0.051\sym{***}&       0.060\sym{***}\\
                    &     (0.014)         &     (0.014)         &     (0.016)         \\
\hline
Observations        &         264         &         264         &         264         \\
$R^2$                  &       0.768         &       0.113         &                     \\
\hline\hline
\multicolumn{4}{l}{Note: Dependent variable is $IncidenceGold_{nt}$ in every} \\
\multicolumn{4}{l}{estimation. The agricultural controls which have been used thus far,} \\
\multicolumn{4}{l}{i.e., $Output_{nt}$, $Foodprice_{nt}$, $Rainfall_{nt}$, and} \\
\multicolumn{4}{l}{$Rainfall_{nt-1}$, have been included, but are not reported.} \\
\multicolumn{4}{l}{Heteroskedastic and Autocorrelation Consistent (HAC) robust standard} \\
\multicolumn{4}{l}{errors are clustered at the district level and reported in the} \\
\multicolumn{4}{l}{parentheses. * p<0.10, ** p<0.05, and *** p<0.01}\\
\end{tabular}
\end{table}
  • 1
    Can you include screenshots of how it is right now and what you would like it to be? "Look nicer" is a quite vague term :) – Foitn Mar 9 '18 at 12:09
2

For these types of situations I try to use either tabu or longtabu, these provide a lot more features, such as automatic newline when needed, longtabu can be used if the table is too long for the page to make it go over the page, making sure the correct lable and everything is assigned.

Not completely your code, but this is how I would solve your problem:

\documentclass[a4paper]{article}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[singlelinecheck=false]{caption} %Use this to set the align to left

\begin{document}
    \centering \footnotesize
    \begin{longtabu} spread \textwidth{l X[c] X[c] X[c]}
        \caption{Rural Determinants of Gold Expenditure Incidence: comparing Pooled OLS with FE and RE models} \\
        \toprule
        \rowfont[c]{\bfseries}
                                & Pooled OLS & FE Model & RE Model\\
        \midrule
        $MPCE_{nt}$             &       0.931**       &       0.883***      &       0.983***\\
                                &     (0.356)         &     (0.319)         &     (0.325)         \\
                                &&&\\
        $MPCE^{2}_{nt}$         &      -0.017**       &      -0.018**       &      -0.017*  \\
                                &     (0.007)         &     (0.007)         &     (0.010)         \\
                                &&&\\
        $MaleWage_{nt}$         &       0.520         &       0.479         &       0.670***\\
                                &     (0.450)         &     (0.332)         &     (0.233)         \\
                                &&&\\
        $MaleWage^{2}_{nt}$     &      -0.008         &      -0.008         &      -0.010***\\
                                &     (0.006)         &     (0.005)         &     (0.004)         \\
                                &&&\\
        $FemaleWage_{nt}$       &      -1.794***      &      -1.418***      &      -1.513***\\
                                &     (0.465)         &     (0.424)         &     (0.397)         \\
                                &&&\\
        $FemaleWage^{2}_{nt}$   &       0.061***      &       0.051***      &       0.060***\\
                                &     (0.014)         &     (0.014)         &     (0.016)         \\
        \midrule
        Observations            &         264         &         264         &         264         \\
        $R^2$                   &       0.768         &       0.113         &                     \\
        \bottomrule 
        \multicolumn{4}{l}{Note: Dependent variable is $IncidenceGold_{nt}$ in every} \\
        \multicolumn{4}{l}{estimation. The agricultural controls which have been used thus far,} \\
        \multicolumn{4}{l}{i.e., $Output_{nt}$, $Foodprice_{nt}$, $Rainfall_{nt}$, and} \\
        \multicolumn{4}{l}{$Rainfall_{nt-1}$, have been included, but are not reported.} \\
        \multicolumn{4}{l}{Heteroskedastic and Autocorrelation Consistent (HAC) robust standard} \\
        \multicolumn{4}{l}{errors are clustered at the district level and reported in the} \\
        \multicolumn{4}{l}{parentheses. * p<0.10, ** p<0.05, and *** p<0.01}\\
    \end{longtabu}
\end{document}

It produces this table: The produced table

I hope this is what you were looking for

EDIT: Added the left align for the table caption, preview: enter image description here

  • Thanks! This is great! One thing: do you have any suggestions on how to get the table caption: "Table 1: etc." to flushleft? I don't like how it sits in the center. – Zatchet09 Mar 9 '18 at 13:22
  • With booktabs tables suddenly look much nicer! – Denis Mar 9 '18 at 13:26
  • @Zatchet09 Please see the edit :) – Foitn Mar 9 '18 at 13:30
7

like this?

enter image description here

with use of packages booktabs (for rules in table), threeparttable (for tnote and note below table), siunitx (for numbers align at decimal points) and caption (for beter caption formatting):

\documentclass{article}
\usepackage{siunitx}                  % <-- package  used in table
\usepackage{booktabs, threeparttable} % <-- packages used in table
\renewcommand{\tnote}[1]{\textsuperscript{#1}}
\usepackage[skip=1ex]{caption}

\begin{document}
    \begin{table}[htbp]
    \centering
\caption{Rural Determinants of Gold Expenditure Incidence:
         comparing Pooled OLS with FE and RE models}
\begin{threeparttable}
    \begin{tabular}{ l
                *{3}{S[table-format=-1.3,
                       table-space-text-post={***},
                       input-symbols = {(- )}]}
                }
    \toprule%\hline\hline
        &   {Pooled OLS}    &   {FE Model}      &   {RE Model}          \\
    \midrule%\hline
$MPCE_{nt}$
        &   0.931\tnote{**} &   0.883\tnote{***}&   0.983\tnote{***}    \\
        &  (0.356)          &  (0.319)          &  (0.325)              \\
    \addlinespace
$MPCE^{2}_{nt}$
        &  -0.017\tnote{**} &  -0.018\tnote{**} &  -0.017\tnote{*}      \\
        &  (0.007)          &  (0.007)          &  (0.010)              \\
    \addlinespace
$MaleWage_{nt}$
        &   0.520           &   0.479           &   0.670\tnote{***}    \\
        &  (0.450)          &  (0.332)          &  (0.233)              \\
    \addlinespace
$MaleWage^{2}_{nt}$
        &  -0.008           &  -0.008           &  -0.010\tnote{***}    \\
        &  (0.006)          &  (0.005)          &  (0.004)              \\
    \addlinespace
$FemaleWage_{nt}$
        &  -1.794\tnote{***}&  -1.418\tnote{***}&  -1.513\tnote{***}    \\
        &  (0.465)          &  (0.424)          &  (0.397)              \\
    \addlinespace
$FemaleWage^{2}_{nt}$
        &   0.061\tnote{***}&   0.051\tnote{***}&   0.060\tnote{***}    \\
        &  (0.014)          &  (0.014)          &  (0.016)              \\
    \midrule%\hline
Observations
        &   {264}           &   264             &   264                 \\
$R^2$   &   0.768           &   0.113           &                       \\
    \bottomrule%\hline\hline
    \end{tabular}
    \begin{tablenotes}[flushleft]\footnotesize
    \item[]
    Note: Dependent variable is $IncidenceGold_{nt}$ in every estimation. The agricultural controls which have been used thus far, i.e., $Output_{nt}$, $Foodprice_{nt}$, $Rainfall_{nt}$, and $Rainfall_{nt-1}$, have been included, but are not reported. 
    \item[]  Heteroskedastic and Autocorrelation Consistent (HAC) robust standard errors are clustered at the district level and reported in the parentheses.
    \item[] * $p<0.10$, ** $p<0.05$, and *** $p<0.01$
    \end{tablenotes}
\end{threeparttable}
    \end{table}
\end{document}

addendum: with use of threepartablex package with option referable for the note below of the table you can use command \note. also with defining a little bit wide S columns and use more correct syntax for variables named by words, the table become:

enter image description here

modified mwe is:

\documentclass{article}
\usepackage{amsmath}                    % <-- package  used in table
\usepackage{siunitx}                    % <-- package  used in table
\usepackage{booktabs}                   % <-- packages used in table
\usepackage[referable]{threeparttablex} % <-- packages used in table
\renewcommand{\tnote}[1]{\textsuperscript{#1}}
\usepackage[skip=1ex]{caption}

\begin{document}
    \begin{table}[htbp]
    \centering
\caption{Rural Determinants of Gold Expenditure Incidence:
         comparing Pooled OLS with FE and RE models}
    \label{tab:my table}
\begin{threeparttable}
    \begin{tabular}{>{$}l<{$} % <--- changed
                   *{3}{S[table-format=-1.3,
                          table-space-text-post={***},
                          input-symbols = {(- )},
                          table-column-width=6em]} % <--- added
                    }
    \toprule
        &   {\text{Pooled OLS}} &   {FE Model}      &   {RE Model}          \\
    \midrule
\mathit{MPCE}_{nt}
        &   0.931\tnote{**}     &   0.883\tnote{***}&   0.983\tnote{***}    \\
        &  (0.356)              &  (0.319)          &  (0.325)              \\
    \addlinespace
\mathit{MPCE}^{2}_{nt}
        &  -0.017\tnote{**}     &  -0.018\tnote{**} &  -0.017\tnote{*}      \\
        &  (0.007)              &  (0.007)          &  (0.010)              \\
    \addlinespace
\mathit{MaleWage}_{nt}
        &   0.520               &   0.479           &   0.670\tnote{***}    \\
        &  (0.450)              &  (0.332)          &  (0.233)              \\
    \addlinespace
\mathit{MaleWage}^{2}_{nt}
        &  -0.008               &  -0.008           &  -0.010\tnote{***}    \\
        &  (0.006)              &  (0.005)          &  (0.004)              \\
    \addlinespace
\mathit{FemaleWage}_{nt}
        &  -1.794\tnote{***}    &  -1.418\tnote{***}&  -1.513\tnote{***}    \\
        &  (0.465)              &  (0.424)          &  (0.397)              \\
    \addlinespace
\mathit{FemaleWage}^{2}_{nt}
        &   0.061\tnote{***}    &   0.051\tnote{***}&   0.060\tnote{***}    \\
        &  (0.014)              &  (0.014)          &  (0.016)              \\
    \midrule
\text{Observations}
        &   {264}           &   264             &   264                 \\
R^2     &   0.768           &   0.113           &                       \\
    \bottomrule
    \end{tabular}
    \begin{tablenotes}[flushleft]\footnotesize\parindent=1em
    \note Dependent variable is $\mathit{IncidenceGold}_{nt}$ in every estimation. The agricultural controls which have been used thus far, i.e., $\mathit{Output}_{nt}$, $\mathit{Foodprice}_{nt}$, $\mathit{Rainfall}_{nt}$, and $\mathit{Rainfall}_{nt-1}$, have been included, but are not reported.

    Heteroskedastic and Autocorrelation Consistent (HAC) robust standard errors are clustered at the district level and reported in the parentheses.
    \item[] * $p<0.10$, ** $p<0.05$, and *** $p<0.01$
    \end{tablenotes}
\end{threeparttable}
    \end{table}
\end{document}
6

Here is a solution based on threepartable and siunitx. I've added some colour:

\documentclass[review,authoryear,11pt]{elsarticle}
\usepackage{mathtools}
\usepackage{setspace}
\usepackage{threeparttable, booktabs, makecell, caption}
\usepackage{siunitx}
\usepackage[svgnames, table]{xcolor}
\renewcommand\theadfont{\normalsize\bfseries}

\newcommand{\MPCE}{\mathit{MPCE}}
\newcommand{\MW}{\mathit{MaleWage}}
\newcommand{\mW}{\textit{MaleWage}}
\newcommand{\FW}{\textit{FemaleWage}}

\begin{document}

\begin{table}[htbp]\centering \footnotesize
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\arrayrulecolor{LightSlateGray}
\begin{threeparttable}
\caption{Rural Determinants of Gold Expenditure Incidence: comparing Pooled OLS with FE and RE models}
\sisetup{table-format = -1.3, table-space-text-post = ***, table-align-text-post = false, table-space-text-pre = (, table-align-text-pre = false}
\begin{tabular}{l*{3}{S}}
\toprule
\specialrule{0.4pt}{1.2pt}{\belowrulesep}
                    & {Pooled OLS} & {FE Model} & {RE Model}\\
\midrule
$\MPCE_{nt}$ & 0.931\sym{**} & 0.883\sym{***}& 0.983\sym{***}\\
                    & {(}0.356{)} & {(}0.319{)} & {(}0.325{)} \\
[1em]
$\MPCE^{2}_{nt}$ & -0.017\sym{**} & -0.018\sym{**} & -0.017\sym{*} \\
                    & {(}0.007{)} & {(}0.007{)} & {(}0.010{)} \\
[1em]
$\MW_{nt}$ & 0.520 & 0.479 & 0.670\sym{***}\\
                    & {(}0.450{)} & {(}0.332{)} & {(}0.233{)} \\
[1em]
$\MW^{2}_{nt}$ & -0.008 & -0.008 & -0.010\sym{***}\\
                    & {(}0.006{)} & {(}0.005{)} & {(}0.004{)} \\
[1em]
$\FW_{nt}$ & -1.794\sym{***}& -1.418\sym{***}& -1.513\sym{***}\\
                    & {(}0.465{)} & {(}0.424{)} & {(}0.397{)} \\
[1em]
$FW^{2}_{nt}$ & 0.061\sym{***}& 0.051\sym{***}& 0.060\sym{***}\\
                    & {(}0.014{)} & {(}0.014{)} & {(}0.016{)} \\
\midrule
Observations & {264} & {264} & {264} \\
$R^2$ & 0.768 & 0.113 & \\
\specialrule{0.4pt}{\aboverulesep}{1.2pt}\bottomrule
\end{tabular}%
\smallskip\scriptsize
\begin{tablenotes}[flushleft]
  \item[]\textit{Note}: Dependent variable is $\mathit{IncidenceGold}_{nt}$ in every estimation. The agricultural controls which have been used thus far, i.e. $\mathit{Output}_{nt}$, $\mathit{Foodprice}_{nt}$, $\mathit{Rainfall}_{nt}$, and $\mathit{Rainfall}_{nt-1}$, have been included, but are not reported. \smallskip
      \item[] Heteroskedastic and Autocorrelation Consistent (HAC) robust standard errors are clustered at the district level and reported in the parentheses. \smallskip
       \item[]* $ p<0.10 $, \enspace ** $ p<0.05 $, and\enspace *** $ p<0.01 $.
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document} 

enter image description here

  • 1
    Quite nice but why two \toprule and bottomrule. Looks not very nice, imho. – Denis Mar 9 '18 at 13:30
  • 2
    @Denis: That's because the O.P. has two \hlines, and I slavishly adapted. But you're right. In teh same vein, there acn be two rules, but not of the same thickness. I'll fix that. – Bernard Mar 9 '18 at 13:35

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.