幫助重新繪製此相關表格以適合我的 pdf 頁面並且易於閱讀

幫助重新繪製此相關表格以適合我的 pdf 頁面並且易於閱讀
%\begin{table}[htbp]
\small
  \centering
  \caption{Add caption}
      \begin{tabular}{|l|p{4.855em}|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|r|}
    \toprule
    \multicolumn{2}{|l|}{} & \multicolumn{1}{p{4.215em}|}{NIM (\%)} & \multicolumn{1}{p{4.215em}|}{GDP  (\%)} & \multicolumn{1}{p{4.215em}|}{ROE} & \multicolumn{1}{p{4.215em}|}{ROA} & \multicolumn{1}{p{4.215em}|}{INFLTN} & \multicolumn{1}{p{4.215em}|}{FDI} & \multicolumn{1}{p{4.215em}|}{BCBD (\%)} & \multicolumn{1}{p{4.215em}|}{DBACBA (\%)} & \multicolumn{1}{p{4.215em}|}{CBAGDP (\%)} & \multicolumn{1}{p{4.215em}|}{DBAGDP (\%)} & \multicolumn{1}{p{4.215em}|}{FDGDP (\%)} & \multicolumn{1}{p{4.215em}|}{LISTCO\_PC} & \multicolumn{1}{p{4.215em}|}{LL\_USD} & \multicolumn{1}{p{4.215em}|}{XREGME} & \multicolumn{1}{p{4.215em}|}{XREGCON} & \multicolumn{1}{p{4.215em}|}{OVERHEAD (\%)} & \multicolumn{1}{p{4.215em}|}{LLGDP (\%)} & \multicolumn{1}{p{4.215em}|}{STMKCAP (\%)} & \multicolumn{1}{p{4.215em}|}{STVALT\_D (\%)} & \multicolumn{1}{p{4.215em}|}{STTURN\_R (\%)} & \multicolumn{1}{p{4.215em}|}{NRBLOAN (\%)} \\
    \midrule
    \multicolumn{1}{|l|}{\multirow{21}[41]{*}{Pearson Correlation}} & NIM (\%) & 1.000 & .068  & .466  & .556  & .325  & -.030 & -.322 & -.418 & .304  & -.280 & -.329 & -.312 & -.081 & -.329 & .470  & .593  & -.386 & -.182 & -.114 & .102  & .016 \\
