自动生成的表格中出现“放错 \omit”错误

自动生成的表格中出现“放错 \omit”错误

首先,我读过 Werner 的回答“!放错\omit”错误但我的问题还没有解决。

几天前,我制作了一个与下面非常相似的表格,只是少了一行和一列。没有问题。现在我收到错误。这个怪物是使用 esttab 创建的,esttab 是一个将 STATA 回归表导出到 latex 的工具。

我的序言的相关部分:

%---------TABLES---------
\usepackage{booktabs}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{multirow}
\usepackage{subcaption}
\usepackage{rotating}
%indents in tables (custom command)
\newcommand*{\TableIndent}{\hspace*{0.5cm}}
%-------END TABLES--------

%---- This is a crazy patch to make sure that tabu works with threeparttable %
\usepackage{etoolbox}
\makeatletter
\chardef\TPT@@@asteriskcatcode=\catcode`*
\catcode`*=11
\expandafter\patchcmd\csname\string\threeparttable\endcsname
  {\TPT@hookin{tabular}}
  {\TPT@hookin{tabular}\TPT@hookin{tabu}}
  {}{}
\catcode`*=\TPT@@@asteriskcatcode
\makeatother
%-----END TABLES-----%

桌子:

\begin{sidewaystable}[!H]{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\centering
\caption{Incidence Rate Ratios of job separation on 2004 self--reported willingness to take risks in general}
\resizebox{0.80\textwidth}{!}{%
\label{tab5}
\begin{tabular}{l*{12}{l}}
\toprule
          &  \multicolumn{6}{c}{Poisson estimates} & & \multicolumn{5}{c}{Negative Binomial estimates} \\ \cmidrule(l){2-7} \cmidrule(l){9-13}
          &\multicolumn{1}{l}{(1)}&\multicolumn{1}{l}{(2)}&\multicolumn{1}{l}{(3)}&\multicolumn{1}{l}{(4)}&\multicolumn{1}{l}{(5)} &\multicolumn{1}{l}{(6)}&$\qquad$&\multicolumn{1}{l}{(7)}&\multicolumn{1}{l}{(8)}&\multicolumn{1}{l}{(9)}&\multicolumn{1}{l}{(10)}\multicolumn{1}{l}{(11)}\\
\midrule

Self--reported willingness to take risks in general&    1.046\sym{*}  &    1.029         &    1.030         &    1.037         &    1.037\sym{*}  &    1.043\sym{*}  & &    1.046\sym{*}  &    1.029         &    1.030         &    1.037         &    1.037\sym{*}  \\
                &  (0.022)         &  (0.020)         &  (0.021)         &  (0.022)         &  (0.019)         &  (0.021) &        &  (0.022)         &  (0.020)         &  (0.021)         &  (0.022)         &  (0.019)         \\
\addlinespace
Time tracked in sample     &                  &    1.359\sym{***}&    1.403\sym{***}&    1.404\sym{***}&    1.476\sym{***}&    1.513\sym{***}&    &              &    1.359\sym{***}&    1.403\sym{***}&    1.404\sym{***}&    1.476\sym{***}\\
                &                  &  (0.027)         &  (0.030)         &  (0.029)         &  (0.030)         &  (0.033)  &       &                  &  (0.027)         &  (0.030)         &  (0.029)         &  (0.030)         \\
\addlinespace
Education (\textsc{casmin})\textdagger&     &             &                  &                 &                 &                  &                 &                  &                  &                 &                 &                  \\
\addlinespace
1. Inadequately Completed&                  &                  &    1.453         &    1.556\sym{*}  &                  &   1.153         & &                 &                  &    1.453         &    1.557\sym{*}  &                  \\
                &                  &                  &  (0.291)         &  (0.323)         &                  &  (0.264)         &                  &                  &  (0.291)         &  (0.323)         &                  \\
\addlinespace
2. General Elementary School&                  &                  &    0.696\sym{*}  &    0.727\sym{*}  &                  &    0.644\sym{**} &  &                &                  &    0.696\sym{*}  &    0.727\sym{*}  &                  \\
                &                  &                  &  (0.107)         &  (0.113)         &                  &  (0.099) &         &                  &                  &  (0.107)         &  (0.113)         &                  \\
\addlinespace
4. Intermediate General Qualification&                  &                  &    0.725\sym{**} &    0.721\sym{**} &                  &    0.762\sym{*}  & &                 &                  &    0.725\sym{**} &    0.721\sym{**} &                  \\
                &                  &                  &  (0.089)         &  (0.089)         &                  &  (0.087) &        &                  &                  &  (0.089)         &  (0.089)         &                  \\
\addlinespace
5. Intermediate Vocational&                  &                  &    0.573         &    0.600         &                  &    0.570       &  &                  &                  &    0.573         &    0.600         &                  \\
                &                  &                  &  (0.232)         &  (0.259)         &                  &  (0.169) &        &                  &                  &  (0.232)         &  (0.259)         &                  \\
\addlinespace
6. General Maturity Certificate&                  &                  &    0.877         &    0.908         &                  &    0.940       &  &                  &                  &    0.877         &    0.908         &                  \\
                &                  &                  &  (0.094)         &  (0.132)         &                  &  (0.111)  &       &                  &                  &  (0.094)         &  (0.132)         &                  \\
\addlinespace
7. Vocational Maturity Certificate&                  &                  &    0.629\sym{*}  &    0.662         &                  &    0.608\sym{*} & &                  &                  &    0.629\sym{*}  &    0.662         &                  \\
                &                  &                  &  (0.146)         &  (0.182)         &                  &  (0.144) &        &                  &                  &  (0.146)         &  (0.182)         &                  \\
\addlinespace
8. Lower Tertiary Education&                  &                  &    0.134\sym{*}  &    0.153\sym{*}  &                  &    0.254      &   &                  &                  &    0.134\sym{*}  &    0.153\sym{*}  &                  \\
                &                  &                  &  (0.109)         &  (0.127)         &                  &  (0.187) &        &                  &                  &  (0.109)         &  (0.127)         &                  \\
\addlinespace
9. Higher Tertiary Education&                  &                  &    0.671         &    0.780         &                  &    0.924     &    &                  &                  &    0.671         &    0.780         &                  \\
                &                  &                  &  (0.213)         &  (0.295)         &                  &  (0.223) &        &                  &                  &  (0.213)         &  (0.295)         &                  \\
\addlinespace
Male          &                  &                  &                  &    0.826\sym{*}  &                  &    0.899   &      &                  &                  &                  &    0.826\sym{*}  &                  \\
                &                  &                  &                  &  (0.071)         &                  &  (0.071) &        &                  &                  &                  &  (0.071)         &                  \\
\addlinespace
Age             &                  &                  &                  &    0.987         &                  &    1.005 &        &                  &                  &                  &    0.987         &                  \\
                &                  &                  &                  &  (0.019)         &                  &  (0.012) &        &                  &                  &                  &  (0.019)         &                  \\
\addlinespace
Average job duration&                  &                  &                  &                  &    0.719\sym{***}&    0.725\sym{***}& &                  &                  &                  &                  &    0.719\sym{***}\\
                &                  &                  &                  &                  &  (0.021)         &  (0.022) &        &                  &                  &                  &                  &  (0.021)         \\
\addlinespace
Total unemployment in years during 2004-2012&                  &                  &                  &                  &    0.885\sym{**} &    0.919  &       &                  &                  &                  &                  &    0.885\sym{**} \\
                &                  &                  &                  &                  &  (0.041)         &  (0.042) &        &                  &                  &                  &                  &  (0.041)         \\
\addlinespace
Intercept        &    0.628\sym{***}&   0.0962\sym{***}&   0.0912\sym{***}&    0.122\sym{***}&    0.108\sym{***}&   0.0946\sym{***}& &    0.628\sym{***}&   0.0962\sym{***}&   0.0912\sym{***}&    0.122\sym{***}&    0.108\sym{***}\\
                &  (0.080)         &  (0.017)         &  (0.018)         &  (0.051)         &  (0.018)         &  (0.029)   &      &  (0.080)         &  (0.017)         &  (0.018)         &  (0.051)         &  (0.018)         \\
\midrule
Log pseudolikelihood         &        -796         &    -690              &     -599             &      -598    &       -634       &    -554          &              &                  &                  &                  &                  \\
$\alpha_i$        &                  &                  &                  &                  &                  &                  &    0.185\sym{***} & 0.255e-06\sym{***} & 0.118e-6\sym{***} & 6.36e-08\sym{***}& 7.66e-08\sym{***}\\
                &                  &                  &                  &                  &                  &                  &  (0.082)         &  (0.000)         &  (0.000)         &  (0.000)         &  (0.000)         \\
\midrule
$N$    &      659         &      659         &      595         &      595         &      659         &      595         &      659         &      659         &      595         &      595         &      659         \\
\bottomrule
\multicolumn{13}{l}{\footnotesize\emph{Notes:} Robust Standard errors in parentheses.}\\
\multicolumn{13}{l}{\footnotesize \sym{*} $p<0.05$, \sym{**} $p<0.01$, \sym{***} $p<0.001$.}\\
\multicolumn{13}{l}{\footnotesize \textdagger Omitted base category is CASMIN classification 0: ``In school''. CASMIN classification 3. ``Basic vocational qualification'' has been dropped due to the low number of respondents (2).}\\
\end{tabular}%
}
}
\end{sidewaystable}

我得到的错误是

Error in thesis.tex (line 351): Misplaced \omit.
\multispan ->\omit \@multispan l.351 } I expect to see \omit only after tab marks 
or the \cr of an alignment. Proceed, and I'll ignore this case. 

第 351 行位于表格末尾:

\end{tabular}%
}    <<< This is line 351
}
\end{sidewaystable}

一切都呈现良好并且看起来很棒,但我真的讨厌创建有错误的文档。

答案1

&第二个标题行缺少A :

\multicolumn{1}{l}{(10)}\multicolumn{1}{l}{(11)}\\

看起来,应该

\multicolumn{1}{l}{(10)}&\multicolumn{1}{l}{(11)}\\

当然可以对输入做几项改进,但主要问题就在那一个。

使用“分而治之”的方法:我注释掉表格中的所有行,然后开始逐行取消注释,直到出现错误。然后我就知道哪一行是罪魁祸首,并找出原因。

相关内容