我正在尝试制作一张有两个面板的表格。我需要类似这样的东西:
但我有这个:
我对标题中的数字及其位置有疑问,我还想删除那些 [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}