1

I'm trying to shorten this table

enter image description here

but without any success. This table is too big for the page. It's supposed to contain 8 columns and not 6. I wrote the code via Stata software. For your information, this is the relevant code.

\begin{table}[htbp]\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Individual Effort}
\begin{tabular}{l*{8}{c}}
\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)}\\
            &\multicolumn{1}{c}{Model 1}&\multicolumn{1}{c}{Model 2}&\multicolumn{1}{c}{Model 3}&\multicolumn{1}{c}{Model 4}&\multicolumn{1}{c}{Model 5}&\multicolumn{1}{c}{Model 6}&\multicolumn{1}{c}{Model 7}&\multicolumn{1}{c}{Model 8}\\
\hline
Future      &    -0.00346\sym{***}&     -0.0139\sym{***}&    -0.00426\sym{***}&     -0.0133\sym{***}&                     &    -0.00705\sym{***}&     -0.0102\sym{***}&     -0.0102\sym{***}\\
            &     (-3.69)         &    (-12.67)         &     (-4.55)         &    (-12.13)         &                     &     (-7.37)         &     (-8.61)         &     (-8.61)         \\
[1em]
Favourite's previous games&      0.0129\sym{**} &      0.0235\sym{***}&      0.0148\sym{***}&      0.0234\sym{***}&                     &      0.0212\sym{***}&      0.0237\sym{***}&      0.0237\sym{***}\\
            &      (3.02)         &      (5.45)         &      (3.47)         &      (5.46)         &                     &      (4.85)         &      (5.39)         &      (5.39)         \\
[1em]
Underdog's previous games&     -0.0121\sym{*}  &     -0.0177\sym{***}&     -0.0142\sym{**} &     -0.0186\sym{***}&                     &     -0.0219\sym{***}&     -0.0230\sym{***}&     -0.0230\sym{***}\\
            &     (-2.37)         &     (-3.47)         &     (-2.79)         &     (-3.66)         &                     &     (-4.44)         &     (-4.67)         &     (-4.67)         \\
[1em]
Heterogeneity&    -0.00639\sym{***}&    -0.00525\sym{***}&    -0.00616\sym{***}&    -0.00520\sym{***}&    -0.00522\sym{***}&    -0.00463\sym{***}&    -0.00439\sym{***}&    -0.00439\sym{***}\\
            &    (-32.66)         &    (-25.65)         &    (-30.74)         &    (-24.88)         &    (-15.42)         &    (-14.04)         &    (-13.40)         &    (-13.40)         \\
[1em]
Spread      &   0.0000402         &    -0.00157         &    -0.00109         &    -0.00203         &    -0.00107         &    -0.00376         &    -0.00364         &    -0.00364         \\
            &      (0.03)         &     (-1.02)         &     (-0.70)         &     (-1.32)         &     (-1.43)         &     (-1.81)         &     (-1.78)         &     (-1.78)         \\

_cons & 11.33\sym{*}& 12.52\sym{}& 9.548\sym{} & 10.41\sym{} & 11.35\sym{}& 11.77\sym{}& 12.14\sym{}& 12.14\sym{}\ & (52.05) & (55.29) & (2.05) & (2.24) & (67.09) & (64.19) & (63.73) & (63.73) \ \hline (N) & 36194 & 36194 & 36194 & 36194 & 37060 & 36194 & 36194 & 36194 \ \hline\hline \multicolumn{9}{l}{\footnotesize \textit{t} statistics in parentheses}\ \multicolumn{9}{l}{\footnotesize \sym{} (p<0.05), \sym{} (p<0.01), \sym{*} (p<0.001)}\ \end{tabular} \end{table}

This is the main code on Overleaf:

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{project1} \author{sadas} \date{January 2023}

\usepackage{graphicx} \usepackage{booktabs} \usepackage{graphics} \usepackage{subcaption} \usepackage{mwe}

\begin{document}

\input{table3a.tex}

\end{document}

Werner
  • 603,163

3 Answers3

1

To fit normally you would have to shrink it to illegibility. OTOH, it fits pretty well when rotated.

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{project1} \author{sadas} \date{January 2023}

\usepackage{graphicx} \usepackage{booktabs} \usepackage{subcaption} \usepackage{showframe}% MWE only

