\documentclass{article}
\usepackage{threeparttable}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{xcolor}
\begin{document}
\begin{table}[!ht]
\setlength\tabcolsep{0pt}
\centering
\begin{threeparttable}
\begin{tabular}{@{\extracolsep{2ex}}*{14}{lccccccccccccc}}
\toprule
 &  & \multicolumn{12}{c}{\textbf{group1}} \\
\cmidrule{3-14}
 &  & \multicolumn{6}{c}{\begin{tabular}{@{}c@{}}a \\ (n=4)\end{tabular}} & \multicolumn{6}{c}{\begin{tabular}{@{}c@{}}b \\ (n=4)\end{tabular}} \\
 &  & \multicolumn{6}{c}{\textbf{group2}} & \multicolumn{6}{c}{\textbf{group2}} \\
\cmidrule{3-8}\cmidrule{9-14}
 &  & \multicolumn{3}{c}{\begin{tabular}{@{}c@{}}e \\ (n=2)\end{tabular}} & \multicolumn{3}{c}{\begin{tabular}{@{}c@{}}f \\ (n=2)\end{tabular}} & \multicolumn{3}{c}{\begin{tabular}{@{}c@{}}e \\ (n=2)\end{tabular}} & \multicolumn{3}{c}{\begin{tabular}{@{}c@{}}f \\ (n=2)\end{tabular}} \\
 &  & \multicolumn{3}{c}{\textbf{group3}} & \multicolumn{3}{c}{\textbf{group3}} & \multicolumn{3}{c}{\textbf{group3}} & \multicolumn{3}{c}{\textbf{group3}} \\
\cmidrule{3-5}\cmidrule{6-8}\cmidrule{9-11}\cmidrule{12-14}
 & \textbf{\begin{tabular}{@{}c@{}}Total \\ (n=8)\end{tabular}} & \begin{tabular}{@{}c@{}}c \\ (n=1)\end{tabular} & \begin{tabular}{@{}c@{}}d \\ (n=1)\end{tabular} & \begin{tabular}{@{}c@{}}Total \\ (n=2)\end{tabular} & \begin{tabular}{@{}c@{}}c \\ (n=1)\end{tabular} & \begin{tabular}{@{}c@{}}d \\ (n=1)\end{tabular} & \begin{tabular}{@{}c@{}}Total \\ (n=2)\end{tabular} & \begin{tabular}{@{}c@{}}c \\ (n=1)\end{tabular} & \begin{tabular}{@{}c@{}}d \\ (n=1)\end{tabular} & \begin{tabular}{@{}c@{}}Total \\ (n=2)\end{tabular} & \begin{tabular}{@{}c@{}}c \\ (n=1)\end{tabular} & \begin{tabular}{@{}c@{}}d \\ (n=1)\end{tabular} & \begin{tabular}{@{}c@{}}Total \\ (n=2)\end{tabular} \\
\midrule
\textbf{value1} &  &  &  &  &  &  &  &  &  &  &  &  &  \\
\hspace{12.0pt}Mean (SD) & 4.5 (2.45) & 1 (NaN) & 3 (NaN) & 2 (1.41) & 2 (NaN) & 4 (NaN) & 3 (1.41) & 5 (NaN) & 7 (NaN) & 6 (1.41) & 6 (NaN) & 8 (NaN) & 7 (1.41) \\
\hspace{12.0pt}Median [Min, Max] & 4.5 [1, 8] & 1 [1, 1] & 3 [3, 3] & 2 [1, 3] & 2 [2, 2] & 4 [4, 4] & 3 [2, 4] & 5 [5, 5] & 7 [7, 7] & 6 [5, 7] & 6 [6, 6] & 8 [8, 8] & 7 [6, 8] \\
\textbf{value2} &  &  &  &  &  &  &  &  &  &  &  &  &  \\
\hspace{12.0pt}a & 3 (37.5\%) & 1 (100\%) & 0 (0\%) & 1 (50\%) & 0 (0\%) & 1 (100\%) & 1 (50\%) & 0 (0\%) & 1 (100\%) & 1 (50\%) & 0 (0\%) & 0 (0\%) & 0 (0\%) \\
\hspace{12.0pt}b & 3 (37.5\%) & 0 (0\%) & 0 (0\%) & 0 (0\%) & 1 (100\%) & 0 (0\%) & 1 (50\%) & 1 (100\%) & 0 (0\%) & 1 (50\%) & 0 (0\%) & 1 (100\%) & 1 (50\%) \\
\hspace{12.0pt}c & 2 (25\%) & 0 (0\%) & 1 (100\%) & 1 (50\%) & 0 (0\%) & 0 (0\%) & 0 (0\%) & 0 (0\%) & 0 (0\%) & 0 (0\%) & 1 (100\%) & 0 (0\%) & 1 (50\%) \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\end{document}