\cmidrule{2-2}          & GDP  (\%) & .068  & 1.000 & -.015 & .111  & .044  & -.089 & -.079 & .013  & -.036 & .006  & -.031 & .002  & .103  & -.240 & .329  & .143  & -.045 & -.454 & -.461 & .037  & -.234 \\
\cmidrule{2-2}          & ROE   & .466  & -.015 & 1.000 & .810  & .097  & .234  & -.162 & .139  & -.095 & -.067 & .058  & .064  & -.159 & .221  & -.068 & -.164 & .018  & .070  & .074  & -.026 & .087 \\
\cmidrule{2-2}          & ROA   & .556  & .111  & .810  & 1.000 & .246  & -.034 & -.153 & .034  & -.054 & -.048 & -.018 & -.058 & -.072 & .018  & .222  & -.014 & -.059 & -.044 & -.041 & -.053 & -.010 \\
\cmidrule{2-2}          & INFLTN & .325  & .044  & .097  & .246  & 1.000 & -.231 & -.146 & -.335 & .321  & -.065 & -.142 & -.115 & -.012 & -.292 & .308  & .048  & -.134 & -.081 & -.051 & .091  & -.072 \\
\cmidrule{2-2}          & FDI   & -.030 & -.089 & .234  & -.034 & -.231 & 1.000 & -.172 & -.049 & .131  & -.165 & .066  & .105  & -.169 & .315  & -.294 & .010  & -.021 & .271  & .259  & -.029 & -.069 \\
\cmidrule{2-2}          & BCBD (\%) & -.322 & -.079 & -.162 & -.153 & -.146 & -.172 & 1.000 & .375  & -.334 & .394  & .179  & .208  & .158  & .206  & -.522 & -.262 & .254  & .079  & .071  & .042  & .391 \\
\cmidrule{2-2}          & DBACBA (\%) & -.418 & .013  & .139  & .034  & -.335 & -.049 & .375  & 1.000 & -.884 & .364  & .453  & .298  & .318  & .268  & -.248 & -.569 & .440  & .105  & .083  & .150  & -.139 \\
\cmidrule{2-2}          & CBAGDP (\%) & .304  & -.036 & -.095 & -.054 & .321  & .131  & -.334 & -.884 & 1.000 & -.203 & -.266 & -.174 & -.238 & -.295 & .221  & .513  & -.269 & -.086 & -.069 & -.106 & .075 \\
\cmidrule{2-2}          & DBAGDP (\%) & -.280 & .006  & -.067 & -.048 & -.065 & -.165 & .394  & .364  & -.203 & 1.000 & .900  & .794  & .045  & -.218 & -.247 & -.393 & .929  & .087  & .030  & -.026 & .155 \\
\cmidrule{2-2}          & FDGDP (\%) & -.329 & -.031 & .058  & -.018 & -.142 & .066  & .179  & .453  & -.266 & .900  & 1.000 & .819  & -.039 & -.036 & -.270 & -.463 & .974  & .134  & .065  & -.022 & .040 \\
\cmidrule{2-2}          & LISTCO\_PC & -.312 & .002  & .064  & -.058 & -.115 & .105  & .208  & .298  & -.174 & .794  & .819  & 1.000 & -.074 & .105  & -.451 & -.419 & .806  & .121  & .064  & .015  & .042 \\
\cmidrule{2-2}          & LL\_USD & -.081 & .103  & -.159 & -.072 & -.012 & -.169 & .158  & .318  & -.238 & .045  & -.039 & -.074 & 1.000 & -.301 & .204  & -.108 & -.086 & -.034 & -.016 & .060  & -.303 \\
\cmidrule{2-2}          & XREGME & -.329 & -.240 & .221  & .018  & -.292 & .315  & .206  & .268  & -.295 & -.218 & -.036 & .105  & -.301 & 1.000 & -.706 & -.255 & -.018 & .177  & .151  & .034  & .220 \\
\cmidrule{2-2}          & XREGCON & .470  & .329  & -.068 & .222  & .308  & -.294 & -.522 & -.248 & .221  & -.247 & -.270 & -.451 & .204  & -.706 & 1.000 & .407  & -.342 & -.345 & -.308 & .013  & -.489 \\
\cmidrule{2-2}          & OVERHEAD (\%) & .593  & .143  & -.164 & -.014 & .048  & .010  & -.262 & -.569 & .513  & -.393 & -.463 & -.419 & -.108 & -.255 & .407  & 1.000 & -.495 & -.311 & -.254 & .125  & -.060 \\
\cmidrule{2-2}          & LLGDP (\%) & -.386 & -.045 & .018  & -.059 & -.134 & -.021 & .254  & .440  & -.269 & .929  & .974  & .806  & -.086 & -.018 & -.342 & -.495 & 1.000 & .110  & .035  & -.052 & .145 \\
\cmidrule{2-2}          & STMKCAP (\%) & -.182 & -.454 & .070  & -.044 & -.081 & .271  & .079  & .105  & -.086 & .087  & .134  & .121  & -.034 & .177  & -.345 & -.311 & .110  & 1.000 & .988  & -.023 & .162 \\
\cmidrule{2-2}          & STVALT\_D (\%) & -.114 & -.461 & .074  & -.041 & -.051 & .259  & .071  & .083  & -.069 & .030  & .065  & .064  & -.016 & .151  & -.308 & -.254 & .035  & .988  & 1.000 & .083  & .168 \\
\cmidrule{2-2}          & STTURN\_R (\%) & .102  & .037  & -.026 & -.053 & .091  & -.029 & .042  & .150  & -.106 & -.026 & -.022 & .015  & .060  & .034  & .013  & .125  & -.052 & -.023 & .083  & 1.000 & .051 \\
\cmidrule{2-2}          & NRBLOAN (\%) & .016  & -.234 & .087  & -.010 & -.072 & -.069 & .391  & -.139 & .075  & .155  & .040  & .042  & -.303 & .220  & -.489 & -.060 & .145  & .162  & .168  & .051  & 1.000 \\
    \end{tabular}%
  \label{tab:addlabel}%
