# Complex results table [duplicate]

I would like to generate an output similar to the one that can be found in the foto, any ideas?

• Take a look at the booktabs (for horizontal lines with nice spacing) and the siunitx (for improved alignment of numbers in tables) packages. – leandriis Mar 1 '20 at 20:50
• Hi Gerasimos and welcome to TeX.SX. In its current form, your question might not receive many answers. Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. This may require you to show some effort on your part in terms of attempting a solution. If you have questions about what to do or if you don't quite understand what this means, please ask for clarification using the add comment function. – Alessandro Cuttin Mar 1 '20 at 21:35

The following code hopefully suffices to get you started.

FWIW, I don't think the table layout in the screenshot you posted is all that great. There are two main problems. First, the material in the first column is not organized clearly. Second, numbers are not aligned on their decimal markers, making it unnecessarily difficult to actually read them.

In the following screenshot and code, I tried to improve the overall layout. (I didn't do anything about aligning the numbers in the data columns on their respective decimal markers, mainly as I have no idea if you care about that in the table you need to create.) Regarding the layout, note that I moved the header word "Distibution" to the right and placed it centered above the 8 data columns. In addition, I shoved to the explanations of the variables n and k to the right; hopefully, they no longer compete with and interfere with the variable names UCL, LCL, etc.

\documentclass{article}
\usepackage[letterpaper,margin=1in]{geometry} % set page parameters suitably
\usepackage{booktabs}
\newcommand\mr[1]{\multicolumn{2}{r}{#1}} % handy shortcut macro
\begin{document}
\begin{table}
\setlength\tabcolsep{0pt}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} ll *{8}{c} }
\toprule
&& \multicolumn{8}{c}{Distribution} \\
\cmidrule{3-10}
&& \multicolumn{4}{c}{EXP(1)}
& \multicolumn{4}{c}{N(0,1)} \\
\cmidrule{3-6} \cmidrule{7-10}
\mr{Subgroup Size $n$} & 5 & 5 & 10 & 10 & 5 & 5 & 10 & 10 \\
\mr{\# Subgroups  $k$} & 5 & 20 & 5 & 20 & 5 & 20 & 5 & 20 \\
\midrule
UCL\textsubscript{avg}
& standard
&  2.1120  &  2.1416  &  1.79983 &  1.8104
&  1.1401  &  1.1464  &  0.8178  &  0.8124  \\
&& (0.0015) & (0.0011) & (0.0006) & (0.0006)
& (0.0038) & (0.0019) & (0.0024) & (0.0011)\\
& bootstrap\kern20pt % force some extra spacing
&  2.2676  & \dots \\
&& (0.0018) & \dots \\
& desired
&  2.5188  & \dots \\
\midrule
LCL\textsubscript{avg}
& standard
& $-0.1112$ & \dots \\
\dots \\
\dots \\
\midrule
SRL\textsubscript{avg}
& standard
& 63954.54 & 111.98 & \\
& bootstrap
& 274510.88 & 1905.13 & & & & & 123.40 & 48.10 \\
\bottomrule
\end{tabular*}

\medskip
Note: The values in parentheses are standard errors.
\end{table}
\end{document}

• I know that I am not supposed to add comments in order to say "thanks", but you are a hero! – Gerasimos Chasapis Mar 2 '20 at 20:33