Erstellen einer Statistiktabelle mit /multicolumn und /cline

Erstellen einer Statistiktabelle mit /multicolumn und /cline

Bildbeschreibung hier eingeben

Ich versuche, eine Tabelle wie die oben zu erstellen, aber mit 5 Variablen unter „Frauen“ und „Männer“ statt 2. Auch unter „Behandlung“ habe ich mehr als diese 3, aber das ist nicht so wichtig. Meine Codes haben immer wieder Probleme bei \cline. Bedeutet das nicht, dass die horizontalen Linien die Spalten 2 bis 6 und 8 bis 12 umfassen, da 7 eine leere Spalte ist?

\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}

Antwort1

Sie scheinen eine Dummy-Spalte zu verwenden, um die beiden Teile zu trennen: Sie müssen sie im Argument angeben \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}

Bildbeschreibung hier eingeben

Es gibt jedoch bessere Methoden.

\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}

Bildbeschreibung hier eingeben

verwandte Informationen