I have added a macro to help with consistent formating of headers, as well as to reduce the amount of redundant code needed. The macro is called \hf{columns}{content}
and takes one argument, the number of columns, just like the multicolumn
-environment. It typesets its content in italics, and you can just change one line if you decide that you want to change the format to for example, normal text.
I would advice to split the table, into two tables, as this one gets quite wide. Because it is so wide, I had to set the fontsize to \tiny
, which is not the best approach. You could also turn the table around, so that you a long table, instead of a wide one.
In the second piece of code, located at the bottom, I have split the table, by creating a macro which holds all the headers, so they have the same consistent look. I think this would look better than a really wide table.
First output, wide table, smaller font

First code, wide table, smaller font
\documentclass{article}
\usepackage{booktabs}
\usepackage{array}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\newcommand{\hf}[2]{%HeaderFormat
\multicolumn{#1}{c}{#2}%
}
\begin{document}
% \SweaveOpts{concordance=TRUE}
\begin{table*}
\centering
\tiny
\ra{1.3}
\setlength{\tabcolsep}{2pt}
\begin{tabular}{%
@{}>{\itshape}l% Remove space from edge, Set first colun in italice
*{4}{% 4 columns of the following
r@{\,}% right column for the mean value, and set the space between the two numbers to be exactly `\,`-space
>{(}r<{)}% right column for the standard deviation, add paratheses before and after
}%
@{}l@{\hspace{2em}}% Need to control the space before and after the column with @{}, so that no `\tabcolsep` is inserted, and then we add the exact space we need.
*{4}{r@{\,}>{(}r<{)}}% Same as above
}
\toprule
& \hf{8}{Early} &&\hf{8}{Late}\\
\cmidrule{2-9} \cmidrule{11-18}
& \hf{4}{stimuli1} & \hf{4}{stimuli2} && \hf{4}{stimuli1} & \hf{4}{stimuli2}\\
\midrule
&\hf{2}{CS+} & \hf{2}{CS-} & \hf{2}{CS+} & \hf{2}{CS+} && \hf{2}{CS+} & \hf{2}{CS-} & \hf{2}{CS+} & \hf{2}{CS-}\\
\midrule
Object1 &0.07&0.15 & 0.16&0.16 & 0.07&0.15 & 0.29&0.45 && 0.36&0.70 & 0.71&0.87 & 3.18&0.15 & 0.07&0.90 \\
Object2 &0.07&0.15 & 0.16&0.16 & 0.07&0.15 & 0.29&0.45 && 0.36&0.70 & 0.71&0.87 & 3.18&0.15 & 0.07&0.90 \\
\bottomrule
\end{tabular}
\caption{caption}
\end{table*}
\end{document}
Second output, split table

Second Code, split table
\documentclass{article}
\usepackage{booktabs}
\usepackage{array}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\newcommand{\hf}[2]{%HeaderFormat
\multicolumn{#1}{c}{\itshape#2}%
}
\newcommand{\tableStimuli}[1]{%
\begin{tabular}{%
@{}>{\itshape}l% Remove space from edge, Set first colun in italice
*{4}{% 4 columns of the following
r@{\,}% right column for the mean value, and set the space between the two numbers to be exactly `\,`-space
>{(}r<{)}% right column for the standard deviation, add paratheses before and after
}
}
\toprule
& \hf{4}{stimuli1} & \hf{4}{stimuli2}\\
\cmidrule{2-9}% \cmidrule{6-8}
&\hf{2}{CS+} & \hf{2}{CS-} & \hf{2}{CS+} & \hf{2}{CS+}\\
\midrule
#1\\
\bottomrule
\end{tabular}
}
\begin{document}
\begin{table*}
\centering
\ra{1.3}
\tableStimuli{%
Object1 &0.07&0.15 & 0.16&0.16 & 0.07&0.15 & 0.29&0.45\\
Object2 &0.07&0.15 & 0.16&0.16 & 0.07&0.15 & 0.29&0.45}
\caption{Early}
\end{table*}
\begin{table*}[hbt]
\centering
\ra{1.3}
\tableStimuli{%
Object1 &0.36&0.70 & 0.71&0.87 & 3.18&0.15 & 0.07&0.90\\
Object2 &0.36&0.70 & 0.71&0.87 & 3.18&0.15 & 0.07&0.90}
\caption{Late}
\end{table*}
\end{document}