我有以下回归表,它有两个问题。它太宽、太长,无法放在一页纸上。该问题的解决方案是什么?
谢谢你!
\caption{2021 Models}
\centering
\begin{tabular}[t]{lcccccc}
\toprule
& N.LPC & N.CPC & N.NDP & N.BQ & N.GP & N.PPC\\
\midrule
(Intercept) & \num{-0.007} & \num{0.197}*** & \num{0.010} & \num{-0.010} & \num{0.096}*** & \num{0.069}*\\
& (\num{0.021}) & (\num{0.023}) & (\num{0.017}) & (\num{0.010}) & (\num{0.020}) & (\num{0.028})\\
Economy & \num{0.027}*** & \num{-0.018}+ & \num{0.021}** & \num{0.008}* & \num{0.041}*** & \num{-0.038}***\\
& (\num{0.008}) & (\num{0.009}) & (\num{0.007}) & (\num{0.004}) & (\num{0.008}) & (\num{0.011})\\
Environment & \num{-0.018}+ & \num{0.069}*** & \num{-0.022}** & \num{-0.005} & \num{-0.046}*** & \num{0.094}***\\
& (\num{0.010}) & (\num{0.011}) & (\num{0.008}) & (\num{0.005}) & (\num{0.010}) & \vphantom{1} (\num{0.013})\\
Healthcare & \num{-0.022}* & \num{0.001} & \num{-0.014} & \num{-0.004} & \num{0.010} & \num{-0.002}\\
& (\num{0.011}) & (\num{0.012}) & (\num{0.009}) & (\num{0.005}) & (\num{0.011}) & \vphantom{1} (\num{0.014})\\
Seniors & \num{0.000} & \num{0.014} & \num{-0.007} & \num{0.006} & \num{0.014} & \num{-0.030}\\
& (\num{0.022}) & (\num{0.024}) & (\num{0.018}) & (\num{0.011}) & (\num{0.021}) & (\num{0.029})\\
Ethics & \num{0.045}* & \num{-0.011} & \num{0.020} & \num{0.001} & \num{-0.007} & \num{0.019}\\
& (\num{0.018}) & (\num{0.020}) & (\num{0.015}) & (\num{0.009}) & (\num{0.018}) & (\num{0.025})\\
Leadership & \num{0.068}*** & \num{-0.013} & \num{0.040}** & \num{0.019}* & \num{-0.005} & \num{-0.014}\\
& (\num{0.017}) & (\num{0.019}) & (\num{0.014}) & (\num{0.009}) & (\num{0.017}) & (\num{0.023})\\
Housing & \num{0.008} & \num{0.012} & \num{-0.011} & \num{0.007} & \num{-0.006} & \num{0.020}\\
& (\num{0.015}) & (\num{0.016}) & (\num{0.012}) & (\num{0.007}) & (\num{0.014}) & (\num{0.020})\\
Election & \num{0.006} & \num{-0.040} & \num{0.017} & \num{0.018} & \num{0.007} & \num{-0.036}\\
& (\num{0.026}) & (\num{0.029}) & (\num{0.022}) & (\num{0.013}) & (\num{0.026}) & (\num{0.036})\\
Covid-19 & \num{-0.009} & \num{-0.005} & \num{0.003} & \num{0.005} & \num{0.012} & \num{-0.003}\\
& (\num{0.009}) & (\num{0.010}) & (\num{0.008}) & (\num{0.005}) & (\num{0.009}) & (\num{0.013})\\
Conservative & \num{0.258}*** & \num{-0.213}*** & \num{0.111}*** & \num{-0.019}*** & \num{0.037}*** & \num{-0.116}***\\
& (\num{0.009}) & (\num{0.010}) & (\num{0.008}) & (\num{0.005}) & (\num{0.009}) & (\num{0.012})\\
NDP & \num{0.067}*** & \num{0.073}*** & \num{-0.041}*** & \num{-0.018}*** & \num{-0.051}*** & \num{0.041}**\\
& (\num{0.010}) & (\num{0.011}) & (\num{0.008}) & (\num{0.005}) & (\num{0.010}) & (\num{0.014})\\
Bloc Québécois & \num{0.160}*** & \num{-0.048}** & \num{0.034}** & \num{-0.154}*** & \num{-0.018} & \num{0.053}**\\
& (\num{0.013}) & (\num{0.015}) & (\num{0.011}) & (\num{0.007}) & (\num{0.013}) & (\num{0.018})\\
Green & \num{0.115}*** & \num{0.024} & \num{-0.003} & \num{-0.035}*** & \num{-0.079}*** & \num{-0.050}+\\
& (\num{0.021}) & (\num{0.023}) & (\num{0.017}) & (\num{0.010}) & (\num{0.021}) & (\num{0.028})\\
None/other/D.K & \num{0.120}*** & \num{-0.077}*** & \num{0.021}* & \num{-0.017}** & \num{-0.035}** & \num{-0.068}***\\
& (\num{0.011}) & (\num{0.012}) & (\num{0.009}) & (\num{0.006}) & (\num{0.011}) & \vphantom{1} (\num{0.015})\\
Partisanship strength & \num{0.053}*** & \num{0.049}*** & \num{0.027}** & \num{0.014}** & \num{-0.014} & \num{-0.018}\\
& (\num{0.011}) & (\num{0.012}) & (\num{0.009}) & (\num{0.005}) & (\num{0.011}) & (\num{0.014})\\
Antipolitician & \num{-0.106}*** & \num{-0.084}* & \num{-0.038} & \num{-0.008} & \num{-0.072}* & \num{0.235}***\\
& (\num{0.031}) & (\num{0.035}) & (\num{0.026}) & (\num{0.016}) & (\num{0.031}) & (\num{0.042})\\
Interest & \num{-0.002} & \num{0.019} & \num{0.014} & \num{0.001} & \num{0.015} & \num{0.164}***\\
& (\num{0.014}) & (\num{0.016}) & (\num{0.012}) & (\num{0.007}) & (\num{0.014}) & (\num{0.019})\\
Woman & \num{-0.009} & \num{0.005} & \num{-0.021}*** & \num{0.004} & \num{-0.029}*** & \num{-0.003}\\
& (\num{0.007}) & (\num{0.008}) & (\num{0.006}) & (\num{0.003}) & (\num{0.007}) & (\num{0.009})\\
Age & \num{0.000} & \num{0.000}* & \num{0.001}** & \num{0.000}+ & \num{0.001}*** & \num{0.002}***\\
& (\num{0.000}) & (\num{0.000}) & (\num{0.000}) & (\num{0.000}) & (\num{0.000}) & (\num{0.000})\\
Some technical to some university & \num{-0.002} & \num{0.022}* & \num{-0.003} & \num{0.001} & \num{-0.020}* & \num{0.006}\\
& (\num{0.010}) & (\num{0.011}) & (\num{0.008}) & (\num{0.005}) & (\num{0.009}) & (\num{0.013})\\
University degree & \num{-0.029}** & \num{0.045}*** & \num{0.005} & \num{0.002} & \num{-0.014} & \num{0.029}*\\
& (\num{0.010}) & (\num{0.011}) & (\num{0.008}) & (\num{0.005}) & (\num{0.010}) & (\num{0.013})\\
Maritimes & \num{-0.002} & \num{-0.055}** & \num{-0.007} & \num{0.000} & \num{-0.032}* & \num{-0.005}\\
& (\num{0.016}) & (\num{0.018}) & (\num{0.014}) & (\num{0.008}) & (\num{0.016}) & (\num{0.022})\\
Ontario & \num{-0.004} & \num{-0.020}+ & \num{0.008} & \num{-0.002} & \num{-0.018} & \num{0.000}\\
& (\num{0.011}) & (\num{0.012}) & (\num{0.009}) & (\num{0.006}) & (\num{0.011}) & (\num{0.015})\\
Québec & \num{0.004} & \num{-0.033}* & \num{0.000} & \num{0.142}*** & \num{-0.007} & \num{0.091}***\\
& (\num{0.012}) & (\num{0.013}) & (\num{0.010}) & (\num{0.006}) & (\num{0.012}) & (\num{0.016})\\
West & \num{0.017} & \num{0.004} & \num{-0.001} & \num{0.000} & \num{0.005} & \num{0.000}\\
& (\num{0.012}) & (\num{0.014}) & (\num{0.010}) & (\num{0.006}) & (\num{0.012}) & (\num{0.017})\\
\midrule
Num.Obs. & \num{10209} & \num{10209} & \num{10209} & \num{10209} & \num{10209} & \num{10209}\\
R2 & \num{0.114} & \num{0.097} & \num{0.061} & \num{0.118} & \num{0.037} & \num{0.067}\\
R2 Adj. & \num{0.112} & \num{0.095} & \num{0.058} & \num{0.115} & \num{0.034} & \num{0.064}\\
AIC & \num{5603.6} & \num{7760.4} & \num{1681.1} & \num{-8365.7} & \num{5434.9} & \num{11694.2}\\
BIC & \num{5827.8} & \num{7984.6} & \num{1905.3} & \num{-8141.6} & \num{5659.1} & \num{11918.4}\\
Log.Lik. & \num{-2770.803} & \num{-3849.208} & \num{-809.573} & \num{4213.870} & \num{-2686.474} & \num{-5816.101}\\
RMSE & \num{0.32} & \num{0.35} & \num{0.26} & \num{0.16} & \num{0.31} & \num{0.43}\\
\bottomrule
\multicolumn{7}{l}{\rule{0pt}{1em}+ p $<$ 0.1, * p $<$ 0.05, ** p $<$ 0.01, *** p $<$ 0.001}\\
\end{tabular}
\end{table}
答案1
你写了,
我有以下回归表,它有两个问题。它对于单页来说太宽和太长。
虽然桌子很长,但不是特别宽。我建议你使用长桌环境来排版表格。
请注意,我进一步建议将六个数据列中的数字与各自的小数点对齐。不过,一定要摆脱毫无意义且分散注意力的\num
包装。
longtable
下面的截图仅显示了编译后续代码生成的前几行。
\documentclass{article} % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage[letterpaper,margin=1in]{geometry} % set page parameters as needed
\usepackage{booktabs,longtable}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\begin{document}
\begin{longtable}{@{} l *{6}{d{2.5}} @{}}
\caption{2021 Models}\\
\toprule
& \mc{N.LPC} & \mc{N.CPC} & \mc{N.NDP} & \mc{N.BQ} & \mc{N.GP} & \mc{N.PPC}\\
\midrule
\endfirsthead
\multicolumn{7}{@{}l}{Table \thetable, cont'd}\\[1ex]
\toprule
& \mc{N.LPC} & \mc{N.CPC} & \mc{N.NDP} & \mc{N.BQ} & \mc{N.GP} & \mc{N.PPC}\\
\midrule
\endhead
\midrule
\multicolumn{7}{r@{}}{\footnotesize(cont'd on next page)}\\
\endfoot
\bottomrule
\addlinespace
\multicolumn{7}{@{}l}{${}^{+}\ p< 0.1$, ${}^{*}\ p<0.05$, ${}^{**}\ p<0.01$, ${}^{***}\ p<0.001$ }\\
\endlastfoot
(Intercept) & -0.007 & 0.197{}^{***} & 0.010 & -0.010 & 0.096{}^{***} & 0.069^{*}\\
& (0.021) & (0.023) & (0.017) & (0.010) & (0.020) & (0.028)\\
Economy & 0.027{}^{***} & -0.018{}^{+} & 0.021{}^{**} & 0.008{}^{*} & 0.041{}^{***} & -0.038{}^{***}\\
& (0.008) & (0.009) & (0.007) & (0.004) & (0.008) & (0.011)\\
Environment & -0.018{}^{+} & 0.069{}^{***} & -0.022{}^{**} & -0.005 & -0.046{}^{***} & 0.094{}^{***}\\
& (0.010) & (0.011) & (0.008) & (0.005) & (0.010) & (0.013)\\
Healthcare & -0.022{}^{*} & 0.001 & -0.014 & -0.004 & 0.010 & -0.002\\
& (0.011) & (0.012) & (0.009) & (0.005) & (0.011) & (0.014)\\
Seniors & 0.000 & 0.014 & -0.007 & 0.006 & 0.014 & -0.030\\
& (0.022) & (0.024) & (0.018) & (0.011) & (0.021) & (0.029)\\
Ethics & 0.045{}^{*} & -0.011 & 0.020 & 0.001 & -0.007 & 0.019\\
& (0.018) & (0.020) & (0.015) & (0.009) & (0.018) & (0.025)\\
Leadership & 0.068{}^{***} & -0.013 & 0.040{}^{**} & 0.019{}^{*} & -0.005 & -0.014\\
& (0.017) & (0.019) & (0.014) & (0.009) & (0.017) & (0.023)\\
Housing & 0.008 & 0.012 & -0.011 & 0.007 & -0.006 & 0.020\\
& (0.015) & (0.016) & (0.012) & (0.007) & (0.014) & (0.020)\\
Election & 0.006 & -0.040 & 0.017 & 0.018 & 0.007 & -0.036\\
& (0.026) & (0.029) & (0.022) & (0.013) & (0.026) & (0.036)\\
Covid-19 & -0.009 & -0.005 & 0.003 & 0.005 & 0.012 & -0.003\\
& (0.009) & (0.010) & (0.008) & (0.005) & (0.009) & (0.013)\\
Conservative & 0.258{}^{***} & -0.213{}^{***} & 0.111{}^{***} & -0.019{}^{***} & 0.037{}^{***} & -0.116{}^{***}\\
& (0.009) & (0.010) & (0.008) & (0.005) & (0.009) & (0.012)\\
NDP & 0.067{}^{***} & 0.073{}^{***} & -0.041{}^{***} & -0.018{}^{***} & -0.051{}^{***} & 0.041^{**} \\
& (0.010) & (0.011) & (0.008) & (0.005) & (0.010) & (0.014)\\
Bloc Québécois & 0.160{}^{***} & -0.048{}^{**} & 0.034{}^{**} & -0.154{}^{***} & -0.018 & 0.053^{**} \\
& (0.013) & (0.015) & (0.011) & (0.007) & (0.013) & (0.018)\\
Green & 0.115{}^{***} & 0.024 & -0.003 & -0.035{}^{***} & -0.079{}^{***} & -0.050^{+}\\
& (0.021) & (0.023) & (0.017) & (0.010) & (0.021) & (0.028)\\
None/other/D.K & 0.120{}^{***} & -0.077{}^{***} & 0.021{}^{*} & -0.017{}^{**} & -0.035{}^{**} & -0.068{}^{***}\\
& (0.011) & (0.012) & (0.009) & (0.006) & (0.011) & (0.015)\\
Partisanship strength & 0.053{}^{***} & 0.049{}^{***} & 0.027{}^{**} & 0.014{}^{**} & -0.014 & -0.018\\
& (0.011) & (0.012) & (0.009) & (0.005) & (0.011) & (0.014)\\
Antipolitician & -0.106{}^{***} & -0.084{}^{*} & -0.038 & -0.008 & -0.072{}^{*} & 0.235{}^{***}\\
& (0.031) & (0.035) & (0.026) & (0.016) & (0.031) & (0.042)\\
Interest & -0.002 & 0.019 & 0.014 & 0.001 & 0.015 & 0.164{}^{***}\\
& (0.014) & (0.016) & (0.012) & (0.007) & (0.014) & (0.019)\\
Woman & -0.009 & 0.005 & -0.021{}^{***} & 0.004 & -0.029{}^{***} & -0.003\\
& (0.007) & (0.008) & (0.006) & (0.003) & (0.007) & (0.009)\\
Age & 0.000 & 0.000{}^{*} & 0.001{}^{**} & 0.000{}^{+} & 0.001{}^{***} & 0.002{}^{***}\\
& (0.000) & (0.000) & (0.000) & (0.000) & (0.000) & (0.000)\\
Some techn. & -0.002 & 0.022{}^{*} & -0.003 & 0.001 & -0.020{}^{*} & 0.006\\*
& (0.010) & (0.011) & (0.008) & (0.005) & (0.009) & (0.013)\\
University degree & -0.029{}^{**} & 0.045{}^{***} & 0.005 & 0.002 & -0.014 & 0.029*\\
& (0.010) & (0.011) & (0.008) & (0.005) & (0.010) & (0.013)\\
Maritimes & -0.002 & -0.055{}^{**} & -0.007 & 0.000 & -0.032{}^{*} & -0.005\\
& (0.016) & (0.018) & (0.014) & (0.008) & (0.016) & (0.022)\\
Ontario & -0.004 & -0.020{}^{+} & 0.008 & -0.002 & -0.018 & 0.000\\
& (0.011) & (0.012) & (0.009) & (0.006) & (0.011) & (0.015)\\
Québec & 0.004 & -0.033{}^{*} & 0.000 & 0.142{}^{***} & -0.007 & 0.091{}^{***}\\*
& (0.012) & (0.013) & (0.010) & (0.006) & (0.012) & (0.016)\\
West & 0.017 & 0.004 & -0.001 & 0.000 & 0.005 & 0.000\\
& (0.012) & (0.014) & (0.010) & (0.006) & (0.012) & (0.017)\\
\midrule
Num.\ of Obs. & \mc{10209} & \mc{10209} & \mc{10209} & \mc{10209} & \mc{10209} & \mc{10209}\\
R2 & \mc{0.114} & \mc{0.097} & \mc{0.061} & \mc{0.118} & \mc{0.037} & \mc{0.067}\\
R2 Adj. & \mc{0.112} & \mc{0.095} & \mc{0.058} & \mc{0.115} & \mc{0.034} & \mc{0.064}\\
AIC & \mc{5603.6} & \mc{7760.4} & \mc{1681.1} & \mc{$-$8365.7} & \mc{5434.9} & \mc{11694.2}\\
BIC & \mc{5827.8} & \mc{7984.6} & \mc{1905.3} & \mc{$-$8141.6} & \mc{5659.1} & \mc{11918.4}\\
Log Lik. & \mc{$-$2770.803} & \mc{$-$3849.208} & \mc{$-$809.573} & \mc{4213.870} & \mc{$-$2686.474} & \mc{$-$5816.101}\\
RMSE & \mc{0.32} & \mc{0.35} & \mc{0.26} & \mc{0.16} & \mc{0.31} & \mc{0.43}\\
\end{longtable}
\end{document}