Amélioration de la conception de table reconstruite

Sep 29 2020

Je souhaite reconstruire le tableau suivant:

et est venu avec le code suivant:

\begin{table}
\centering
  \begin{threeparttable}
       \caption{ \\ \textit{Quantile Effects When Education is Treated as Exogenous} \\
    \scriptsize (Sample size : 7,165) By gender (3,735 males and 3,430 females)}
     \begin{tabular}{llllll}
        \toprule
         & \( \tau=0.10 \) & \( \tau= 0.30 \) & \( \tau= 0.50 \) & \( \tau= 0.70 \) & \( \tau= 0.90 \) \\
        \midrule     \\
        \textit{Males}    & $\underset{( 0.2359)}{-0.0852}$        & $\underset{(0.1127)}{0.0657}$    & $\underset{(0.1045)}{-0.1358}$       & $\underset{(0.1231)}{-0.0983}$ & $\underset{(0.1989)}{-0.2911}$    \\
        \textit{Females}& $\underset{( 0.2090}{0.3149}$        & $\underset{(0.1034)}{0.0815}$    & $\underset{(0.097)}{-0.1358}$       & $\underset{(0.1035)}{0.1224}$ & $\underset{(0.2221)}{ 0.0947}$ \\
        \bottomrule
     \end{tabular}
    \begin{tablenotes}
      \small
      \item \textit{Note.} Each regression included a constant, country dummies,  \textit{q}, \textit{$q^2$} and their interactions with country dummies, age, age squared, and the GDP per head at the age when the pupil would have finished compulsory schooling. $\tau$  denotes the quantile of the distribution of wages. Three start, two stas and one star for statistically significant coefficients at the 1\%, 5\% and 10\% confidence level. Bootstrapped standard errors are shown in parentheses. 
    \end{tablenotes}
  \end{threeparttable}
\end{table}

Ce qui ressemble à ceci:

Questions d'amélioration spécifiques:

Comment puis-je centrer le «Tableau 5» et ma légende dans mon résultat?

Existe-t-il un moyen de définir la taille de la police d'une table à trois parties?

Réponses

3 Bernard Sep 29 2020 at 16:22

Voici une solution pour la légende, avec le package homonyme. J'ai également amélioré un peu la note du tableau. Pour la taille de la police, cela dépend de la partie que vous souhaitez modifier.

\documentclass{article}
\usepackage{amsmath} 
\usepackage{threeparttable}
\usepackage{booktabs, array, caption}

\begin{document}

\begin{table}
\centering\captionsetup{labelsep=newline, justification=centering}
  \begin{threeparttable}
       \caption{\textit{Quantile Effects When Education is Treated as Exogenous} \\
    \scriptsize (Sample size : 7,165) By gender (3,735 males and 3,430 females)}
     \begin{tabular}{*{6}{l}}
        \toprule
         & \( \tau=0.10 \) & \( \tau= 0.30 \) & \( \tau= 0.50 \) & \( \tau= 0.70 \) & \( \tau= 0.90 \) \\
        \midrule
        \addlinespace
        \textit{Males} & $\underset{( 0.2359)}{-0.0852}$ & $\underset{(0.1127)}{0.0657}$ & $\underset{(0.1045)}{-0.1358}$ & $\underset{(0.1231)}{-0.0983}$ & $\underset{(0.1989)}{-0.2911}$ \\
        \textit{Females}& $\phantom{-}\underset{( 0.2090)}{0.3149}$ & $\underset{(0.1034)}{0.0815}$ & $\underset{(0.097)}{-0.1358}$ & $\phantom{-}\underset{(0.1035)}{0.1224}$ & $\phantom{-}\underset{(0.2221)}{ 0.0947}$ \\
        \bottomrule
     \end{tabular}
    \begin{tablenotes}[flushleft]
      \small
      \item \textit{Note.} Each regression included a constant, country dummies, \textit{q}, \textit{$q^2$} and their interactions with country dummies, age, age squared, and the GDP per head at the age when the pupil would have finished compulsory schooling. $\tau$ denotes the quantile of the distribution of wages. Three start, two stas and one star for statistically significant coefficients at the 1\%, 5\% and 10\% confidence level. Bootstrapped standard errors are shown in parentheses.
    \end{tablenotes}
  \end{threeparttable}
\end{table}

\end{document}

3 Mico Sep 29 2020 at 17:14

Voici une autre solution possible. Observez qu'il aligne les marqueurs décimaux dans chaque colonne. Puisque vous semblez vouloir utiliser un threepartableenvironnement, je suggère également d'utiliser des \tnotedirectives. Je ne pense pas que les informations sur la taille de l'échantillon méritent d'être si proches de la légende.

\documentclass{article} 
\usepackage{booktabs}

\usepackage{siunitx}
\sisetup{input-symbols= (),
         group-digits=false,
         table-space-text-post = )}
         
\usepackage[flushleft]{threeparttable}
\renewcommand\TPTtagStyle{\textit}

\usepackage{caption}
\captionsetup{labelsep=newline,
              textfont=it,
              skip=0.333\baselineskip}

\begin{document}
\begin{table}
\centering
\begin{threeparttable}
\caption{Quantile effects when education is treated as exogenous\tnote{a,b}}

\begin{tabular}{@{} l *{5}{S[table-format=-1.4]} @{}}
\toprule
& \multicolumn{5}{c@{}}{$\tau$}\\
\cmidrule(l){2-6}
& 0.10 & 0.30 & 0.50 & 0.70 & 0.90 \\
\midrule    
Males    & -0.0852 & 0.0657 & -0.1358 & -0.0983 & -0.2911 \\
  & (0.2359) & (0.1127) & (0.1045) & (0.1231) & (0.1989) \\
\addlinespace
Females  &  0.3149 & 0.0815 & -0.1358 & 0.1224 & 0.0947 \\
  & (0.2090) & (0.1034) & (0.097)  & (0.1035) & (0.2221) \\
\bottomrule
\end{tabular}
     
\smallskip\small
\begin{tablenotes}
\item[a]Sample size: 7,165. By gender: 3,735 males and 3,430 females.
\item[b]Each regression included a constant, country dummies,  \textit{q}, \textit{$q^2$} and their interactions with country dummies, age, age squared, and the GDP per head at the age when the pupil would have finished compulsory schooling. $\tau$  denotes the quantile of the distribution of wages. Three stars, two stars and one star denote statistically significant coefficients at the 1\%, 5\% and 10\% confidence levels. Bootstrapped standard errors are shown in parentheses. 
\end{tablenotes}
\end{threeparttable}
\end{table}

\end {document}