我正在尝试构建一个包含数字和 ** 的表格,以便传递到某个重要性级别。出于某种原因,其中一列会在数字和 ** 之间添加额外的空格,我不明白为什么,有什么想法吗?顺便说一句,我使用 siunitx 按小数点居中。
\begin{center}
\begin{table}[h]
\begin{threeparttable}
\begin{tabular}{c c S S c}
\hline
\textbf{Index} & \textbf{Data} & \textbf{ADF} & \textbf{KPSS} & \multicolumn{1}{c}{\textbf{Results}} \\
\hline
\multirow{2}{*}{\textbf{S\&P500}} & Prices & -0,52 & 6,59** & Non-stationary \\
& Returns & -65,90** & 0,10 & Stationary \\
\hline
\multirow{2}{*}{\textbf{DAX}} & Prices & -2,35 & 5,37** & Non-stationary \\
& Returns & -62,77** & 0,05 & Stationary \\
\hline
\multirow{2}{*}{\textbf{FTSE}} & Prices & -2,72 & 4,04** & Non-stationary \\
& Returns & -39,09** & 0,05 & Stationary \\
\hline
\multirow{2}{*}{\textbf{HSI}} & Prices & -3,88 & 0,98** & Non-stationary \\
& Returns & -43,23** & 0,05 & Stationary \\
\hline
\end{tabular}
%\begin{tablenotes}
%\item \noindent Notes:
%\item - The 5\% and 1\% critical value for the ADF test are $-3.41$ and $-3.96$, respectively.
%\item - The 5\% and 1\% critical value for the KPSS test are 0.15 and 0.22, respectively.
%\item - * and ** denote the rejection of the null hypothesis at 5\% and 1\% significance levels, %respectively.
%\end{tablenotes}
\end{threeparttable}
\caption{\label{tab:3}Output of the ADF and KPSS tests, for the returns and prices of the four indices in study}
\end{table}
\end{center}
答案1
您需要指定一个“模型”,它定义了为列类型中的数字保留的空间S[table-format=...]
。此列类型不仅可以在默认的中使用tabular
,还可以在许多派生的表格环境中使用,包括threeparttable
OP示例中的。
以下示例c c S[table-format=-2.2{**}] S[table-format=2.2{**}] c
使用了表格序言。根据所使用的文档类别和样式设置,输出可能会有所不同,但表格序言是可重复使用的。
\documentclass{article}
\usepackage{multirow}
\usepackage{siunitx}
\usepackage{threeparttable}
\begin{document}
\begin{table}[h]
\centering
\begin{threeparttable}
\begin{tabular}{c c S[table-format=-2.2{**}] S[table-format=2.2{**}] c}
\hline
\textbf{Index} & \textbf{Data} & \textbf{ADF} & \textbf{KPSS} & \multicolumn{1}{c}{\textbf{Results}} \\
\hline
\multirow{2}{*}{\textbf{S\&P500}} & Prices & -0,52 & 6,59** & Non-stationary \\
& Returns & -65,90** & 0,10 & Stationary \\
\hline
\multirow{2}{*}{\textbf{DAX}} & Prices & -2,35 & 5,37** & Non-stationary \\
& Returns & -62,77** & 0,05 & Stationary \\
\hline
\multirow{2}{*}{\textbf{FTSE}} & Prices & -2,72 & 4,04** & Non-stationary \\
& Returns & -39,09** & 0,05 & Stationary \\
\hline
\multirow{2}{*}{\textbf{HSI}} & Prices & -3,88 & 0,98** & Non-stationary \\
& Returns & -43,23** & 0,05 & Stationary \\
\hline
\end{tabular}
%\begin{tablenotes}
%\item \noindent Notes:
%\item - The 5\% and 1\% critical value for the ADF test are $-3.41$ and $-3.96$, respectively.
%\item - The 5\% and 1\% critical value for the KPSS test are 0.15 and 0.22, respectively.
%\item - * and ** denote the rejection of the null hypothesis at 5\% and 1\% significance levels, %respectively.
%\end{tablenotes}
\end{threeparttable}
\caption{\label{tab:3}Output of the ADF and KPSS tests, for the returns and prices of the four indices in study}
\end{table}
\end{document}