多面板表格标题

多面板表格标题

我正在尝试制作一张有两个面板的表格。我需要类似这样的东西:

在此处输入图片描述

但我有这个:

在此处输入图片描述

我对标题中的数字及其位置有疑问,我还想删除那些 [t]。这是我的代码:

\\\begin{table}[!hbt]
  \centering
      \caption{Panel A: Descriptive statistics}
  \begin{subtable}[t]{\linewidth}
    \centering
    \vspace{0pt}
    \begin{tabular}{@{\extracolsep{5pt}} l|ccc}
      \toprule
     Observations & 594\\
     Mean & 0.00313\\
     Median & 0.00453\\
     Maximum & 0.22762\\
     Minimun & -0.18917\\
     Std. Dev. & 0.04886\\
     Skewness & -0.10910 \\
     Kurtosis & 2.22092\\
      \bottomrule

    \end{tabular}
        \caption{Panel A: Unit root tests}
  \end{subtable}
  \begin{subtable}[t]{\linewidth}
    \centering
    \begin{tabular}{@{\extracolsep{5pt}} l|ccc}
      \toprule
      ADF & -7.7912*** \\
      PP & -604.93***  \\
      \bottomrule
    \end{tabular}

    \caption{Descriptive statistics and unit root tests}  
  \end{subtable}
\end{table}

感谢您的帮助!

答案1

subcaption您可以通过如下方式使用该包来实现所需的输出:

\documentclass{article}
\usepackage{booktabs}
\usepackage{subcaption}
\captionsetup[subtable]{labelformat=simple, labelsep=colon}
\renewcommand{\thesubtable}{Panel~\Alph{subtable}}
\begin{document}

\begin{table}[!hbt]
  \centering
  \begin{subtable}{\linewidth}
    \centering
    \caption{Unit root tests}
    \begin{tabular}{@{\extracolsep{5pt}} lc}
      \toprule
     Observations & 594\\
     Mean & 0.00313\\
     Median & 0.00453\\
     Maximum & 0.22762\\
     Minimun & -0.18917\\
     Std. Dev. & 0.04886\\
     Skewness & -0.10910 \\
     Kurtosis & 2.22092\\
      \bottomrule
    \end{tabular}
  \end{subtable}
 \vspace{0.75\baselineskip}

  \begin{subtable}{\linewidth}
  \caption{Unit root tests}
    \centering
    \begin{tabular}{@{\extracolsep{5pt}} lc}
      \toprule
      ADF & -7.7912*** \\
      PP & -604.93***  \\
      \bottomrule
    \end{tabular}
  \end{subtable}
  \caption{Descriptive statistics and unit root tests}
\end{table}

\end{document}

在此处输入图片描述

此外,我还删除了多余的列(表格最初有四列,但只需要两列)以及垂直线(与booktabs水平线不兼容)。


为了进一步改进,您可能有兴趣使用siunitx包的S类型列来根据小数分隔符对齐数字:

\documentclass{article}
\usepackage{booktabs}
\usepackage{subcaption}
\captionsetup[subtable]{labelformat=simple, labelsep=colon}
\renewcommand{\thesubtable}{Panel~\Alph{subtable}}
\usepackage{siunitx}
\begin{document}

\begin{table}[!hbt]
  \centering
    \caption{Descriptive statistics and unit root tests}
  \begin{subtable}{\linewidth}
    \centering
    \caption{Unit root tests}
    \begin{tabular}{@{\extracolsep{5pt}} lS[table-format=3.5]}
      \toprule
     Observations & 594\\
     Mean & 0.00313\\
     Median & 0.00453\\
     Maximum & 0.22762\\
     Minimun & -0.18917\\
     Std. Dev. & 0.04886\\
     Skewness & -0.10910 \\
     Kurtosis & 2.22092\\
      \bottomrule
    \end{tabular}
  \end{subtable}
 \vspace{0.75\baselineskip}

  \begin{subtable}{\linewidth}
  \sisetup{
  table-format          = -3.4,
  table-space-text-post = ***,
  table-align-text-post = false
}
  \caption{Unit root tests}
    \centering
    \begin{tabular}{@{\extracolsep{5pt}} lS}
      \toprule
      ADF & -7.7912*** \\
      PP & -604.93***  \\
      \bottomrule
    \end{tabular}
  \end{subtable}
\end{table}

\end{document}

在此处输入图片描述

相关内容