[Tex/LaTex] Making stats table with /multicolumn and /cline

clinemulticolumn

enter image description here

I'm trying to make a table like the one above but with 5 variables under Females and Males instead of 2. Also under Treatment, I have more than those 3, but it's not that important. My codes keep running into problems at \cline. Doesn't that mean the horizontal lines span column 2 to 6 and 8 to 12 since 7 is a blank column?

\begin{table}[h]
\begin{tabular}{lcccccccccc}
\hline
\multicolumn{5}{c}{Females} & & \multicolumn{5}{c}{Males} \\
\cline{2-6} \cline{8-12} 
Treatment & V1 & V2 & V3 & V4  & V5 & & V1 & V2 & V3 & V4  & V5 \\
Placebo & 0.21 & 163 & 3 & 4 & 5 & & 0.22 & 164 & 3 & 4 & 5 \\
ACE Inhibitor & 0.13 & 142 & 3 & 4 & 5 & & 0.15 & 144 & 3 & 4 & 5 \\  
Hydralazine & 0.17 & 143 & 3 & 4 & 5 & & 0.16 & 140 & 3 & 4 & 5 \\
\begin{tabular}
\end{table}

Best Answer

You seem to be using a dummy column in order to separate the two parts: you need to specify it in the argument to \begin{tabular}.

\documentclass{article}

\begin{document}

\begin{tabular}{lccccc c ccccc}
\hline
 & \multicolumn{5}{c}{Females} && \multicolumn{5}{c}{Males} \\
\cline{2-6} \cline{8-12}
Treatment     & V1   & V2  & V3 & V4 & V5 && V1   & V2  & V3 & V4 & V5 \\
Placebo       & 0.21 & 163 & 3  & 4  & 5  && 0.22 & 164 & 3  & 4  & 5  \\
ACE Inhibitor & 0.13 & 142 & 3  & 4  & 5  && 0.15 & 144 & 3  & 4  & 5  \\
Hydralazine   & 0.17 & 143 & 3  & 4  & 5  && 0.16 & 140 & 3  & 4  & 5  \\
\end{tabular}

\end{document}

enter image description here

There are better methods, though.

\documentclass{article}

\usepackage{booktabs}

\begin{document}

\begin{tabular}{l ccccc ccccc}
\toprule
 & \multicolumn{5}{c}{Females} & \multicolumn{5}{c}{Males} \\
\cmidrule(lr){2-6} \cmidrule(lr){7-11}
Treatment     & V1   & V2  & V3 & V4 & V5 & V1   & V2  & V3 & V4 & V5 \\
\midrule
Placebo       & 0.21 & 163 & 3  & 4  & 5  & 0.22 & 164 & 3  & 4  & 5  \\
ACE Inhibitor & 0.13 & 142 & 3  & 4  & 5  & 0.15 & 144 & 3  & 4  & 5  \\
Hydralazine   & 0.17 & 143 & 3  & 4  & 5  & 0.16 & 140 & 3  & 4  & 5  \\
\bottomrule
\end{tabular}

\end{document}

enter image description here

Related Question