我正在尝试格式化表格注释中的 p 值描述。整个表格布局都是用 Stata 完成的(使用命令 esttab),但更改 p 值格式似乎是不可能的。因此,我想在将表格导入 Lyx 后再执行此操作。它应该是这样的:
Observations 1333 1111
_______________________________________
Notes: Bla bla bla bla..
***Significant at the
**Significant at the
*Significant at the
B和S要对齐。(美国经济评论要求)
有人知道我可以使用哪个包来实现这个吗?我不需要代码,我渴望先自己尝试一下!
我尝试使用 dcolumn 包(关闭以前的表格空间,打开了一个新的,\begin{tabular} {l r}
但它看起来不像我应该的那样。
答案1
我对 p 值了解不多(如果有的话),但也许这可以作为一个开始。我可能会选择threeparttable
:
\documentclass{article}
\usepackage{booktabs,threeparttable}
\begin{document}
\begin{table}
\centering
\renewcommand*\TPTnoteLabel[1]{\parbox[b]{3em}{\hfill#1\,}}
\begin{threeparttable}
\caption{My caption}
\begin{tabular}{lcc}\toprule
& {Head 1} & {Head 2} \\\midrule
Observation 1 & 1.23\tnote{*} & 1.23 \\
& (0.12) & (0.12) \\
Observation 2 & 1.23 & 1.23\tnote{**} \\
& (0.12) & (0.12) \\
Observation 3 & 1.23\tnote{***} & 1.23 \\
& (0.12) & (0.12) \\
\bottomrule
\end{tabular}
\footnotesize
\begin{tablenotes}
\item[Notes:] Bla bla bla bla..
\item[\tnote{***}] Significant at the
\item[\tnote{**}] Significant at the
\item[\tnote{*}] Significant at the
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
答案2
这似乎是最好的方法。19pt 的距离会创建一个长度为“Notes:_”的空白,此外,我还去掉了 \, 空白
\begin{table}
\begin{threeparttable}
\renewcommand*\TPTnoteLabel[1]{\parbox[b]{19pt}{\hfill#1}}
\caption*{Table3: Ordered logit results for men and women living in Denmark}
\begin{tabular}{l*{6}{D{.}{.}{4,6}}}
\end{tabular}
\emph{Notes:} Standard errors in parentheses.
\begin{tablenotes}
\item[***]Significant at the 1 percent level.
\item[**]Significant at the 5 percent level.
\item[*]Significant at the 10 percent level.
\end{tablenotes}
\begin{tabular}{l}
\addlinespace
\emph{Source:} European Social Survey.
\end{tabular}
\end{threeparttable}
\end{table}
答案3
\begin{table}
\centering
\begin{small}
\begin{tabular}{l c c}
\hline
\textit{ } & Label 1 & Label 3\\
Intercept &-2.5400*** &-0.8661*** \\
&(0.6305)&(0.2791)\\
\hline
Gender& -1.1026** & 0.6985* \\
&(0.4108)&(0.3350)\\
\hline
Friendlist visibility& 0.4705* & 0.5214 \\
&(0.2075)&(0.1706)\\
\hline
Wall& 0.4173\LARGE{.} & -0.1595 \\
&(0.2463)&(0.2262)\\
\hline
Photo&1.9425** & 0.1361\\
&(0.6093)&(0.2339)\\
\hline
Locale & 0.1446 & 0.5846*\\
&(0.2881)&(0.2277)\\
N&278&588\\
\hline
\end{tabular}
\end{small}
\caption{\small{Regression results for all data points. p-value = 5.6701e-11. Total N=1520.
Notes: Reference category for the equation is label 2 (Risky).
Standard errors in parentheses. Significance codes: '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
}}
\label{table:firstregresults}
\end{table}
从表格中删除\hline
以获得更好的视图。它看起来仍然有点奇怪,但无论如何