5

I want to add a table note below the table using the \multicolumn command.

Explicitly, I don't want to use the threeparttable style.

As you can see, the 6th column is set with more space to the other columns. I think it's due to:

\multicolumn{7}{p{\linewidth}}{\footnotesize Note: The regressions reported in column (3) and (6)
    control for the \textit{ward}. Perfect prediction of the variables \textit{adress}
    and \textit{household\_key} was proofed. Further information are given at the notes
    in Table \ref{table:6}.}

Which adjustments had to be done to get the same space between column 6 and 5 as between column 1 and 2 ?

\documentclass[a4paper,12pt]{article}
\usepackage{fancyhdr}
\usepackage[a4paper,lmargin={2.5cm},rmargin={2.5cm},
tmargin={2cm},bmargin = {2cm}]{geometry}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{float}
\usepackage{eurosym}



\usepackage[titletoc,title]{appendix}
\usepackage[nottoc,notlot,notlof]{tocbibind}

\usepackage{hyperref}
\linespread{1.25}
\floatstyle{plaintop}
\restylefloat{table}
\begin{table}[H] 
    \begin{center}
    \caption{Information Source of a Loan\label{table:7}}

    \resizebox{\textwidth}{!}{
    \begin{tabular}{@{\extracolsep{5pt}}lcccccc}
    \\[-1.8ex]\hline 
    \hline \\[-1.8ex] 
     & \multicolumn{6}{c}{\textit{Dependent variable:}} \\ 
    \cline{2-7} 
    \\[-1.8ex] & \multicolumn{3}{c}{runner75} & \multicolumn{3}{c}{runner} \\ 
     & \multicolumn{3}{c}{Transaction Accounts} & \multicolumn{3}{c}{Term Deposit Accounts} \\ 
    \\[-1.8ex] & (1) & (2) & (3) & (4) & (5) & (6)\\ 
    \hline \\[-1.8ex] 
    ln\_accountage      & $-0.0060^{***}$ & $-0.0060^{***}$ & $-0.0060^{***}$ & $-0.0158^{***}$ & $-0.0158^{***}$ & $-0.0129^{***}$ \\
                        & $(0.0014)$      & $(0.0014)$      & $(0.0014)$      & $(0.0022)$      & $(0.0022)$      & $(0.0029)$      \\
    opening\_balance    & $0.0001^{***}$  & $0.0001^{***}$  & $0.0001^{***}$  & $0.0033^{**}$   & $0.0033^{**}$   & $0.0042^{**}$   \\
                        & $(0.0000)$      & $(0.0000)$      & $(0.0000)$      & $(0.0011)$      & $(0.0011)$      & $(0.0015)$      \\
    avg\_withdraw\_chng & $0.1143^{*}$    & $0.1143^{*}$    & $0.1264^{*}$    &                 &                 &                 \\
                        & $(0.0561)$      & $(0.0561)$      & $(0.0539)$      &                 &                 &                 \\
    avg\_deposit\_chng  & $-0.0011$       & $-0.0011$       & $-0.0011$       &                 &                 &                 \\
                        & $(0.0012)$      & $(0.0012)$      & $(0.0012)$      &                 &                 &                 \\
    avg\_transaction    & $0.0000$        & $0.0000$        & $0.0000$        &                 &                 &                 \\
                        & $(0.0000)$      & $(0.0000)$      & $(0.0000)$      &                 &                 &                 \\
    minority\_dummy     & $0.0063^{*}$    & $0.0063^{*}$    & $0.0073$        & $0.0077$        & $0.0077$        & $0.0055$        \\
                        & $(0.0029)$      & $(0.0029)$      & $(0.0039)$      & $(0.0059)$      & $(0.0059)$      & $(0.0083)$      \\
    above\_insurance    & $0.3288^{***}$  & $0.3288^{***}$  & $0.3627^{***}$  & $0.0193$        & $0.0193$        & $0.0243$        \\
                        & $(0.0444)$      & $(0.0444)$      & $(0.0492)$      & $(0.0142)$      & $(0.0142)$      & $(0.0188)$      \\
    loanlink\_current   & $-0.0134^{***}$ & $-0.0134^{***}$ & $-0.0126^{***}$ & $-0.0347^{***}$ & $-0.0347^{***}$ & $-0.0401^{***}$ \\
                        & $(0.0032)$      & $(0.0032)$      & $(0.0035)$      & $(0.0059)$      & $(0.0059)$      & $(0.0058)$      \\
    loanlink\_before    & $-0.0132^{***}$ & $-0.0132^{***}$ & $-0.0129^{***}$ & $-0.0281^{**}$  & $-0.0281^{**}$  & $-0.0334^{***}$ \\
                        & $(0.0030)$      & $(0.0030)$      & $(0.0030)$      & $(0.0089)$      & $(0.0089)$      & $(0.0086)$      \\
    travel\_costs       &                 &                 & $0.0002$        &                 &                 & $-0.0072$       \\
                        &                 &                 & $(0.0011)$      &                 &                 & $(0.0037)$      \\
    loanlink\_after     &                 &                 & $-0.0097$       &                 &                 & $-0.0087$       \\
                        &                 &                 & $(0.0067)$      &                 &                 & $(0.0189)$      \\
    ln\_maturity        &                 &                 &                 & $-0.0204^{***}$ & $-0.0204^{***}$ & $-0.0229^{***}$ \\
                        &                 &                 &                 & $(0.0015)$      & $(0.0015)$      & $(0.0020)$      \\
    \hline
    AIC                 & 2143.9911       & 2143.9911       & 1878.1146       & 1679.2417       & 1679.2417       & 1329.3163       \\
    BIC                 & 2216.7627       & 2216.7627       & 2203.4264       & 1730.6668       & 1730.6668       & 1559.7964       \\
    Log Likelihood      & -1061.9956      & -1061.9956      & -893.0573       & -831.6208       & -831.6208       & -626.6582       \\
    Deviance            & 2123.9911       & 2123.9911       & 1786.1146       & 1663.2417       & 1663.2417       & 1253.3163       \\
    Num. obs.           & 10691           & 10691           & 8708            & 4574            & 4574            & 3182            \\
    \hline

    \multicolumn{7}{l}{\scriptsize{$^{***}p<0.001$, $^{**}p<0.01$, $^*p<0.05$}} \\
    \multicolumn{7}{p{\linewidth}}{\footnotesize Note: The regressions reported in column (3) and (6) control for the \textit{ward}. Perfect prediction of the variables \textit{adress} and \textit{household\_key} was proofed. Further information are given at the notes in Table \ref{table:6}.}
    \end{tabular}
    }
    \end{center}
    \end{table} 
    \end {document}
  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – karlkoeller Jan 10 '15 at 9:30
  • 1
    Please make your code ready to be compiled by other users by adding \documentclass, the packages you used and wrapping your code inside the document environment. – Pier Paolo Jan 10 '15 at 9:53
  • 1
    using \resizebox around a table is so wrong, it just produces font sizes inconsistent with the rest of the document – David Carlisle Jan 10 '15 at 10:05
  • what should be used instead to fit a large table into one page? – Jogi Jan 10 '15 at 12:37
