如何调整桌子以使其更美观

如何调整桌子以使其更美观

我正在尝试调整表格以使其更好看,这是我的代码和输出

\documentclass{article}
\usepackage{geometry}
\usepackage{rotating}
\usepackage{booktabs, makecell}
\usepackage[referable]{threeparttablex}
\usepackage{siunitx}
\usepackage[skip=1ex]{caption}

\newcommand{\Risk}{\mathop{\textnormal{\slshape Risk}}\nolimits}
\newcommand{\CEOPC}{\mathop{\textnormal{\slshape CEO\_PC}}\nolimits}
\newcommand{\Boardind}{\mathop{\textnormal{\slshape Board\_ind}}\nolimits}
\newcommand{\OwnP}{\mathop{\textnormal{\slshape OwnP}}\nolimits}
\newcommand{\OwnF}{\mathop{\textnormal{\slshape OwnF}}\nolimits}
\newcommand{\lnZ}{\mathop{\textnormal{\slshape lnZ}}\nolimits}

\begin{document}
\centering
 \sisetup{input-symbols={( - )},
 table-align-text-post=false,
     parse-numbers=false,    
     table-format=2.2         
 }  
 \renewcommand\arraystretch{0.9}
 \setlength\tabcolsep{1pt}
\begin{threeparttable}
\caption{Risk }
\label{tab:min}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
                l
           *{6}{S[table-format=-2.3]}
                                    }
\toprule
 &   \multicolumn{2}{c}{\textit{Credit risk (NPLs):}}
                &   \multicolumn{3}{c}{\textit{Insolvency risk (Log Z-score):}}  \\
\cmidrule{2-3}\cmidrule{4-6}
& {\makecell[b]{EQ}}
    & {\makecell[b]{EQ}}
            & {\makecell[b]{EQ}}
                & {\makecell[b]{EQ}}\\                  
& {(1)} & {(2)} & {(3)} & {(4)}        \\
\midrule
Constant
& 5.06             & -44.380\tnote{***}
& 5.104\tnote{***} & -23.011\tnote{***}       \\
& (16.18)          & (12.04)          
& (17.35)          & (4.429)                  \\
\addlinespace
NPL_{it-1}
& 0.23\tnote{***}   &  0.23\tnote{***}  
&                   &                          \\
& (-2.33)            & (-2.33)            
&                   &                          \\
\addlinespace
lnZ_{it-1}
&                   &                      
&  0.51\tnote{***}  & 0.51\tnote{***}         \\
&                   &                   
& (5.83)            & (5.83)                   \\
\addlinespace
CEO\_PC_{it}
& 6.28 \tnote{***}  & 6.28 \tnote{***}  
& 1.02              & 1.02                      \\
& (12.45)           & (12.45)           
& (1.42)            & (1.42)                    \\
\addlinespace
Board\_ind
& -0.302 \tnote{***}  & -0.302 \tnote{***}
& -0.351 \tnote{***}  & -4.194\tnote{**}         \\
& (-2.26)             & (-2.26)             
& (-9.11)             & (-9.11)                  \\
\addlinespace
OwnF
& 172.346\tnote{***}&                    
& 34.885\tnote{***} &                            \\
& (10.328)          &                    
& (4.545)           &                            \\
\addlinespace
OwnP
&                   & 30.974\tnote{***} 
&                   &  7.323\tnote{**}   \\
&                   & (5.803)           
&                   & (3.704)              \\
\addlinespace
CEO\_PC_{it}*OwnF_{i,t}
& 14.358            &                   
& 2.479             &                       \\
& (14.103)          &                   
& (6.961)           &                       \\
\addlinespace
CEO\_PC_{it}*OwnP_{i,t}
&                   & 1.660            
&                   & 6.437                  \\
&                   & (11.014)          
&                   & (7.461)                \\
\addlinespace
Board\_ind_{i,t}*OwnF_{i,t}
& 0.735             &                   
& -1.743            &                        \\
& (10.900)          &                  
& (4.476)           &                        \\
\addlinespace
Board\_ind_{i,t}*OwnP_{i,t}
&                   & -2.939            
&                   & 2.046                   \\
&                   & (7.612)          
&                   & (3.113)                 \\
\addlinespace
 Size 