%\end{table}%

答案1

讓 21x21 相關表看起來「不錯」始終是一個嚴峻的藝術挑戰。 (旁白:您是否有理由相信您的讀者會關心看到完整的相關性表?如果您只報告真正重要的 2 或 3 個相關性,他們會一樣好,甚至更好嗎?)

一些建議:

  • 為了節省大量稀缺的水平空間,請省略整個第一列,並將字串「Pearson Correlation」放在 的參數中\caption

  • 載入sidewaystable套件並將整個表封裝在sidewaystable環境中。我相信你能猜到sidewaystable環境的作用。

  • 大幅簡化標題單元格。無需說明變數名稱,只需將列編號為 (1)、(2) 等。畢竟,您已經在第一列中列出了變數名稱。

  • 去掉所有 23 條垂直線——你會驚訝於 23 條線可以佔據多少空間——以及 23 條水平線中的 20 條。裝入booktabs包並使用\toprule\midrule\bottomrule繪製剩餘的 3 條水平線。可選:\addlinespace每 5 行之後插入指令。

  • 使用tabular*環境並將其整體寬度設為\textwidth

  • 對資料列使用數學模式,以確保-符號排版為數學減號而不是文字模式「破折號」符號

  • 即使進行了所有這些調整,您仍然需要將字體大小切換為\footnotesize或 甚至\scriptsize

在此輸入影像描述

\documentclass{article}
\usepackage[a4paper,margin=2.5cm]{geometry} % set page size parameters appropriately
\usepackage{booktabs,rotating,array,caption}
\newcolumntype{R}{>{$}r<{$}} % right-aligned, math mode

\begin{document}
\begin{sidewaystable}
\captionsetup{skip=0.5\baselineskip,font=footnotesize}
\caption{Pearson Correlations} \label{tab:addlabel}
\footnotesize % or even "\scriptsize", if necessary

\setlength\extrarowheight{2pt} % optional; for a more open "look"