\begin{document}

\begin{table}[p] \rotatebox{90}{\begin{minipage}[c][\textwidth][c]{\textheight} \centering \def\sym#1{\ifmmode^{#1}\else(^{#1})\fi} \caption{Individual Effort} \begin{tabular}{p{5em}l{7}{c}} \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)}\ &\multicolumn{1}{c}{Model 1}&\multicolumn{1}{c}{Model 2}&\multicolumn{1}{c}{Model 3}&\multicolumn{1}{c}{Model 4}&\multicolumn{1}{c}{Model 5}&\multicolumn{1}{c}{Model 6}&\multicolumn{1}{c}{Model 7}&\multicolumn{1}{c}{Model 8}\ \hline Future & -0.00346\sym{}& -0.0139\sym{}& -0.00426\sym{}& -0.0133\sym{}& & -0.00705\sym{}& -0.0102\sym{}& -0.0102\sym{}\ & (-3.69) & (-12.67) & (-4.55) & (-12.13) & & (-7.37) & (-8.61) & (-8.61) \ [1em] Favourite's previous games& 0.0129\sym{} & 0.0235\sym{*}& 0.0148\sym{}& 0.0234\sym{}& & 0.0212\sym{}& 0.0237\sym{}& 0.0237\sym{}\ & (3.02) & (5.45) & (3.47) & (5.46) & & (4.85) & (5.39) & (5.39) \ [1em] Underdog's previous games& -0.0121\sym{} & -0.0177\sym{*}& -0.0142\sym{} & -0.0186\sym{*}& & -0.0219\sym{}& -0.0230\sym{}& -0.0230\sym{}\ & (-2.37) & (-3.47) & (-2.79) & (-3.66) & & (-4.44) & (-4.67) & (-4.67) \ [1em] Hetero-geneity& -0.00639\sym{}& -0.00525\sym{}& -0.00616\sym{}& -0.00520\sym{}& -0.00522\sym{}& -0.00463\sym{}& -0.00439\sym{}& -0.00439\sym{*}\ & (-32.66) & (-25.65) & (-30.74) & (-24.88) & (-15.42) & (-14.04) & (-13.40) & (-13.40) \ [1em] Spread & 0.0000402 & -0.00157 & -0.00109 & -0.00203 & -0.00107 & -0.00376 & -0.00364 & -0.00364 \ & (0.03) & (-1.02) & (-0.70) & (-1.32) & (-1.43) & (-1.81) & (-1.78) & (-1.78) \

_cons & 11.33\sym{*}& 12.52\sym{}& 9.548\sym{} & 10.41\sym{} & 11.35\sym{}& 11.77\sym{}& 12.14\sym{}& 12.14\sym{}\ & (52.05) & (55.29) & (2.05) & (2.24) & (67.09) & (64.19) & (63.73) & (63.73) \ \hline (N) & 36194 & 36194 & 36194 & 36194 & 37060 & 36194 & 36194 & 36194 \ \hline\hline \multicolumn{9}{l}{\footnotesize \textit{t} statistics in parentheses}\ \multicolumn{9}{l}{\footnotesize \sym{} (p<0.05), \sym{} (p<0.01), \sym{*} (p<0.001)}\ \end{tabular} \end{minipage}} \end{table}

\end{document}

John Kormylo
  • 79,712
  • 3
  • 50
  • 120
  • Thank you so much!!! – LucaToni Jan 15 '23 at 21:41
  • Another question, if you don't mind - how do I send the exact table (in that latex format) to word? I don't want to screenshot the table and paste in on the word file, because then it won't look good. – LucaToni Jan 15 '23 at 22:00
  • You could use standalone and convert the page into a PDF. You won't need the table, minipage or caption if you are using MS word. – John Kormylo Jan 15 '23 at 22:20
0

OK, I can get it down to only 50pt too wide. Any more than that needs deep surgery. I removed a lot of garbage and replaced the multiple asterisks with daggers and double-daggers which take FAR less space and are much more common for footnoting. I narrowed the first column and made it multirow. I made the numeric columns right-aligned so the digits look better, and moved the footnote symbols to a separate column beside each number, with the space between them removed. What this shows is that your REAL problem is that the numeric values for Spread, Heterogeneity, and Future are simply too long for a portrait-orientation table and should probably be done in landscape. Alternatively (1) make the margins smaller so that the text width becomes wider. The default LaTeX classes are not meant for publication use: they're just draft mode; or (2) use scientific notation (power-of-10) and see if that reduces the width. Software-generated tables for anything except the most trivial data are almost always wrong.