10

Some comments:

  • It's not necessary to make the final "Note" paragraph a part of the tabular material. In fact, it is the \multicolumn{7}{p{\linewidth}{...} directive -- along with the @{\extracolsep{5pt}} in the header of the tabular environment -- that's causing the undesirable alignment of the final, i.e., 7th column. You'll save yourself a lot of work by placing the "Note" material outside the tabular but, of course, before the \end{table} statement.

  • Do give some thought to the alignment of the numerical information. Instead of using the generic c column type to place the material in columns 2 thru 7, I'd use a method that performs alignment on the decimal markers, using (say) the dcolumn package and its D column type. Doing so will also allow getting rid of about 210 $ symbols in the body of the table. (Incidentally, is it necessary to show four decimal digits for AIC, BIC, Log Likelihood, and Deviance? One decimal digit may do just as well -- and maybe even better...)

  • Instead of \hline and \cline (with the occasional, somewhat awkward \\[-1.8ex] spacing adjustment thrown in), consider loading the booktabs package and using its rule-drawing macros \toprule, \midrule, and \cmidrule. The spacing improvements are dramatic.

  • With a paper size of A4 and horizontal margins of 2.5cm, it's actually not necessary to encase the tabular material in a \resizebox statement to make the tabular material fit inside the text block. See also the next bullet point.

  • Finally, I suggest you use a tabular* environment instead of a tabular environment. Set the width of the tabular* environment to \textwidth, use @{\extracolsep{\fill}} instead of @{\extracolsep{5pt}}, and let LaTeX handle the issue of computing the amount of intercolumn whitespace.

enter image description here

