如何对齐下表中具有相同列数的面板(面板 A - C)的列,并改善面板 D 的间距

如何对齐下表中具有相同列数的面板(面板 A - C)的列,并改善面板 D 的间距
\documentclass[12pt]{article}

\usepackage{iaw}

\usepackage{rfs}

\usepackage{graphicx}
\graphicspath{ {./images/} }

\usepackage{tabularx}

\newcommand{\mcu}[3]{\mc{#1}{#2}{\underline{#3}}}

\begin{table}[htb] 
\caption{Summary statistics, employment and professional experience history}
\begin{tabularx}{\linewidth}{l*{9}{Y}}
\toprule
\multicolumn{8}{l}{\textbf{Panel A: Firm-level, Summary statistics, CEOs}} \\
\midrule
                &        Mean&          SD&         Min&         p25&         
p50&         p75&         Max&       N. Obs.\\
Return on Assets \hspace{1.75cm}     &        0.02&        0.01&       
-0.02&        0.02&        0.02&        0.03&        0.06&        4543\\
Firm Size (LN)      &        8.17&        1.71&        4.25&        
6.84&        7.87&        9.26&       11.98&        4798\\
\end{tabularx}
\begin{tabularx}{\linewidth}{l*{9}{Y}}
\toprule
\multicolumn{8}{l}{\textbf{Panel B: Summary statistics, CEOs}} \\
\midrule
                &        Mean&          SD&         Min&         p25&         
p50&         p75&         Max&       N. Obs.\\
CEO Age             &       57.39&        7.02&       33.00&       
53.00&       58.00&       62.00&       83.00&        4769\\
CEO Female          &        0.02&        0.16&        0.00&        
0.00&        0.00&        0.00&        1.00&        4820\\
CEO Tenure          &       12.28&        9.00&        1.00&        
5.00&       10.00&       17.00&       61.00&        4820\\
CEO Equity-based comp.&      0.46&        0.27&       -0.34&        
0.26&        0.48&        0.69&        1.00&        1359\\
CEO MBA degree      &        0.30&        0.46&        0.00&        
0.00&        0.00&        1.00&        1.00&        4820\\
\end{tabularx}
\begin{tabularx}{\linewidth}{l*{9}{Y}}
\toprule
\multicolumn{8}{l}{\textbf{Panel C: Employment history and professional 
experience, All CEOs}} \\
\midrule
                                      &        Mean&          SD&         
Min&         p25&         p50&         p75&         Max&       N. Obs.\\
CEO total experience  \hspace{.65cm}                    &       21.49&        
8.52&        6.00&       15.00&       20.00&       27.00&       43.00&        
4820\\
CEO N of firms                            &        6.03&        7.01&        
2.00&        2.00&        3.00&        7.00&       65.00&        4820\\
\end{tabularx}
\begin{tabularx}{\linewidth}{l*{4}{Y}}
\toprule
\multicolumn{3}{l}{\textbf{Panel D: Frequency of Tier1 ratio 
professional experience, CEOs}} \\
\midrule
                                                    &        Mean&          
SD&       N. Obs.\\
Negative experience (p5)                    &       0.077&        0.27&        
4816\\
Negative experience (p10)                               &       0.166&        
0.37&        4816\\
\bottomrule
\end{tabularx}  
[1]\ Footnote 1: Variable~1 is calculated as\ldots \endgraf
[2]\ Correlations are Pearson.
\end{table}

答案1

表格数组是一款非常方便的表格创建工具。您还可以嵌套类似表格的环境,以防某些部分需要不同数量的列。还可以堆叠表格。

\documentclass[12pt]{article}
% \usepackage{iaw}
% \usepackage{rfs}
\usepackage[demo]{graphicx}
\graphicspath{ {./images/} }
\usepackage{tabularray}
\UseTblrLibrary{booktabs}

\newcommand{\mcu}[3]{\mc{#1}{#2}{\underline{#3}}}
\SetTblrInner[tblr,talltblr]{rows = {rowsep=1pt}}


\begin{document}
\begin{table}[tbh]
  \footnotesize
  \begin{talltblr}[
      caption = {CEOs: Summary statistics, employment and professional experience history},
      note{[1]} = {\enspace Footnote 1: Variable~1 is calculated as\ldots},
      note{[2]} = {\enspace Correlations are Pearson.},
    ]{
      colspec = {@{} Q[l,4cm] *7{X[c]} X[1.5,c] @{}},
      row{1,5,12,16} = {rowsep+=3pt, font=\bfseries},
      hline{1-2,5-6,12-13,16-17,Z} = {\heavyrulewidth},   % \heavyrulewidth is a macro from booktabs
    }
    \SetCell[c=9]{} Panel A: Firm-level, Summary statistics, CEOs &&&&&&&& \\
                           & Mean  & SD   & Min   & p25   & p50   & p75   & Max   & N.Obs. \\
    Return on Assets       & 0.02  & 0.01 & -0.02 &  0.02 &  0.02 &  0.03 &  0.06 & 4543 \\
    Firm Size (LN)         & 8.17  & 1.71 & 4.25  &  6.84 &  7.87 &  9.26 & 11.98 & 4798 \\
    \SetCell[c=9]{} Panel B: Summary statistics, CEOs &&&&&&&& \\
                           & Mean  & SD   & Min   & p25   & p50   & p75   & Max   & N.Obs. \\
    CEO Age                & 57.39 & 7.02 & 33.00 & 53.00 & 58.00 & 62.00 & 83.00 & 4769 \\
    CEO Female             & 0.02  & 0.16 & 0.00  &  0.00 &  0.00 &  0.00 &  1.00 & 4820 \\
    CEO Tenure             & 12.28 & 9.00 & 1.00  &  5.00 & 10.00 & 17.00 & 61.00 & 4820 \\
    CEO Equity-based comp. & 0.46  & 0.27 & -0.34 &  0.26 &  0.48 &  0.69 &  1.00 & 1359 \\
    CEO MBA degree         & 0.30  & 0.46 & 0.00  &  0.00 &  0.00 &  1.00 &  1.00 & 4820 \\
    \SetCell[c=9]{} Panel C: Employment history and professional experience, All CEOs  &&&&&&&& \\
                           & Mean  & SD   & Min   & p25   & p50   & p75   & Max   & N.Obs. \\
    CEO total experience   & 21.49 & 8.52 & 6.00  & 15.00 & 20.00 & 27.00 & 43.00 & 4820 \\
    CEO N of firms         & 6.03  & 7.01 & 2.00  &  2.00 &  3.00 &  7.00 & 65.00 & 4820 \\
    \SetCell[c=9]{} Panel D: Frequency of Tier1 ratio professional experience, CEOs & & & & & & & & \\
    \SetCell[c=9]{}
    \begin{tblr}{
        colspec = {@{}Q[l,4cm] *3{X[c]} @{}},
      }
                                & Mean  & SD   & N. Obs. \\
      Negative experience (p5)  & 0.077 & 0.27 & 4816 \\
      Negative experience (p10) & 0.166 & 0.37 & 4816
    \end{tblr} & & & & & & & & \\
  \end{talltblr} 
\end{table}
\end{document}

在此处输入图片描述

或者,您可以在最后一部分进行左对齐,也可以在列之间保持不同的距离。请参阅以下代码片段:

    \SetCell[c=9]{halign=l}
    \begin{tblr}{
        colspec = {@{}Q[l,4cm] *3{Q[c]} @{}},
        column{3-Z} = {leftsep=1.25cm,},
      }
                                & Mean  & SD   & N. Obs. \\
      Negative experience (p5)  & 0.077 & 0.27 & 4816 \\
      Negative experience (p10) & 0.166 & 0.37 & 4816
    \end{tblr} & & & & & & & & \\

以及截图:

在此处输入图片描述

相关内容