I am trying to present tabular groups of means and standard deviations in the format M (SD)
. In the MWE how can I "tighten up" the horizontal alignment of each "M (SD)" group?
I would like them to be closer together (so the reader can see that they are grouped), but also maintain a consistent spacing (which the table seems to currently have acceptably).
\documentclass[]{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\sisetup{input-symbols = ()}
\begin{table}[h]
\begin{tabular}{@{}
l
S[table-format = 2.1]
S[table-format = 2.1]
S[table-format = 2.1]
S[table-format = 2.1]
S[table-format = 3.1]
S[table-format = 2.1]
S[table-format = 2.1]
S[table-format = 2.1]
@{}}
\toprule
& \multicolumn{4}{c}{Major Group A} & \multicolumn{4}{c}{Major Group B} \\
\cmidrule(lr){2-5} \cmidrule(l){6-9}
& \multicolumn{2}{c}{Subgroup A1} & \multicolumn{2}{c}{Subgroup A2} & \multicolumn{2}{c}{Subgroup B1} & \multicolumn{2}{c}{Subgroup B2} \\
Test & {M} & {(SD)} & {M} & {(SD)} & {M} & {(SD)} & {M} & {(SD)} \\
\midrule
Y-scores & & & & & & & & \\
\hspace{1em} Y1 & 76.4 & (12.2) & 92.5 & (18.1) & 105.9 & (12.6) & 83.7 & (17.9) \\
\hspace{1em} Y2 & 38.2 & (9.6) & 47.3 & (18.1) & 51.2 & (7.3) & 38.8 & (9.9) \\
\hspace{1em} Y3 & 38.3 & (13.8) & 45.2 & (12.5) & 54.8 & (6.1) & 44.9 & (10.6) \\
\hspace{1em} Y3 & 0.3 & (0.1) & 0.6 & (0.5) & 0.9 & (0.5) & 0.5 & (0.1) \\
\bottomrule
\end{tabular}
\end{table}
\end{document}