表格代码:
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{4}{c}}
\toprule
&\multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} &\multicolumn{1}{c}{(3)} &\multicolumn{1}{c}{(4)} \\
\midrule
tt\_tn & -0.043 & -0.044 & -0.042 & \\
& [0.051] & [0.046] & [0.049] & \\
\addlinespace
tt\_ntn & -0.015 & -0.016 & -0.010 & \\
& [0.051] & [0.048] & [0.050] & \\
\addlinespace
sp & 0.002 & & & \\
& [0.039] & & & \\
\addlinespace
Household Treatment& & & & 0.016\sym{**} \\
& & & & [0.008] \\
\midrule
Control Mean & 0.347 & 0.101 & 0.360 & 0.012 \\
P-Value & 0.650 & 0.650 & 0.629 & \\
Baseline Intercropping& Y & Y & Y & Y \\
Clustered at Village-Level& Y & Y & Y & N \\
R-Squared & .119 & .119 & .136 & .05 \\
Observations & 982 & 982 & 815 & 689 \\
\bottomrule
\multicolumn{5}{l}{\footnotesize Standard errors in brackets}\\
\multicolumn{5}{l}{\footnotesize \footnotesize{Note: Standard errors clustered at the village level (reported in brackets).}}\\
\multicolumn{5}{l}{\footnotesize \footnotesize{\phantom{Note: }Column (1)-(3) outcome is intercropping on any farm}\\
\multicolumn{5}{l}{\footnotesize \footnotesize{\phantom{Note: }Column (4) outcome is intercropping on NERICA farm}\\
\multicolumn{5}{l}{\footnotesize \footnotesize{\phantom{Note: }Upland (HH Level) and District*Upland (Village level) fixed effects included.}}\\
\multicolumn{5}{l}{\footnotesize \footnotesize{\phantom{Note: }This sample excludes the ROK treatment group}}\\
\multicolumn{5}{l}{\footnotesize \sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)}\\
\end{tabular}
}
这是使用 Stata 生成的。
将此表循环到 Tex 的代码:
\thispagestyle{empty}
\begin{center}
\large{Table1. Cassava} \\
\bigskip
\small{\input{table_ic_cassava.tex}}
\end{center}
任何关于哪里可以找到错误的帮助都非常好!谢谢。
答案1
这就是你想要的吗?经过我的调试,似乎在第 34 行和第 35 行的末尾都缺少一个 }。
代码
\documentclass[border=10pt]{standalone}
\usepackage{booktabs}
\begin{document}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{tabular}{l*{4}{c}}
\toprule
&\multicolumn{1}{c}{(1)} &\multicolumn{1}{c}{(2)} &\multicolumn{1}{c}{(3)} &\multicolumn{1}{c}{(4)} \\
\midrule
tt\_tn & -0.043 & -0.044 & -0.042 & \\
& [0.051] & [0.046] & [0.049] & \\
\addlinespace
tt\_ntn & -0.015 & -0.016 & -0.010 & \\
& [0.051] & [0.048] & [0.050] & \\
\addlinespace
sp & 0.002 & & & \\
& [0.039] & & & \\
\addlinespace
Household Treatment& & & & 0.016\sym{**} \\
& & & & [0.008] \\
\midrule
Control Mean & 0.347 & 0.101 & 0.360 & 0.012 \\
P-Value & 0.650 & 0.650 & 0.629 & \\
Baseline Intercropping& Y & Y & Y & Y \\
Clustered at Village-Level& Y & Y & Y & N \\
R-Squared & .119 & .119 & .136 & .05 \\
Observations & 982 & 982 & 815 & 689 \\
\bottomrule
\multicolumn{5}{l}{\footnotesize Standard errors in brackets}\\
\multicolumn{5}{l}{\footnotesize{Note: Standard errors clustered at the village level (reported in brackets).}}\\
\multicolumn{5}{l}{\footnotesize{\phantom{Note: }Column (1)-(3) outcome is intercropping on any farm}}\\ %< ---
\multicolumn{5}{l}{ \footnotesize{\phantom{Note: }Column (4) outcome is intercropping on NERICA farm}}\\
\multicolumn{5}{l}{ \footnotesize{\phantom{Note: }Upland (HH Level) and District*Upland (Village level) fixed effects included.}}\\
\multicolumn{5}{l}{\footnotesize{\phantom{Note: }This sample excludes the ROK treatment group}}\\
\multicolumn{5}{l}{\footnotesize \sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)}\\
\end{tabular}
}
\end{document}