The past few weeks I have put a huge effort into learning LateX for writing my thesis. However, making nice tables reamains a difficult job for me. I have provided a MWE of the 3 main tables I use below. I am wondering if some of you have some tips to make my tables look better. Besides those tips for the general improvement of my tables i'm wondering how:
- The number of observations (last row of tables 1 and 3) can be in line with the numbers in the other rows?
- The text under a table can be in line with the width of the table? As I assume this is a convention in making tables?
- If there is another possibility to show my readers that the rows can be viewed as groups, without using horizontal lines? See the tables on page 2 and 4. Some dates belong to particular groups in table 1 and I want to make this clear to my reader. In table 3 I want to group certain variables, therefore I use the horizontal lines.
Thank you in advance for your help!
Yannick
EDIT: the first MWE generated an error, due to the second table. I have deleted that table in the MWE below:
\documentclass[11pt]{article}
\usepackage[
textwidth=155mm,
top=23.5mm,
bottom=23.5mm,
footskip=40pt,
heightrounded,
]{geometry}
\usepackage[table,xcdraw]{xcolor}
\usepackage{rotating}
\usepackage{float}
\usepackage{rotfloat}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{array}
\usepackage{siunitx}
\usepackage{booktabs}
\begin{document}
\begin{table}[H]
\caption{Estimation Results Equation 11}
\sisetup{
output-exponent-marker = \text{e},
exponent-product={},
retain-explicit-plus,
input-open-uncertainty = ,
input-close-uncertainty = ,
table-align-text-pre = false,
table-align-text-post = false,
round-mode=places,
round-precision=3,
table-space-text-pre = (,
table-space-text-post = ),
}
\resizebox*{!}{\textheight}{\begin{minipage}{\textwidth}
\begin{center}
\begin{tabular}{lS[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}]}
\toprule\toprule
\multicolumn{1}{l}{Variable} & \multicolumn{1}{l}{US TP} & \multicolumn{1}{l}{US OIS} \\ \midrule
Constant & 0.059 & -0.095 \\
$\Delta y_{t-1}$ & -0.267*** & \\
\multicolumn{3}{c}{\textbf{QE 1}} \\
25-11-2008 & 4.142 & -29.389*** \\
25-11-2008 ($t+1$) & -1.899 & -6.033 \\
01-12-2008 & 0.284 & -19.282*** \\
01-12-2008 ($t+1$) & 5.071* & -5.366 \\
16-12-2008 & 0.894 & -30.548*** \\
16-12-2008 ($t+1$) & -12.920*** & 0.733 \\
28-01-2009 & -7.161*** & 13.256** \\
28-01-2009 ($t+1$) & -3.065 & 20.982*** \\
18-03-2009 & -17.389*** & -38.322*** \\
18-03-2009 ($t+1$) & -11.911*** & 7.639 \\
\multicolumn{3}{c}{\textbf{QE 2}} \\
10-08-2010 & -1.085 & -4.305 \\
10-08-2010 ($t+1$) & -2.208 & -4.024 \\
27-08-2010 & -0.260 & 17.874*** \\
27-08-2010 ($t+1$) & -0.470 & -12.380** \\
21-09-2010 & -1.229 & -12.582** \\
21-09-2010 ($t+1$) & -3.621 & 0.248 \\
15-10-2010 & 3.193 & 4.264 \\
15-10-2010 ($t+1$) & 1.456 & -5.798 \\
03-11-2010 & -0.211 & -2.045 \\
03-11-2010 ($t+1$) & -7.182*** & -3.722 \\
\multicolumn{3}{c}{\textbf{FG \& OT}} \\
09-08-2011 & 8.191*** & -8.668 \\
09-08-2011 ($t+1$) & 2.114 & -14.568** \\
21-09-2011 & -0.099 & -7.089 \\
21-09-11 ($t+1$) & -12.643*** & -4.917 \\
25-01-2012 & -2.363 & -5.459 \\
25-01-2012 ($t+1$) & -1.170 & -5.140 \\
20-06-2012 & -2.264 & 3.829 \\
20-06-2012 ($t+1$) & -2.247 & -2.510 \\
\multicolumn{3}{c}{\textbf{QE 3}} \\
22-08-2012 & 0.217 & -10.419* \\
22-08-2012 ($t+1$) & -4.278*** & -0.952 \\
31-08-2012 & 2.075 & -7.103 \\
31-08-2012 ($t+1$) & -0.130 & 0.816 \\
13-09-2012 & 7.971*** & -5.310 \\
13-09-2012 ($t+1$) & -0.834 & 12.160** \\
12-12-2012 & 0.063 & 4.113 \\
12-12-2012 ($t+1$) & 0.035 & 2.671 \\
\multicolumn{3}{c}{\textbf{Tapering}} \\
22-05-2013 & -2.957 & 11.709* \\
22-05-2013 ($t+1$) & 1.230 & -1.666 \\
19-06-2013 & -7.186*** & 18.181*** \\
19-06-2013 ($t+1$) & 8.391*** & 6.099 \\
18-12-2013 & -3.518 & 6.574 \\
18-12-2013 ($t+1$) & 0.310 & 5.909 \\ \midrule
$\Delta CESI_{vs}$ & -0.017* & 0.163*** \\
$\Delta CESI_{EU}$ & & \\ \midrule
Observations & 1973 & 1994 \\
R-squared (adj.) & 0.135 & 0.096 \\ \bottomrule
\end{tabular}
\caption*{\textbf{Notes:} Dependent variables in first differences. For the US, the date dummies are equal to one on the specified date ($t$), while for the EU the date dummies equal one the day after the specified date. *,**,*** denote the 10 percent, 5 percent and 1 percent significance levels, respectively.}
\end{center}
\end{minipage}}
\end{table}
\begin{sidewaystable}[h!]
\caption{Estimation Results Equation 12}
\sisetup{
output-exponent-marker = \text{e},
exponent-product={},
retain-explicit-plus,
input-open-uncertainty = ,
input-close-uncertainty = ,
table-align-text-pre = false,
table-align-text-post = false,
round-mode=places,
round-precision=3,
table-space-text-pre = (,
table-space-text-post = ),
}
\resizebox{\linewidth}{!}{
\begin{tabular}{lS[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}]S[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}] S[table-format=2.6, table-space-text-post = {***}]}
\toprule\toprule
\multicolumn{1}{l}{Variable} & \multicolumn{1}{l}{Austria} & \multicolumn{1}{l}{Belgium} & \multicolumn{1}{l}{Finland} & \multicolumn{1}{l}{France} & \multicolumn{1}{l}{Germany} & \multicolumn{1}{l}{Netherlands} & \multicolumn{1}{l}{Greece} & \multicolumn{1}{l}{Italy} & \multicolumn{1}{l}{Ireland} & \multicolumn{1}{l}{Portugal} & \multicolumn{1}{l}{Spain} \\ \midrule
Constant & -0.067 & -0.010 & -0.044 & -0.073 & 0.013 & -0.018 & 0.136 & -0.017 & -0.145 & 0.053 & 0.003 \\
QE 1 & -1.849*** & -1.059 & -0.936*** & -3.690*** & -5.896*** & -4.783*** & 0.639 & 2.053 & 6.530*** & 0.442 & 0.658** \\
QE 1 (2nd day) & -3.500 & -4.230** & -5.814*** & -5.979*** & -6.244*** & -5.755*** & -10.341** & -3.975*** & 1.967 & -5.376*** & -2.319** \\
QE 2 & 0.342 & -3.905*** & -0.504* & 0.991*** & -1.894*** & -0.658 & 30.766*** & 5.638*** & 37.893 & 15.763*** & 6.831*** \\
QE 2 (2nd day) & 0.522* & -3.449*** & -0.855 & 0.594*** & 0.096 & -1.065*** & 11.103*** & -5.017*** & 31.425 & -10.836*** & -6.417*** \\
QE 3 & -1.864*** & 3.147 & -0.864*** & -0.541* & -3.056*** & -0.774*** & -3.950 & 1.622*** & -2.682*** & 18.524*** & 5.431*** \\
QE 3 (2nd day) & -1.894*** & -7.920*** & -1.971*** & -1.683*** & -1.470*** & -1.841*** & 26.800*** & -15.558*** & 2.693*** & 0.911 & -12.520*** \\
FG & -0.410 & 0.341 & 2.411*** & 4.263*** & 3.445*** & 1.053*** & 8.496*** & -11.766*** & -5.652*** & 1.900 & -10.116*** \\
FG (2nd day) & -8.580*** & -11.539*** & 0.761*** & -11.181*** & 4.038*** & 0.399** & 16.614*** & -9.676*** & -3.559** & -24.045*** & -3.557*** \\
OT & -1.133** & -2.001 & -1.381*** & -6.644*** & -0.789** & -0.266 & -35.205** & -12.462*** & 10.440*** & -15.524*** & -19.544*** \\
OT (2nd day) & -2.227 & -6.233*** & -1.103*** & 1.309*** & -0.874 & -1.443*** & 20.981 & 13.201*** & 8.346*** & 14.632*** & 4.904 \\
Taper & 4.832 & -1.255 & -2.462 & 2.029*** & 0.217 & 3.740*** & 45.099*** & 3.081*** & 11.397*** & -3.917 & 5.224*** \\
Taper (2nd day) & 11.356 & -2.973 & -11.508 & -0.734 & 1.527*** & -1.603 & 62.386*** & 4.573*** & -7.958*** & -16.712 & 3.125*** \\ \midrule
VSTOXX & 0.096 & 3.966*** & -1.849* & 1.574* & -6.704*** & -1.683*** & 20.598*** & 14.519*** & 14.253*** & 21.830*** & 15.737*** \\
CDS10y & 0.226*** & 0.253*** & -0.085 & 0.163*** & -0.129*** & 0.076*** & 0.035** & 0.526** & 0.349*** & 0.548*** & 0.540*** \\
Quanto CDS & -0.010 & 0.281*** & 0.029 & 0.125*** & & 0.035 & -0.028 & 0.103** & 0.092* & 0.212*** & 0.246*** \\
Bid ask spread & 0.072 & 0.216 & 0.004*** & 0.055* & 1.062** & -0.213 & 0.169 & 0.001 & 0.039 & 0.057 & 0.144 \\
CESI & -0.001 & -0.000 & -0.001 & -0.001 & -0.001** & -0.000 & -0.003 & -0.000 & 0.001 & -0.001 & -0.000 \\
ECB ann. & -0.786 & -1.767** & -1.430** & -1.597*** & -0.788* & -1.453* & -2.866** & -1.484* & -1.805** & -1.782* & -2.131* \\ \midrule
$\Delta y_{t-1}$ & -0.141** & 0.049 & -0.195*** & -0.142* & -0.185** & -0.149*** & 0.079* & -0.061* & 0.056* & 0.079* & -0.049 \\
$\Delta y_{t-1,Italy}$ & 0.014 & 0.073* & 0.021 & 0.014 & -0.056** & -0.008 & 0.255** & & 0.105* & 0.059 & 0.025 \\
$\Delta y_{t-1,Spain}$ & -0.031 & -0.037* & -0.034 & -0.011 & 0.013 & -0.017 & -0.205 & -0.008 & -0.049 & -0.139* & \\
$\Delta y_{t-1,Portugal}$ & -0.010 & -0.012 & -0.001 & -0.011 & 0.002 & 0.001 & 0.111 & -0.011 & -0.004 & & -0.029* \\
$\Delta y_{t-1,Ireland}$ & 0.033 & 0.024* & 0.022* & 0.035* & 0.016 & 0.001 & -0.020 & 0.027 & & 0.005 & 0.032 \\
$\Delta y_{t-1,Greece}$ & -0.000 & -0.001 & -0.000 & -0.002 & 0.001 & -0.000 & & -0.006* & -0.004 & -0.006 & -0.005** \\
ARCH & & & & & & & & & & & \\ \midrule
Constant & 0.177** & 0.540*** & 0.193** & 0.328*** & 0.174*** & 0.183*** & 7.338*** & 0.516*** & 1.309*** & 0.366*** & 0.440** \\
L.arch & 0.128*** & 0.075*** & 0.151*** & 0.055*** & 0.158*** & 0.167*** & 0.160** & 0.057*** & 0.207*** & 0.218*** & 0.060*** \\
L(2).arch & -0.092** & & -0.117*** & & -0.129*** & -0.133*** & 0.573* & & 0.279* & -0.159*** & \\
L.garch & 0.958*** & 0.909*** & 0.960*** & 0.936*** & 0.965*** & 0.959*** & 0.613*** & 0.932*** & 0.517*** & 0.942*** & 0.933*** \\ \midrule
Observations & 2111 & 2190 & 2128 & 2039 & 2190 & 2111 & 2190 & 2190 & 1982 & 1965 & 2039 \\
AIC & 6.072635 & 6.174726 & 6.101 & 6.163 & 6.108 & 6.013 & 9.013 & 6.478 & 6.757 & 7.360 & 6.620 \\
BIC & 6.150320 & 6.247496 & 6.178 & 6.240 & 6.181 & 6.091 & 9.086 & 6.549 & 6.836 & 7.439 & 6.695 \\ \bottomrule
\end{tabular}}
\bigskip
\footnotesize{\textbf{Notes:} The table present the estimation results of equation 12. The dependent variables are in first differences and the results are showed in basis points. Bollerslev-Woolridge standard errors have been used to compute the coefficient covariance matrix. *,**,*** denote the 10 percent, 5 percent and 1 percent significance levels, respectively.}
\end{sidewaystable}
\end{document}
Here in a separate MWE the table which gives the error: Package array Error: Empty preamble: `l' used. \end{tabular}}
\documentclass[11pt]{article}
\usepackage[
textwidth=155mm,
top=23.5mm,
bottom=23.5mm,
footskip=40pt,
heightrounded,
]{geometry}
\usepackage[table,xcdraw]{xcolor}
\usepackage{rotating}
\usepackage{float}
\usepackage{rotfloat}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{array}
\usepackage{siunitx}
\usepackage{booktabs}
\begin{document}
\begin{table}[H]
\caption{Expected effect of the QE programs}
\renewcommand{\arraystretch}{1.3}
\resizebox{\columnwidth}{!}{
\begin{tabular}{l p{4cm} p{4cm} p{4cm} llll}
\toprule \toprule
\multicolumn{1}{l}{} & \multicolumn{1}{l}{QE 1} & \multicolumn{1}{l}{QE 2} & \multicolumn{1}{l}{QE 3} & \multicolumn{1}{l}{FG} & \multicolumn{1}{l}{OT} & \multicolumn{1}{}{Taper} & \\ \midrule
\multicolumn{7}{l}{\textbf{Term premium}} & \\
Incorporated ann. & 16-12-2008 , 18-03-2009 & 03-11-2010 & 22-08-2012 & 09-08-2012 & 21-09-2011 & 19-06-2013 & \\
Expected effect & $-$ & $-$ & $-$ & $-$ & $-$ & $+$ & \\
\multicolumn{7}{l}{\textbf{Yield}} & \\
Incorporated ann. & 25-01-2008, 01-12-2008, 16-12-2008, 18-03-2009 & 27-08-2010, 21-09-2010, 03-11-2010 & 22-08-2012, 13-09-2012 & 09-08-2012 & 21-06-2011 & 22-05-2013, 19-06-2013 & \\
Expected effect & $--$ & $--$ & $--$ & $--$ & $--$ & $++$ & \\ \bottomrule
\end{tabular}}
\tiny{\textbf{Notes:} A $-$ indicates a negative effect, while a $+$ indicates a positive effect. $--<-$ and $++>+$.}
\end{table}
\end{document}