4

I am trying to format the p-values description in the notes of a table. The whole table layout is done with Stata (using command esttab) but changing the p-values format seems to be impossible. Therefore, I would like to do that after having imported the table into Lyx. That's how it should look:

Observations     1333    1111  
_______________________________________

Notes: Bla bla bla bla..
    ***Significant at the
     **Significant at the
      *Significant at the 

The B and the S should be aligned. (It is required by the American Economic Review)

Does anyone know which package(s) I could use to achieve that? I do not need the code for it, I am eager to try first by myself!

I tried with dcolumn package (close previous tabular space, opened a new one with \begin{tabular} {l r} but it does not look as I should.

lockstep
  • 250,273
luciano
  • 83
  • Well, the B of bla should be aligned with the S of significant, which is supposed to be in the row below and so on... – luciano Mar 20 '12 at 16:10
  • 1
    Since you say you are eager to try by yourself... I would try either a nested tabular, or else a description environment with \item[Notes] – cmhughes Mar 20 '12 at 16:20

3 Answers3

7

Not that I know much (if anything) about p-values, but maybe this can be a start. I'd probably choose 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}

enter image description here

cgnieder
  • 66,645
  • Nice! It's kind of obvious, but this won't work with the flushleft option of threeparttable (took me 10 minutes to figure out...) – PatrickT Apr 08 '18 at 21:30
1

This seems like the best way to do that . The 19pt distance creates an empty space of the lenght "Notes:_", moreover i took away the \, empty space

\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}
luciano
  • 83
0
\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}

Delete \hline from the table for a better view. It still looks a bit odd, but anyway

David Carlisle
  • 757,742