& -2.203            & -2.939           
& 2.470             & 2.046                   \\
& (10.975)          & (7.612)           
& (4.639)           & (3.113)                 \\
\addlinespace
Capitalization
& -2.203            & -2.939           
& 2.470             & 2.046                   \\
& (10.975)          & (7.612)          
& (4.639)           & (3.113)                \\
\addlinespace
liquidity 
& -2.203            & -2.939            
& 2.470             & 2.046                   \\
& (10.975)          & (7.612)           
& (4.639)           & (3.113)                  \\
Profitability 
& -2.203            & -2.939            
& 2.470             & 2.046                    \\
& (10.975)          & (7.612)           
& (4.639)           & (3.113)                 \\
Efficiency
& -2.203            & -2.939            
& 2.470             & 2.046                     \\
& (10.975)          & (7.612)          
& (4.639)           & (3.113)                \\
Leverage ratio 
& -2.203            & -2.939            
& 2.470             & 2.046                   \\
& (10.975)          & (7.612)           
& (4.639)           & (3.113)                  \\
Loan growth 
& -2.203            & -2.939            
& 2.470             & 2.046                   \\
& (10.975)          & (7.612)           
& (4.639)           & (3.113)                 \\
Asset growth 
& -2.203            & -2.939            
& 2.470             & 2.046                    \\
& (10.975)          & (7.612)          
& (4.639)           & (3.113)                 \\
Asset growth 
& -2.203            & -2.939            
& 2.470             & 2.046                    \\
& (10.975)          & (7.612)          
& (4.639)           & (3.113)                  \\
Asset growth 
& -2.203            & -2.939            
& 2.470             & 2.046                     \\
& (10.975)          & (7.612)           
& (4.639)           & (3.113)                  \\
\midrule
Year dummy
& {Yes }            & {Yes }           
& {Yes }            & {Yes }                   \\
R$\tnote{2}$
& {0.546}           & {0.314}          
& {0.178}           & {0.112}                 \\
Adjusted R$\tnote{2}$
& {0.543}           & {0.309}           
& {0.173}           & {0.106}                  \\
Sargan test 
& 146.365           & 101.519           
& 65.110            & 43.686                    \\
\bottomrule
\end{tabular*}
\begin{tablenotes}[flushleft, para]\footnotesize
 \note: \item[*] $p<$0.1; \item[**] $p<0.05$; \item[***] $p<0.01$
\end{tablenotes}
\end{threeparttable}
\end{document}

在此处输入图片描述

答案1

一些意见和建议:

  • 我已分解一些标题单元格以确保所有四个数据列的宽度相同。

  • 我已经从 a 环境切换tabular*到 atabular环境,因为按照列的自然宽度进行排版似乎是正确的做法。

  • 我已经对几乎所有的论点进行了\sisetup相当大的调整。

  • 我修复了一些变量名称并将其替换*$\times$

  • 这里不需要threeparttable机械。事实上,我认为你\tnote在代码中使用指令的方式构成了对宏的严重滥用\tnote。例如,请写出R$^2$R\textsuperscript{2}不是 R$\tnote{2}$

  • 表中的最后两个变量似乎是重复的;我已经注释掉了相应的代码。

  • 为了节省垂直空间,您可以注释掉所有\addlinespace指令。

在此处输入图片描述

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[margin=2.5cm,a4paper]{geometry} % set page parameters suitably
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage[skip=1ex]{caption}

