在一个表中堆叠多个输出时出错

在一个表中堆叠多个输出时出错

我正在尝试生成 3 个回归输出面板,如下所示https://medium.com/@linglp/nice-regression-tables-in-stata-17d3895befd2在 stata 中运行回归分析后。我完全按照上面的链接所示执行代码。然而,在编译时我得到了错误

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.83 \begin{table}[htbp]\centering \\
                                      \def\sym#1{\ifmode^{#1}\else\(^{#1}\)\...

? 

以下是 MWE:

\documentclass[12pt]{report}
\usepackage{titling}
\usepackage[utf8]{inputenc}
\usepackage{setspace} \doublespacing 
\usepackage{caption}
\usepackage[margin=1in]{geometry}
\usepackage{booktabs,makecell,longtable}
\begin{document}

\begin{table}[htbp]\centering \\ \def\sym#1{\ifmode^{#1}\else\(^{#1}\)\fi} \\ \caption{title} \\ \begin{tabular}{l*{3}{c}} \hline\hline
            &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}\\
            &\multicolumn{1}{c}{y1}&\multicolumn{1}{c}{y2}&\multicolumn{1}{c}{y3}\\
\hline \\ \multicolumn{3}{c}{\textbf{Panel A}} \\\\[-1ex]
1.treatment&       0.122\sym{***}&      -0.216\sym{***}&       1.406\sym{***}\\
            &     (0.006)         &     (0.007)         &     (0.046)         \\
[1em]
1.after&      -0.005         &       0.033\sym{**} &       0.406\sym{***}\\
            &     (0.009)         &     (0.012)         &     (0.063)         \\
[1em]
1.treatment\#1.after&       0.055\sym{***}&      -0.085\sym{***}&      -0.549\sym{***}\\
            &     (0.008)         &     (0.008)         &     (0.057)         \\
[1em]
\_cons      &       0.105\sym{***}&       0.492\sym{***}&       5.769\sym{***}\\
            &     (0.008)         &     (0.010)         &     (0.061)         \\
\hline
R-squared   &       0.198         &       0.108         &       0.095         \\
No. of observations&     1.4e+05         &     1.4e+05         &     6.8e+04         \\
fixed effect1&         Yes         &         Yes         &         Yes         \\
fixed effect2&         Yes         &         Yes         &         Yes         \\
Control variables&         Yes         &         Yes         &         Yes         \\
\hline \\ \multicolumn{3}{c}{\textbf{Panel B}} \\\\[-1ex]
1.treatment2&       0.170\sym{***}&      -0.103\sym{***}&       1.064\sym{***}\\
            &     (0.021)         &     (0.021)         &     (0.113)         \\
[1em]
1.after&       0.012         &       0.056\sym{*}  &       0.305\sym{*}  \\
            &     (0.017)         &     (0.023)         &     (0.150)         \\
[1em]
1.treatment2\#1.after&       0.074\sym{***}&      -0.123\sym{***}&      -0.253\sym{**} \\
            &     (0.012)         &     (0.013)         &     (0.091)         \\
[1em]
\_cons      &       0.034\sym{*}  &       0.316\sym{***}&       6.599\sym{***}\\
            &     (0.017)         &     (0.022)         &     (0.143)         \\
\hline
R-squared   &       0.212         &       0.128         &       0.128         \\
No. of observations&     2.5e+04         &     2.5e+04         &     1.3e+04         \\
fixed effect1&         Yes         &         Yes         &         Yes         \\
fixed effect2&         Yes         &         Yes         &         Yes         \\
Control variables&         Yes         &         Yes         &         Yes         \\
\hline \\ \multicolumn{3}{c}{\textbf{Panel C}} \\\\[-1ex]
1.treatment3&       0.170\sym{***}&      -0.103\sym{***}&       1.064\sym{***}\\
            &     (0.021)         &     (0.021)         &     (0.113)         \\
[1em]
1.after&       0.012         &       0.056\sym{*}  &       0.305\sym{*}  \\
            &     (0.017)         &     (0.023)         &     (0.150)         \\
[1em]
1.treatment3\#1.after&       0.074\sym{***}&      -0.123\sym{***}&      -0.253\sym{**} \\
            &     (0.012)         &     (0.013)         &     (0.091)         \\
[1em]
\_cons      &       0.034\sym{*}  &       0.316\sym{***}&       6.599\sym{***}\\
            &     (0.017)         &     (0.022)         &     (0.143)         \\
\hline
R-squared   &       0.212         &       0.128         &       0.128         \\
No. of observations&     2.5e+04         &     2.5e+04         &     1.3e+04         \\
fixed effect1&         Yes         &         Yes         &         Yes         \\
fixed effect2&         Yes         &         Yes         &         Yes         \\
Control variables&         Yes         &         Yes         &         Yes         \\
\hline\hline \multicolumn{6}{l}{\footnotesize Standard errors in parentheses}\\\multicolumn{2}{l}{footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***}\(p<0.001\)}\\ \end{tabular}\\ \end{table}
\end{document}


如能得到任何帮助我将非常感激,谢谢!

相关内容