\documentclass{article}
\usepackage{array,ragged2e,multirow}
\begin{document}
\title{project1}
\author{sadas}
\newcommand{\p}[1]{\rlap{ #1}}
\newcommand{\vstrut}{\vrule height1.2em width0pt}
\date{January 2023}
\maketitle
\begin{table}[htbp]
  \centering
  \caption{Individual Effort}
  \medskip\small
  \tabcolsep1pt
  \begin{tabular}{@{}>{\vstrut\RaggedRight}m{1.5cm}*{8}{>{\(}r<{\)}@{}l}@{}}
    \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)}&\\
    &\mbox{Model 1}&&\mbox{Model 2}&&\mbox{Model 3}&&\mbox{Model 4}
   &&\mbox{Model 5}&&\mbox{Model 6}&&\mbox{Model 7}&&\mbox{Model 8}&\\
    \hline
    \multirow{2}{=}{Future}
    & -0.00346&\ddag
    & -0.0139&\ddag
    & -0.00426&\ddag
    & -0.0133&\ddag
    &        &
    & -0.00705&\ddag
    & -0.0102&\ddag
    & -0.0102&\ddag
    \\
    &  (-3.69&)
    & (-12.67&)
    &  (-4.55&)
    & (-12.13&)
    &        &
    &  (-7.37&)
    &  (-8.61&)
    &  (-8.61&)
    \\[1em]
    \multirow{2}{=}[.5\baselineskip]{Favourite's previous games}
    & 0.0129&\dag
    & 0.0235&\ddag
    & 0.0148&\ddag
    & 0.0234&\ddag
    &       &
    & 0.0212&\ddag
    & 0.0237&\ddag
    & 0.0237&\ddag
    \\
            &      (3.02&)         &      (5.45&)         &      (3.47&)         &      (5.46&)         &   &                  &      (4.85&)         &      (5.39&)         &      (5.39&)         \\
[1em]
\multirow{2}{=}[.5\baselineskip]{Underdog's previous games}&     -0.0121&*  &     -0.0177&\ddag&     -0.0142&\dag &     -0.0186&\ddag&       &              &     -0.0219&\ddag&     -0.0230&\ddag&     -0.0230&\ddag\\
            &     (-2.37&)         &     (-3.47&)         &     (-2.79&)         &     (-3.66&)         & &                    &     (-4.44&)         &     (-4.67&)         &     (-4.67&)         \\
[1em]
\multirow{2}{=}{Hetero\-geneity}&    -0.00639&\ddag&    -0.00525&\ddag&    -0.00616&\ddag&    -0.00520&\ddag&    -0.00522&\ddag&    -0.00463&\ddag&    -0.00439&\ddag&    -0.00439&\ddag\\
            &    (-32.66&)         &    (-25.65&)         &    (-30.74&)         &    (-24.88&)         &    (-15.42&)         &    (-14.04&)         &    (-13.40&)         &    (-13.40&)         \\
[1em]
\multirow{2}{=}{Spread}      &   0.0000402&         &    -0.00157&         &    -0.00109&         &    -0.00203&         &    -0.00107&         &    -0.00376&         &    -0.00364&         &    -0.00364&         \\
            &      (0.03&)         &     (-1.02&)         &     (-0.70&)         &     (-1.32&)         &     (-1.43&)         &     (-1.81&)         &     (-1.78&)         &     (-1.78&)         \\[1em]
\multirow{2}{=}{\texttt\_cons}      &       11.33&\ddag&       12.52&\ddag&       9.548&*  &       10.41&*  &       11.35&\ddag&       11.77&\ddag&       12.14&\ddag&       12.14&\ddag\\
            &     (52.05&)         &     (55.29&)         &      (2.05&)         &      (2.24&)         &     (67.09&)         &     (64.19&)         &     (63.73&)         &     (63.73&)         \\
\hline
\(N\)       &       36194         &&       36194         &&       36194         &&       36194         &&       37060         &&       36194        &&       36194         &&       36194    &     \\
\hline\hline
  \end{tabular}
  \flushleft
{\footnotesize \textit{t} statistics in parentheses}\\
{\footnotesize * \(p<0.05\),\quad \dag\ \(p<0.01\),\quad \ddag\ \(p<0.001\)}\\

\end{table} \end{document}

Image of the resulting PDF

0
  • Your table is to wide, even if you use smaller font size (for example \footnotesize) that can be fit in portrait page and when it be at same time more nice (with numbers aligned at decimal points) in landscape page too.
  • So, I would do the following:
    • by use of the geometry package increase text block size
    • insert table in sidewaystable environment of rotating package
    • by use of the S columns of siunitx package align all numbers except in the last table row
    • organise cells in the first column in two row cells
    • for table use longtblr table defined in the tabullaray package
\documentclass{article}
\usepackage{geometry}
\usepackage{rotating}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\newcommand\TN[1]{\TblrNote{#1}}

\begin{document} \begin{sidewaystable} \small \begin{talltblr}[ caption = {Individual Effort}, label = {tab:statistic}, note{} = {\textit{t} statistics in parentheses\ (^{}\ p<0.05), (^{}\ p<0.01), (^{}\ p<0.001)} ]{colsep = 1pt, colspec = {@{} X[l] *{8}{Q[c, si={table-format={(}-2.5{$^{}$}, input-open-uncertainty =, input-close-uncertainty=, table-align-text-after = false, table-align-text-before = false}]} @{}}, row{1,2,Z} = {guard, c}, cell{odd[1-X]}{1} = {r=2}{}, row{3-X}= {rowsep=-2pt}, row{odd[3-X]} = {abovesep=1ex}, } \toprule & \SetCell[c=8]{c} Model & & & & & & & \ \midrule & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \ \midrule
Future
& -0.00346\TN{
} & -0.0139\TN{} & -0.00426\TN{} & -0.0133\TN{} & & -0.00705\TN{} & -0.0102\TN{} & -0.0102\TN{} \ & (-3.69)
& (-12.67)
& (-4.55) & (-12.13) & & (-7.37) & (-8.61) & (-8.61) \ Favourite's previous games & 0.0129\TN{
} & 0.0235\TN{*} & 0.0148\TN{} & 0.0234\TN{} & & 0.0212\TN{} & 0.0237\TN{} & 0.0237\TN{} \ & (3.02)
& (5.45) & (3.47) & (5.46) & & (4.85) & (5.39) & (5.39) \ Underdog's previous games & -0.0121\TN{
}
& -0.0177\TN{*} & -0.0142\TN{} & -0.0186\TN{*} & & -0.0219\TN{} & -0.0230\TN{} & -0.0230\TN{} \ & (-2.37) & (-3.47) & (-2.79) & (-3.66) & & (-4.44) & (-4.67) & (-4.67) \ Heterogeneity & -0.00639\TN{} & -0.00525\TN{} & -0.00616\TN{} & -0.00520\TN{} & -0.00522\TN{} & -0.00463\TN{} & -0.00439\TN{} & -0.00439\TN{} \ & (-32.66) & (-25.65) & (-30.74) & (-24.88) & (-15.42) & (-14.04) & (-13.40)
& (-13.40) \ Spread
& 0.00004%02 & -0.00157 & -0.00109 & -0.00203 & -0.00107 & -0.00376 & -0.00364 & -0.00364 \ & (0.03) & (-1.02) & (-0.70) & (-1.32) & (-1.43) & (-1.81) & (-1.78) & (-1.78) \ _cons
& 11.33\TN{
} & 12.52\TN{} & 9.548\TN{} & 10.41\TN{} & 11.35\TN{} & 11.77\TN{} & 12.14\TN{} & 12.14\TN{*} \ & (52.05) & (55.29) & (2.05) & (2.24) & (67.09) & (64.19) & (63.73) & (63.73) \ \midrule (N)
& 36194 & 36194
& 36194 & 36194 & 37060 & 36194 & 36194 & 36194 \ \bottomrule \end{talltblr} \end{sidewaystable} \end{document}

enter image description here

(red lines indicate page layout)

Zarko
  • 296,517