Longtable 无法与 Stargazer Table 一起使用

Longtable 无法与 Stargazer Table 一起使用

我正在尝试使表格跨越多页。这是我的代码:

\begin{table}[!htbp] \centering 
  \caption{Results for Living Standard Indicators} 
  \label{} 
\begin{tabular}{@{\extracolsep{5pt}}lccc} 
\\[-1.8ex]\hline 
\hline \\[-1.8ex] 
 & \multicolumn{3}{c}{\textit{Dependent variable:}} \\ 
\cline{2-4} 
\\[-1.8ex] & $K_{i,t}$ & $H_{i,t}$ & $I_{i,t}$ \\ 
 & Physical Capital & Human Capital & Institutional Capital \\ 
\\[-1.8ex] & (1) & (2) & (3)\\ 
\hline \\[-1.8ex] 
 $R_{i}$ & $-$0.10$^{***}$ & $-$0.05 & 0.08 \\ 
  & (0.02) & (0.04) & (0.08) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$^{2}$ & $-$0.002 & $-$0.01$^{**}$ & $-$0.01 \\ 
  & (0.002) & (0.004) & (0.01) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$ & 0.13$^{*}$ & 0.69$^{***}$ & 0.22 \\ 
  & (0.07) & (0.18) & (0.42) \\ 
  & & & \\ 
 $R_{i}$*$NR_{i}$ & $-$0.50$^{***}$ & 0.18 & $-$0.98$^{*}$ \\ 
  & (0.09) & (0.23) & (0.56) \\ 
  & & & \\ 
 $R_{i}$*$D_{i}$ & 0.01 & 0.05 & 0.11 \\ 
  & (0.02) & (0.04) & (0.08) \\ 
  & & & \\ 
 $R_{i}$*$L_{i}$ & 0.0004 & $-$0.05 & $-$0.23$^{***}$ \\ 
  & (0.01) & (0.03) & (0.06) \\ 
  & & & \\ 
 $R_{i}$*$V_{i}$ & 0.02$^{**}$ & $-$0.06$^{*}$ & $-$0.12$^{***}$ \\ 
  & (0.01) & (0.03) & (0.04) \\ 
  & & & \\ 
 $R_{i}$*$C_{i}$ & 0.03$^{**}$ & $-$0.08$^{**}$ & $-$0.17$^{**}$ \\ 
  & (0.01) & (0.04) & (0.07) \\ 
  & & & \\ 
 $R_{i}$*$M_{i}$ & $-$0.01 & $-$0.04$^{**}$ & 0.09$^{***}$ \\ 
  & (0.01) & (0.02) & (0.03) \\ 
  & & & \\ 
 $R_{i}$*$S_{i}$ & 0.04$^{***}$ & 0.23$^{***}$ & 0.19$^{**}$ \\ 
  & (0.02) & (0.04) & (0.08) \\ 
  & & & \\ 
 $R_{i}$*$Dem_{i}$ & 0.05$^{***}$ & 0.07$^{***}$ & 0.07 \\ 
  & (0.02) & (0.02) & (0.05) \\ 
  & & & \\ 
 $R_{i}$*$Right_{i}$ & $-$0.02 & $-$0.03 & $-$0.20$^{*}$ \\ 
  & (0.02) & (0.05) & (0.10) \\ 
  & & & \\ 
 $R_{i}$*$Left_{i} & 0.02 & $-$0.03 & $-$0.08 \\ 
  & (0.01) & (0.05) & (0.07) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$L_{i}$ & $-$0.01 & $-$0.37$^{*}$ & $-$0.52 \\ 
  & (0.07) & (0.19) & (0.37) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$V_{i}$ & 0.001 & 0.51$^{***}$ & 0.18 \\ 
  & (0.05) & (0.12) & (0.22) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$C_{i}$ & $-$0.08 & $-$0.33$^{**}$ & $-$0.80$^{**}$ \\ 
  & (0.06) & (0.16) & (0.36) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$M_{i}$ & $-$0.01 & $-$0.17$^{**}$ & 0.14 \\ 
  & (0.03) & (0.08) & (0.16) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$S_{i}$ & $-$0.01 & $-$0.86$^{***}$ & 0.87$^{**}$ \\ 
  & (0.08) & (0.20) & (0.42) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$Dem_{i} & 0.10$^{*}$ & $-$0.14 & 0.07 \\ 
  & (0.05) & (0.09) & (0.27) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$Left_{i}$ & 0.02 & $-$0.67$^{***}$ & 0.31 \\ 
  & (0.05) & (0.20) & (0.29) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$Right_{i}$ & 0.15$^{*}$ & 0.39 & 0.11 \\ 
  & (0.08) & (0.24) & (0.53) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$D_{i}$ & $-$0.29$^{***}$ & $-$0.35$^{**}$ & 0.59$^{*}$ \\ 
  & (0.07) & (0.16) & (0.32) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}$*$NR_{i}$ & 0.56 & 0.83 & 1.05 \\ 
  & (0.39) & (1.15) & (2.35) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$L_{i}$ & $-$0.002 & 0.003 & $-$0.02$^{*}$ \\ 
  & (0.002) & (0.005) & (0.01) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$V_{i}$ & $-$0.0001 & $-$0.004$^{*}$ & 0.004 \\ 
  & (0.001) & (0.002) & (0.004) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$C_{i}$ & 0.003$^{**}$ & 0.01$^{*}$ & 0.01$^{*}$ \\ 
  & (0.001) & (0.003) & (0.01) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$M_{i}$ & $-$0.001 & 0.003$^{*}$ & $-$0.001 \\ 
  & (0.001) & (0.002) & (0.004) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$S_{i}$ & $-$0.0005 & 0.01$^{***}$ & $-$0.01$^{**}$ \\ 
  & (0.002) & (0.003) & (0.01) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$Dem_{i}$ & $-$0.001 & 0.001 & 0.01 \\ 
  & (0.001) & (0.002) & (0.01) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$D_{i}$ & 0.001 & 0.01 & $-$0.01 \\ 
  & (0.002) & (0.004) & (0.01) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$NR_{i}$ & $-$0.01 & $-$0.004 & 0.02 \\ 
  & (0.01) & (0.04) & (0.08) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$Left_{i}$ & 0.004$^{**}$ & 0.01$^{**}$ & 0.02$^{***}$ \\ 
  & (0.001) & (0.005) & (0.01) \\ 
  & & & \\ 
 $R_{i}$*$Y_{i,t}^{2}$*$Right_{i}$ & $-$0.0003 & $-$0.003 & 0.01 \\ 
  & (0.001) & (0.003) & (0.01) \\ 
  & & & \\ 
 Constant & 0.05$^{***}$ & 0.22$^{***}$ & 0.42$^{***}$ \\ 
  & (0.01) & (0.03) & (0.05) \\ 
  & & & \\ 
