I am trying to format a booktabs table with multirow content. I am aware that vertical rules go against the booktabs style. However, in this table, it seems to me that some kind of vertical guide would help parsing across multiple rows. So I came up with huge curly brackets. My code and a figure of the current table is below. Is there a better (and nicer) way to aid parsing in this table – an alternative to what I have done below?
\documentclass{article}
\usepackage{amsthm,amsmath,amssymb,booktabs,array, multirow, rotating}
% For the huge curly brackets
\makeatletter
\newcommand{\Vast}{\bBigg@{2.5}}
\makeatother
\makeatletter
\newcommand{\Vastt}{\bBigg@{4.3}}
\makeatother
\makeatletter
\newcommand{\Vasttt}{\bBigg@{5.4}}
\makeatother
\makeatletter
\newcommand{\Vastttt}{\bBigg@{9.6}}
\makeatother
\begin{document}
\begin{sidewaystable}[!htb]
\caption{\textbf{Title of the table}}\label{tab2}
\begin{tabular}{@{}llllll@{}}
\midrule
\multicolumn{1}{l}{\textbf{Charac1}}
& \multicolumn{2}{c}{\textbf{Characteristics II}}
& \multicolumn{1}{c}{\textbf{Thing1}}
& \multicolumn{1}{c}{\textbf{Thing2}}
& \multicolumn{1}{c}{\textbf{Thing3}}\\\cmidrule(lr){2-3}
& \multicolumn{1}{c}{\textbf{Subthing1}}
& \multicolumn{1}{c}{\textbf{Subthing2}} & & &\\
\midrule
\multicolumn{1}{l}{XXX}
&\multicolumn{1}{c}{$\pi_{XXX}$}
&\multicolumn{1}{l}{None}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{}
&\multicolumn{1}{>{}c}{} \\\cmidrule(lr){1-2}
\multicolumn{1}{l}{XX}
&\multicolumn{1}{c}{$\eta_{XX}$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{\multirow{-2}{*}[0.5em]{{\Vast\}}Something here}}
&\multicolumn{1}{c}{}
&\multicolumn{1}{>{}c}{} \\\cmidrule(lr){1-2}
\multicolumn{1}{l}{XX}
&\multicolumn{1}{c}{$\zeta_{XXX}$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{}
&\multicolumn{1}{>{}l}{}\\\cmidrule(lr){1-2}
\multicolumn{1}{l}{XX}
&\multicolumn{1}{c}{$\epsilon$}
&\multicolumn{1}{l}{\multirow{-3}{*}[1.4em]{{\Vastt\}}Something}}
&\multicolumn{1}{l}{\multirow{-2}{*}[0.7em]{{\Vast\}}Something else}}
&\multicolumn{1}{c}{}
&\multicolumn{1}{>{}l}{} \\\cmidrule(lr){1-2}
\multicolumn{1}{l}{XX}
&\multicolumn{1}{c}{$\omega_{XX}$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{Something else}
&\multicolumn{1}{c}{}
&\multicolumn{1}{c}{} \\\cmidrule(lr){1-2}
\multicolumn{1}{l}{XX}
&\multicolumn{1}{c}{$\epsilon_{XXX}$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{c}{}
&\multicolumn{1}{c}{}
&\multicolumn{1}{>{}l}{}\\\cmidrule(lr){1-2}
\multicolumn{1}{l}{XX}
&\multicolumn{1}{c}{$\alpha$}
&\multicolumn{1}{l}{\multirow{-3}{*}[1.1em] {{\Vastt\}}Something}}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{\multirow{-7}{*}[3em]{{\Vastttt\}} Thing1+Thing3)}}
&\multicolumn{1}{>{}c}{\multirow{-7}{*}[1.5em]{\textit{Something else}}} \\\cmidrule(lr){1-2}
\multicolumn{1}{l}{XXX}
&\multicolumn{1}{c}{$XYZ=1$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{}
&\multicolumn{1}{>{}l}{}\\\cmidrule(lr){1-2}
\multicolumn{1}{l}{XXXX}
&\multicolumn{1}{c}{$XYZ_{AB}$}
&\multicolumn{1}{l}{\multirow{-2}{*}[0.5em]{{\Vast\}}Attribute}}
&\multicolumn{1}{l}{\multirow{-4}{*}[1.6em]{{\Vasttt\}}Something else}}
&\multicolumn{1}{l}{\multirow{-2}{*}[0.5em]{{\Vast\}}Things (thing1 \& thing2)}}
&\multicolumn{1}{l}{\multirow{-2}{*}[0.5em]{\textit{Something more}}}\\
\midrule
\end{tabular}
\\
\footnotesize{\textbf Some footnote}
\end{sidewaystable}\clearpage
\end{document}
Currently the output looks thus:
I am running up against a blank wall on ideas. Thanks for any guidance on this.
--------EDIT with a somewhat cleaner-looking solution----------------
Thanks to guidance from @ChrisS, @Werner and @cfr in the comments below, I coded a small redesign to the table, and it definitely looks much cleaner – even without the vertical rules. Code and final table below for reference (this was for an article here):
\documentclass[11pt]{article}
\usepackage[margin=0.75in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsthm,amsmath,amssymb,booktabs,array, multirow,rotating}
\makeatletter
\newcommand{\Vast}{\bBigg@{2.5}}
\makeatother
\makeatletter
\newcommand{\Vastt}{\bBigg@{4.3}}
\makeatother
\makeatletter
\newcommand{\Vasttt}{\bBigg@{5.4}}
\makeatother
\makeatletter
\newcommand{\Vastttt}{\bBigg@{9.6}}
\makeatother
\thispagestyle{empty}
\begin{document}
\begin{sidewaystable}[!htb]
\renewcommand\thetable{2}
\caption{\textbf{Summary of the modeling approaches included in the evaluation}}\label{tab2}
\begin{tabular}{@{}llllll@{}}
\midrule
\multicolumn{1}{l}{\textbf{Model}}
& \multicolumn{2}{c}{\textbf{Ensemble Characteristics}}
& \multicolumn{1}{c}{\textbf{Output}}
& \multicolumn{1}{c}{\textbf{Paradigm}}
& \multicolumn{1}{c}{\textbf{R Package}}\\\cmidrule(lr){2-3}
& \multicolumn{1}{c}{\textbf{Tuning parameter}}
& \multicolumn{1}{c}{\textbf{Model Space Construction}} & & &\\
\midrule
\multicolumn{1}{l}{ENC}
&\multicolumn{1}{c}{$\lambda_{ENC}$}
&\multicolumn{1}{l}{None}
&\multicolumn{1}{l}{Influential variables}
&\multicolumn{1}{l}{}
&\multicolumn{1}{>{}c}{} \\\cmidrule(lr){1-4}
\multicolumn{1}{l}{PS}
&\multicolumn{1}{c}{$\lambda_{MB}$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{Influential variables}
&\multicolumn{1}{c}{}
&\multicolumn{1}{>{}c}{} \\\cmidrule(lr){1-2}\cmidrule(lr){4-4}
\multicolumn{1}{l}{LS}
&\multicolumn{1}{c}{$\lambda_{ENC}$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{Inclusion probabilities}
&\multicolumn{1}{l}{}
&\multicolumn{1}{>{}l}{}\\\cmidrule(lr){1-2}\cmidrule(lr){4-4}
\multicolumn{1}{l}{SS}
&\multicolumn{1}{c}{$\Lambda$}
&\multicolumn{1}{l}{\multirow{-3}{*}[1.2em]{{\Vastt\}}Subsampling}}
&\multicolumn{1}{l}{Inclusion probabilities}
&\multicolumn{1}{c}{}
&\multicolumn{1}{>{}l}{} \\\cmidrule(lr){1-4}
\multicolumn{1}{l}{PR}
&\multicolumn{1}{c}{$\lambda_{MB}$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{Influential variables}
&\multicolumn{1}{c}{}
&\multicolumn{1}{c}{} \\\cmidrule(lr){1-2}\cmidrule(lr){4-4}
\multicolumn{1}{l}{LR}
&\multicolumn{1}{c}{$\lambda_{ENC}$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{Inclusion probabilities}
&\multicolumn{1}{c}{}
&\multicolumn{1}{>{}l}{}\\\cmidrule(lr){1-2}\cmidrule(lr){4-4}
\multicolumn{1}{l}{SR}
&\multicolumn{1}{c}{$\Lambda$}
&\multicolumn{1}{l}{\multirow{-3}{*}[1.2em] {{\Vastt\}}Resampling}}
&\multicolumn{1}{l}{Inclusion probabilities}
&\multicolumn{1}{l}{\multirow{-7}{*}[3em]{{\Vastttt\}} Frequentist ($l_{1}, l_{2}$ penalties)}}
&\multicolumn{1}{>{}c}{\multirow{-7}{*}[1.7em]{\textit{quadrupen, glmnet}}} \\\cmidrule(lr){1-6}
\multicolumn{1}{l}{BMA}
&\multicolumn{1}{c}{$EMS=1$}
&\multicolumn{1}{c}{}
&\multicolumn{1}{l}{Inclusion probabilities}
&\multicolumn{1}{l}{}
&\multicolumn{1}{>{}l}{}\\\cmidrule(lr){1-2}\cmidrule(lr){4-4}
\multicolumn{1}{l}{BMAC}
&\multicolumn{1}{c}{$EMS_{CV}$}
&\multicolumn{1}{l}{\multirow{-2}{*}[0.5em]{{\Vast\}}MCMC}}
&\multicolumn{1}{l}{Inclusion probabilities}
&\multicolumn{1}{l}{\multirow{-2}{*}[0.5em]{{\Vast\}}Bayesian (Spike \& slab prior)}}
&\multicolumn{1}{l}{\multirow{-2}{*}[0.2em]{\textit{BoomSpikeSlab}}}\\
\midrule
\end{tabular}
\footnotesize{\textbf{ENC:} The baseline penalized regression model. Elastic net with $\lambda_{optimal} =\lambda_{ENC}$ derived from cross-validation (CV), \textbf{Ensembles based on 100 subsamples:} \textbf{PS:} Meinshausen \& B{\"u}hlmann's algorithm with a single $\lambda_{optimal} = \lambda_{MB}$ selected to minimize the expected number of false positives, \textbf{LS:} Single $\lambda_{optimal} = \lambda_{ENC}$ with no variable selection, \textbf{SS:} Stability selection across the entire 100 $\lambda \in \Lambda$ grid with no variable selection, \textbf{Ensembles based on 100 resamples: }\textbf{PR, LR, SR:} Identical to PS, PR and LR, respectively, with model space constructed through resampling. \textbf{BMA:} Bayesian model averaging with expected model size ($EMS$) = 1, \textbf{BMAC:} BMA with EMS determined by CV ($EMS_{CV}$).}
\end{sidewaystable}\clearpage
\end{document}
This is how it looks now:
Best Answer
Here is a rather different way of presenting the information which may or may not be suitable. Unlike the modified table, this fits within the confines of the text area. (The other produces overfull boxes.)
This is essentially a
forest
tree, asjusttrees
is an experimental wrapper forforest
. This may make it unacceptable for submission purposes, but you can include the code, if necessary, and loadforest
directly instead. There is a copy ofjusttrees.sty
around somewhere but ask me for version 0.04 if you actually want to try this out.