\begin{document}
\begin{table}[p]
\sisetup{input-open-uncertainty  = ,
         input-close-uncertainty = ,
         table-space-text-pre    = (,
         table-space-text-post   = ***,
         table-format            = 3.3,
         table-align-text-pre    = false,
         table-align-text-post   = false}

\centering
\caption{Risk} 
\label{tab:min}
\begin{tabular}{@{} l *{4}{S} @{}}
\toprule
  & \multicolumn{2}{c}{\textit{Credit risk}}
  & \multicolumn{2}{c@{}}{\textit{Insolvency risk}}  \\
  & \multicolumn{2}{c}{\textit{(NPLs)}}
  & \multicolumn{2}{c@{}}{\textit{(Log Z-score)}} \\
\cmidrule(lr){2-3} \cmidrule(l){4-5}
  & {EQ} & {EQ} & {EQ} & {EQ} \\
  & {(1)} & {(2)} & {(3)} & {(4)} \\
\midrule
Constant
  & 5.06 & -44.380*** & 5.104*** & -23.011*** \\
  & (16.18) & (12.04) & (17.35) & (4.429) \\
  \addlinespace
NPL$_{i,t-1}$
  & 0.23***   &  0.23*** & &   \\
  & (-2.33) & (-2.33)  & &   \\
  \addlinespace
$\ln Z_{it-1}$
  & & &  0.51***  & 0.51*** \\
  & &  & (5.83) & (5.83) \\
  \addlinespace
CEO\_PC$_{it}$
  & 6.28***  & 6.28*** & 1.02 & 1.02 \\
  & (12.45) & (12.45) & (1.42) & (1.42) \\
  \addlinespace
Board\_ind
  & -0.302***  & -0.302*** & -0.351***  & -4.194** \\
  & (-2.26) & (-2.26) & (-9.11) & (-9.11) \\
  \addlinespace
OwnF
  & 172.346***& & 34.885*** & \\
  & (10.328) & & (4.545) &  \\
  \addlinespace
OwnP
  & & 30.974*** & &  7.323**   \\
  & & (5.803) & & (3.704) \\
  \addlinespace
CEO\_PC$_{it}$${}\times{}$OwnF$_{i,t}$
  & 14.358 & & 2.479 & \\
  & (14.103) & & (6.961) & \\
  \addlinespace
CEO\_PC$_{it}$${}\times{}$OwnP$_{i,t}$
  & & 1.660 & & 6.437 \\
  & & (11.014) & & (7.461) \\
  \addlinespace
Board\_ind$_{i,t}$${}\times{}$OwnF$_{i,t}$
  & 0.735    & & -1.743 & \\
  & (10.900) & & (4.476) & \\
  \addlinespace
Board\_ind$_{i,t}$${}\times{}$OwnP$_{i,t}$
  & & -2.939 & & 2.046 \\
  & & (7.612)& & (3.113) \\
  \addlinespace
Size 
  & -2.203 & -2.939 & 2.470 & 2.046 \\
  & (10.975) & (7.612) & (4.639) & (3.113) \\
  \addlinespace
Capitalization
  & -2.203 & -2.939 & 2.470 & 2.046 \\
  & (10.975) & (7.612) & (4.639) & (3.113) \\
  \addlinespace
Liquidity 
  & -2.203 & -2.939 & 2.470 & 2.046 \\
  & (10.975) & (7.612) & (4.639) & (3.113) \\
  \addlinespace
Profitability 
  & -2.203 & -2.939 & 2.470 & 2.046 \\
  & (10.975) & (7.612) & (4.639) & (3.113) \\
  \addlinespace
Efficiency
  & -2.203 & -2.939 & 2.470 & 2.046 \\
  & (10.975) & (7.612)  & (4.639) & (3.113) \\
  \addlinespace
Leverage ratio 
  & -2.203 & -2.939 & 2.470 & 2.046 \\
  & (10.975) & (7.612) & (4.639) & (3.113) \\
  \addlinespace
Loan growth 
  & -2.203 & -2.939 & 2.470 & 2.046 \\
  & (10.975) & (7.612) & (4.639) & (3.113) \\
  \addlinespace
Asset growth 
  & -2.203 & -2.939 & 2.470 & 2.046 \\
  & (10.975) & (7.612) & (4.639) & (3.113) \\
%  \addlinespace
%Asset growth 
%  & -2.203 & -2.939 & 2.470 & 2.046 \\
%  & (10.975) & (7.612) & (4.639) & (3.113) \\
%  \addlinespace
%Asset growth 
%  & -2.203 & -2.939 & 2.470 & 2.046 \\
%  & (10.975) & (7.612) & (4.639) & (3.113) \\
\midrule
Year dummy     & {Yes} & {Yes} & {Yes} & {Yes} \\
R$^2$          & 0.546 & 0.314 & 0.178 & 0.112 \\
Adjusted R$^2$ & 0.543 & 0.309 & 0.173 & 0.106 \\
Sargan test    & 146.365 & 101.519 & 65.110 & 43.686 \\
\bottomrule
\addlinespace
\multicolumn{5}{@{}l}{* $p<0.1$; ** $p<0.05$; *** $p<0.01$}\\
\end{tabular}
\end{table}
\end{document}

相关内容