\setlength\tabcolsep{0pt} % make LaTeX figure out max. intercol. whitespace
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l *{21}{R} }
\toprule
&  (1) &  (2) &  (3) &  (4) &  (5) &  (6) &  (7) &  (8) &  (9) & (10)
& (11) & (12) & (13) & (14) & (15) & (16) & (17) & (18) & (19) & (20) & (21) \\
\midrule
(1) NIM (\%) & 1.000 & .068  & .466  & .556  & .325  & -.030 & -.322 & -.418 & .304  & -.280 & -.329 & -.312 & -.081 & -.329 & .470  & .593  & -.386 & -.182 & -.114 & .102  & .016 \\
(2) GDP  (\%) & .068  & 1.000 & -.015 & .111  & .044  & -.089 & -.079 & .013  & -.036 & .006  & -.031 & .002  & .103  & -.240 & .329  & .143  & -.045 & -.454 & -.461 & .037  & -.234 \\
(3) ROE   & .466  & -.015 & 1.000 & .810  & .097  & .234  & -.162 & .139  & -.095 & -.067 & .058  & .064  & -.159 & .221  & -.068 & -.164 & .018  & .070  & .074  & -.026 & .087 \\
(4) ROA   & .556  & .111  & .810  & 1.000 & .246  & -.034 & -.153 & .034  & -.054 & -.048 & -.018 & -.058 & -.072 & .018  & .222  & -.014 & -.059 & -.044 & -.041 & -.053 & -.010 \\
(5) INFLTN & .325  & .044  & .097  & .246  & 1.000 & -.231 & -.146 & -.335 & .321  & -.065 & -.142 & -.115 & -.012 & -.292 & .308  & .048  & -.134 & -.081 & -.051 & .091  & -.072 \\
\addlinespace
(6) FDI   & -.030 & -.089 & .234  & -.034 & -.231 & 1.000 & -.172 & -.049 & .131  & -.165 & .066  & .105  & -.169 & .315  & -.294 & .010  & -.021 & .271  & .259  & -.029 & -.069 \\
(7) BCBD (\%) & -.322 & -.079 & -.162 & -.153 & -.146 & -.172 & 1.000 & .375  & -.334 & .394  & .179  & .208  & .158  & .206  & -.522 & -.262 & .254  & .079  & .071  & .042  & .391 \\
(8) DBACBA (\%) & -.418 & .013  & .139  & .034  & -.335 & -.049 & .375  & 1.000 & -.884 & .364  & .453  & .298  & .318  & .268  & -.248 & -.569 & .440  & .105  & .083  & .150  & -.139 \\
(9) CBAGDP (\%) & .304  & -.036 & -.095 & -.054 & .321  & .131  & -.334 & -.884 & 1.000 & -.203 & -.266 & -.174 & -.238 & -.295 & .221  & .513  & -.269 & -.086 & -.069 & -.106 & .075 \\
(10) DBAGDP (\%) & -.280 & .006  & -.067 & -.048 & -.065 & -.165 & .394  & .364  & -.203 & 1.000 & .900  & .794  & .045  & -.218 & -.247 & -.393 & .929  & .087  & .030  & -.026 & .155 \\
\addlinespace
(11) FDGDP (\%) & -.329 & -.031 & .058  & -.018 & -.142 & .066  & .179  & .453  & -.266 & .900  & 1.000 & .819  & -.039 & -.036 & -.270 & -.463 & .974  & .134  & .065  & -.022 & .040 \\
(12) LISTCO\_PC & -.312 & .002  & .064  & -.058 & -.115 & .105  & .208  & .298  & -.174 & .794  & .819  & 1.000 & -.074 & .105  & -.451 & -.419 & .806  & .121  & .064  & .015  & .042 \\
(13) LL\_USD & -.081 & .103  & -.159 & -.072 & -.012 & -.169 & .158  & .318  & -.238 & .045  & -.039 & -.074 & 1.000 & -.301 & .204  & -.108 & -.086 & -.034 & -.016 & .060  & -.303 \\
(14) XREGME & -.329 & -.240 & .221  & .018  & -.292 & .315  & .206  & .268  & -.295 & -.218 & -.036 & .105  & -.301 & 1.000 & -.706 & -.255 & -.018 & .177  & .151  & .034  & .220 \\
(15) XREGCON & .470  & .329  & -.068 & .222  & .308  & -.294 & -.522 & -.248 & .221  & -.247 & -.270 & -.451 & .204  & -.706 & 1.000 & .407  & -.342 & -.345 & -.308 & .013  & -.489 \\
\addlinespace
(16) OVERHEAD (\%) & .593  & .143  & -.164 & -.014 & .048  & .010  & -.262 & -.569 & .513  & -.393 & -.463 & -.419 & -.108 & -.255 & .407  & 1.000 & -.495 & -.311 & -.254 & .125  & -.060 \\
(17) LLGDP (\%) & -.386 & -.045 & .018  & -.059 & -.134 & -.021 & .254  & .440  & -.269 & .929  & .974  & .806  & -.086 & -.018 & -.342 & -.495 & 1.000 & .110  & .035  & -.052 & .145 \\
(18) STMKCAP (\%) & -.182 & -.454 & .070  & -.044 & -.081 & .271  & .079  & .105  & -.086 & .087  & .134  & .121  & -.034 & .177  & -.345 & -.311 & .110  & 1.000 & .988  & -.023 & .162 \\
(19) STVALT\_D (\%) & -.114 & -.461 & .074  & -.041 & -.051 & .259  & .071  & .083  & -.069 & .030  & .065  & .064  & -.016 & .151  & -.308 & -.254 & .035  & .988  & 1.000 & .083  & .168 \\
(20) STTURN\_R (\%) & .102  & .037  & -.026 & -.053 & .091  & -.029 & .042  & .150  & -.106 & -.026 & -.022 & .015  & .060  & .034  & .013  & .125  & -.052 & -.023 & .083  & 1.000 & .051 \\
(21) NRBLOAN (\%) & .016  & -.234 & .087  & -.010 & -.072 & -.069 & .391  & -.139 & .075  & .155  & .040  & .042  & -.303 & .220  & -.489 & -.060 & .145  & .162  & .168  & .051  & 1.000 \\
\bottomrule
\end{tabular*}
\end{sidewaystable}
\end{document} 

相關內容