\documentclass[12pt,a4paper]{article}
\usepackage[hmargin=2.5cm,vmargin=2cm]{geometry}
\usepackage{caption,booktabs,dcolumn}
\newcolumntype{d}[1]{D..{#1}}
%% Two handy shortcut macros:
  \newcommand{\mc}[1]{\multicolumn{1}{c}{#1}}
  \newcommand{\G}[1]{\multicolumn{1}{@{}d{5.4}@{}}{#1}}

\begin{document}
\begin{table}
\setlength\tabcolsep{1pt} % default value: 6pt
\caption{Information Source of a Loan\label{table:7}}
\begin{tabular*}{\textwidth}{@{} l 
                            @{\extracolsep{\fill}} %% let LaTeX determine best col sep
                            *{6}{d{2.6}} @{}}
\toprule
 & \multicolumn{6}{c@{}}{Dependent variable} \\ 
\cmidrule{2-7} 
 & \multicolumn{3}{c}{runner75} 
 & \multicolumn{3}{c@{}}{runner} \\ 
 & \multicolumn{3}{c}{Transaction Accounts} 
 & \multicolumn{3}{c@{}}{Term Deposit Accounts} \\ 
\cmidrule(lr){2-4} \cmidrule(l){5-7}
& \mc{(1)} & \mc{(2)} & \mc{(3)} & \mc{(4)} & \mc{(5)} & \multicolumn{1}{c@{}}{(6)}\\ 
\midrule  
ln\_accountage & -0.0060^{***} & -0.0060^{***} & -0.0060^{***} & -0.0158^{***} & -0.0158^{***} & -0.0129^{***} \\
  & (0.0014) & (0.0014) & (0.0014) & (0.0022) & (0.0022) & (0.0029) \\
opening\_balance  & 0.0001^{***} & 0.0001^{***} & 0.0001^{***} & 0.0033^{**} & 0.0033^{**} & 0.0042^{**} \\
  & (0.0000) & (0.0000) & (0.0000) & (0.0011) & (0.0011) & (0.0015) \\
avg\_withdraw\_chng & 0.1143^{*}  & 0.1143^{*}  & 0.1264^{*}  & & & \\
  & (0.0561) & (0.0561) & (0.0539) & & & \\
avg\_deposit\_chng & -0.0011 & -0.0011 & -0.0011 & & & \\
  & (0.0012) & (0.0012) & (0.0012) & & & \\
avg\_transaction  & 0.0000 & 0.0000 & 0.0000 & & & \\
  & (0.0000) & (0.0000) & (0.0000) & & & \\
minority\_dummy   & 0.0063^{*}  & 0.0063^{*}  & 0.0073 & 0.0077 & 0.0077 & 0.0055 \\
  & (0.0029) & (0.0029) & (0.0039) & (0.0059) & (0.0059) & (0.0083) \\
above\_insurance  & 0.3288^{***} & 0.3288^{***} & 0.3627^{***} & 0.0193 & 0.0193 & 0.0243 \\
  & (0.0444) & (0.0444) & (0.0492) & (0.0142) & (0.0142) & (0.0188) \\
loanlink\_current & -0.0134^{***} & -0.0134^{***} & -0.0126^{***} & -0.0347^{***} & -0.0347^{***} & -0.0401^{***} \\
  & (0.0032) & (0.0032) & (0.0035) & (0.0059) & (0.0059) & (0.0058) \\
loanlink\_before  & -0.0132^{***} & -0.0132^{***} & -0.0129^{***} & -0.0281^{**} & -0.0281^{**} & -0.0334^{***} \\
  & (0.0030) & (0.0030) & (0.0030) & (0.0089) & (0.0089) & (0.0086) \\
travel\_costs & & & 0.0002 & & & -0.0072  \\
  & & & (0.0011) & & & (0.0037) \\
loanlink\_after   & & & -0.0097 & & & -0.0087  \\
  & & & (0.0067) & & & (0.0189) \\
ln\_maturity & & & & -0.0204^{***} & -0.0204^{***} & -0.0229^{***} \\
  & & & & (0.0015) & (0.0015) & (0.0020) \\
\midrule
AIC & \G{2143.9911} & \G{2143.9911} & \G{1878.1146} & \G{1679.2417} & \G{1679.2417} & \G{1329.3163}  \\
BIC & \G{2216.7627} & \G{2216.7627} & \G{2203.4264} & \G{1730.6668} & \G{1730.6668} & \G{1559.7964}  \\
Log Likelihood & \G{-1061.9956} & \G{-1061.9956} & \G{-893.0573} & \G{-831.6208} & \G{-831.6208} & \G{-626.6582}  \\
Deviance & \G{2123.9911} & \G{2123.9911} & \G{1786.1146} & \G{1663.2417} & \G{1663.2417} & \G{1253.3163}  \\
Num.\ obs. & \mc{10691} & \mc{10691} & \mc{8708} & \mc{4574} & \mc{4574} & \mc{3182} \\
\midrule
\multicolumn{7}{@{}l}{\small $^{***}p<0.001$, $^{**}p<0.01$, $^*p<0.05$} \\[1ex]
\end{tabular*}
Note: The regressions reported in column (3) and (6) control for the \textit{ward}. 
  Perfect prediction of the variables \textit{adress} and \textit{household\_key} was 
  proofed. Further information is given in the notes of Table \ref{table:6}.
\end{table} 
\end{document}
  • Thanks Mico for your detailed answer!!! Regarding to the first point: which command must be used, to fit the notes to the same width as the table – Jogi Jan 10 '15 at 11:16
  • @Jogi - I suggest using a tabular* environment whose width is set to \textwidth; see also the final bullet point. By placing the text of the Note outside the tabular, it will be typeset in ordinary paragraph mode, to a width of \textwidth. That way, both elements (the tabular and the pararaph) will have the same widths. – Mico Jan 10 '15 at 11:18
  • Not so happy to have lost the tick, but you've deserved this one. +1 – karlkoeller Jan 10 '15 at 11:26

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.