\hline \\[-1.8ex] 
F Statistic & 20.67*** & 84.70*** & 39.09*** \\ 
Observations & 1,053 & 1,053 & 1,053 \\ 
R$^{2}$ & 0.28 & 0.56 & 0.44 \\ 
Adjusted R$^{2}$ & 0.25 & 0.54 & 0.42 \\ 
Residual Std. Error (df = 1002) & 0.08 & 0.16 & 0.26 \\ 
\hline 
\hline \\[-1.8ex] 
\textit{Note:}  & \multicolumn{3}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\ 
\end{tabular} 
\end{table}

我尝试过合并longtable,但对我来说不起作用。该表是使用stargazerR-Studio 中的包创建的,然后导入 Overleaf。有人遇到过类似的问题吗?这是 stargazer 的限制吗?如果是,我该如何克服它?

提前致谢!

答案1

这是使用环境的代码的改编版longtable。请注意,除了将table/tabular组合更改为之外,我还必须修复代码中的许多问题longtable。其中包括替换所有$*$with实例\times以及替换所有& & & \\with实例\addlinespace(包提供的宏)booktabs

下面的截图只显示了结果表的前几行。

在此处输入图片描述

\documentclass{article}
\usepackage{longtable,booktabs}
\newcommand{\vn}[1]{\mathit{#1}}

\begin{document}
   
\begin{longtable}{@{} l ccc @{}} 
\caption{Results for Living Standard Indicators} 
  \label{tab:results}\\
\toprule
 & \multicolumn{3}{c}{Dependent variables} \\ 
\cmidrule(l){2-4}
 & $K_{i,t}$ & $H_{i,t}$ & $I_{i,t}$ \\ 
 & Physical Capital & Human Capital & Instit.\ Capital \\ 
 & (1) & (2) & (3) \\ 
\midrule
\endfirsthead

\multicolumn{4}{@{}l}{Table \thetable, continued}\\
\addlinespace
\toprule
 & \multicolumn{3}{c}{Dependent variables} \\ 
\cmidrule(l){2-4}
 & $K_{i,t}$ & $H_{i,t}$ & $I_{i,t}$ \\ 
 & Physical Capital & Human Capital & Instit.\ Capital \\ 
 & (1) & (2) & (3) \\ 
\midrule
\endhead

\midrule
\endfoot

\bottomrule
\addlinespace
\multicolumn{4}{@{}l}{\textit{Note}: $^{*}\ p<0.1$; $^{**}\ p<0.05$; $^{***}\ p<0.01$} 
\endlastfoot

 $R_{i}$ & $-$0.10$^{***}$ & $-$0.05 & 0.08 \\ 
  & (0.02) & (0.04) & (0.08) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}$ & $-$0.002 & $-$0.01$^{**}$ & $-$0.01 \\ 
  & (0.002) & (0.004) & (0.01) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}$ & 0.13$^{*}$ & 0.69$^{***}$ & 0.22 \\ 
  & (0.07) & (0.18) & (0.42) \\ 
  \addlinespace 
 $R_{i}\times \vn{NR}_{i}$ & $-$0.50$^{***}$ & 0.18 & $-$0.98$^{*}$ \\ 
  & (0.09) & (0.23) & (0.56) \\ 
  \addlinespace 
 $R_{i}\times D_{i}$ & 0.01 & 0.05 & 0.11 \\ 
  & (0.02) & (0.04) & (0.08) \\ 
  \addlinespace 
 $R_{i}\times L_{i}$ & 0.0004 & $-$0.05 & $-$0.23$^{***}$ \\ 
  & (0.01) & (0.03) & (0.06) \\ 
  \addlinespace 
 $R_{i}\times V_{i}$ & 0.02$^{**}$ & $-$0.06$^{*}$ & $-$0.12$^{***}$ \\ 
  & (0.01) & (0.03) & (0.04) \\ 
  \addlinespace 
 $R_{i}\times C_{i}$ & 0.03$^{**}$ & $-$0.08$^{**}$ & $-$0.17$^{**}$ \\ 
  & (0.01) & (0.04) & (0.07) \\ 
  \addlinespace 
 $R_{i}\times M_{i}$ & $-$0.01 & $-$0.04$^{**}$ & 0.09$^{***}$ \\ 
  & (0.01) & (0.02) & (0.03) \\ 
  \addlinespace 
 $R_{i}\times S_{i}$ & 0.04$^{***}$ & 0.23$^{***}$ & 0.19$^{**}$ \\ 
  & (0.02) & (0.04) & (0.08) \\ 
  \addlinespace 
 $R_{i}\times \vn{Dem}_{i}$ & 0.05$^{***}$ & 0.07$^{***}$ & 0.07 \\ 
  & (0.02) & (0.02) & (0.05) \\ 
  \addlinespace 
 $R_{i}\times \vn{Right}_{i}$ & $-$0.02 & $-$0.03 & $-$0.20$^{*}$ \\ 
  & (0.02) & (0.05) & (0.10) \\ 
  \addlinespace 
 $R_{i}\times \vn{Left}_{i}$ & 0.02 & $-$0.03 & $-$0.08 \\ 
  & (0.01) & (0.05) & (0.07) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times L_{i}$ & $-$0.01 & $-$0.37$^{*}$ & $-$0.52 \\ 
  & (0.07) & (0.19) & (0.37) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times V_{i}$ & 0.001 & 0.51$^{***}$ & 0.18 \\ 
  & (0.05) & (0.12) & (0.22) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times C_{i}$ & $-$0.08 & $-$0.33$^{**}$ & $-$0.80$^{**}$ \\ 
  & (0.06) & (0.16) & (0.36) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times M_{i}$ & $-$0.01 & $-$0.17$^{**}$ & 0.14 \\ 
  & (0.03) & (0.08) & (0.16) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times S_{i}$ & $-$0.01 & $-$0.86$^{***}$ & 0.87$^{**}$ \\ 
  & (0.08) & (0.20) & (0.42) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times \vn{Dem}_{i}$ & 0.10$^{*}$ & $-$0.14 & 0.07 \\ 
  & (0.05) & (0.09) & (0.27) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times \vn{Left}_{i}$ & 0.02 & $-$0.67$^{***}$ & 0.31 \\ 
  & (0.05) & (0.20) & (0.29) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times \vn{Right}_{i}$ & 0.15$^{*}$ & 0.39 & 0.11 \\ 
  & (0.08) & (0.24) & (0.53) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times D_{i}$ & $-$0.29$^{***}$ & $-$0.35$^{**}$ & 0.59$^{*}$ \\ 
  & (0.07) & (0.16) & (0.32) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}\times \vn{NR}_{i}$ & 0.56 & 0.83 & 1.05 \\ 
  & (0.39) & (1.15) & (2.35) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times L_{i}$ & $-$0.002 & 0.003 & $-$0.02$^{*}$ \\ 
  & (0.002) & (0.005) & (0.01) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times V_{i}$ & $-$0.0001 & $-$0.004$^{*}$ & 0.004 \\ 
  & (0.001) & (0.002) & (0.004) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times C_{i}$ & 0.003$^{**}$ & 0.01$^{*}$ & 0.01$^{*}$ \\ 
  & (0.001) & (0.003) & (0.01) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times M_{i}$ & $-$0.001 & 0.003$^{*}$ & $-$0.001 \\ 
  & (0.001) & (0.002) & (0.004) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times S_{i}$ & $-$0.0005 & 0.01$^{***}$ & $-$0.01$^{**}$ \\ 
  & (0.002) & (0.003) & (0.01) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times \vn{Dem}_{i}$ & $-$0.001 & 0.001 & 0.01 \\ 
  & (0.001) & (0.002) & (0.01) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times D_{i}$ & 0.001 & 0.01 & $-$0.01 \\ 
  & (0.002) & (0.004) & (0.01) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times \vn{NR}_{i}$ & $-$0.01 & $-$0.004 & 0.02 \\ 
  & (0.01) & (0.04) & (0.08) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times \vn{Left}_{i}$ & 0.004$^{**}$ & 0.01$^{**}$ & 0.02$^{***}$ \\ 
  & (0.001) & (0.005) & (0.01) \\ 
  \addlinespace 
 $R_{i}\times Y_{i,t}^{2}\times \vn{Right}_{i}$ & $-$0.0003 & $-$0.003 & 0.01 \\ 
  & (0.001) & (0.003) & (0.01) \\ 
  \addlinespace 
 Constant & 0.05$^{***}$ & 0.22$^{***}$ & 0.42$^{***}$ \\ 
  & (0.01) & (0.03) & (0.05) \\ 
\midrule 
$F$-Statistic & 20.67$^{***}$ & 84.70$^{***}$ & 39.09$^{***}$ \\ 
Observations & 1,053 & 1,053 & 1,053 \\ 
$R^{2}$ & 0.28 & 0.56 & 0.44 \\ 
Adjusted $R^{2}$ & 0.25 & 0.54 & 0.42 \\ 
Res.\ Std.\ Error  & 0.08 & 0.16 & 0.26 \\ 
\quad ($\vn{df} = 1{,}002$)
\end{longtable} 
\end{document}

相关内容