1

How to draw the following table in Latex?

enter image description here

I have tried:

\begin{table}[h!]
\centering
\begin{tabular}{|c|c c |c c|} 
 \hline
 &  c &c & a & a \\ [0.5ex] 
 \hline
 Performance measure & $\hat{\mu}$ & $\hat{\si}$ & $\hat{\mu}$ & $\hat{\si}$ \\
 \hline\hline
 MSE & 0.0589 & 0.0302 & 0.0611 &0.0456 \\ 
 Bias & 0.0243 & -0.0415  &0.0332 & -0.0496 \\
 SD & 0.242 & 0.169 & 0.245 & 0.208 \\[1ex] 
 \hline
\end{tabular}
\caption{Sample size is $n=20$.}
\label{table:1}
\end{table}
moewe
  • 175,683
Hermi
  • 231
  • 1
  • 6

2 Answers2

1

Is something like this you want?

\documentclass[12pt]{article}
\usepackage[a4paper, total={180mm,257mm},left=15mm,top=20mm]{geometry}
\usepackage{stix}%<-- for using the Ldsh arrow
\usepackage{tabularray}

\begin{document} \begin{tblr}{colspec={Q[3cm,l]Q[1.5cm,l]Q[1.5cm,l]Q[1.5cm,l]Q[1.5cm,l]},cell{1}{2,4}={r=1,c=2}{l},rows={1cm,m},hlines,vlines,hline{2}={leftpos=-1, rightpos=-1},hline{2}={1}{leftpos=0, rightpos=0},cell{1}{1}={r=2,c=1}{l,h},vline{3,5}={2-5}{abovepos=-3, belowpos=-3}} \raisebox{-7pt}{C} & C & C & C & C \ C & a & b & a & $b^{\Ldsh}$ \ A & &$\Ldsh$ & &$\Ldsh$ \ B & &$\Ldsh$ & &$\Ldsh$ \ C & &$\Ldsh$ & &$\Ldsh$ \ \end{tblr} \end{document}

miltos
  • 2,605
1

mwe

\documentclass {article}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{tabulary}
\usepackage{siunitx}

\begin{document} \centering \section*{Poor man's version:}

\begin{tabular}{|c|c c |c c|}\hline \multirow{2}{*}{\parbox{6em}{\centering Performance measure}} & \multicolumn{2}{c|}{c} & \multicolumn{2}{c|}{a} \\cline{2-5} & $\hat{\mu}$ & $\hat{\sigma}$ & $\hat{\mu}$ & $\hat{\sigma}$ \\hline MSE & 0.0589 & 0.0302 & 0.0611 &0.0456 \ Bias & 0.0243 & -0.0415 &0.0332 & -0.0496 \ SD & 0.242 & 0.169 & 0.245 & 0.208 \\hline \end{tabular}

\section*{Glamorous version:}

\begin{tabulary}{\linewidth}{LS[table-format=1.4]SSS}\toprule \multirow{2}{*}{\parbox{5em}{ Performance measure}} & \multicolumn{2}{c}{c} & \multicolumn{2}{c}{a} \ \cmidrule(rl){2-3} \cmidrule(rl){4-5} & {$\hat{\mu}$} & $\hat{\sigma}$ & $\hat{\mu}$ & $\hat{\sigma}$ \\midrule MSE & 0.0589 & 0.0302 & 0.0611 &0.0456 \ Bias & 0.0243 & -0.0415 &0.0332 & -0.0496 \ SD & 0.242 & 0.169 & 0.245 & 0.208 \\bottomrule \end{tabulary} \end{document}

Fran
  • 80,769
  • Note: the different alignment of µ in the second table is a mistake as [table-format=1.4] and enclose the header in {} is used only in the second column, but it worth to show better the effect. – Fran Nov 17 '22 at 08:50