1

Could anyone please help me find out why I can't get a table similar to the one I'm pasting in the following lines, with the following code? I'm not very experienced in LaTeX and I'm getting frustrated because I can't see where's my error. Thank you!! enter image description here

\newpage
**\appendix
\chapter{Appendix A: Detailed Regression Results}
\begin{singlespace}
\noindent\textbf{Table 4: Estimation Results of PROCAMPO Capitalization}
\vspace{-5mm}
\begin{center}
\begin{table}[ht]
\centering % used for centering table
\begin{adjustbox}{width=\textwidth,totalheight=\paperheight,keepaspectratio}
\begin{tabular}{|c||l|l|l||l|l|l|}
\hline\hline %inserts double horizontal lines
\multirow{4}{*}{Dependent Variable\: Average Rent per Ha (in logs)} 
      & \multicolumn{5}{c||}{OLS Estimates With Regional Fixed Effects} 
        & \multicolumn{1}{|c|}{Heckman Estimates With Regional Fixed Effects} \\      \cline{2-6}
  & MAIN SPECIFICATION & ALTERNATIVE $1$ & ALTERNATIVE $2$ & ALTERNATIVE $3$ & ALTERNATIVE $4$ \\  \hline {PROCAMPO per Ha (logs)}&0.0012&0.0023&0.0021&0.00077&0.028&&-0.0071\\
  &[0.0099]&[0.0100]&[0.0097]&[0.0098]&[0.030]&&[0.011]\\
  Adjusted Heckman Estimate&&&&&&&0.114\\
  &&&&&&&\\
  Income Stratum 2 (Family subsistence with linkage to the market)&0.46^{**}&0.45^{**}&0.46^{**}&0.46^{**}&0.40^{**}&&0.46^{**}\\
  &[0.17]&[0.18]&[0.18]&[0.18]&[0.17]&&[0.18]\\
  Income Stratum 3 (In transition)&0.78^{***}&0.76^{***}&0.78^{***}&0.80^{***}&0.69^{***}&&0.79^{***}\\
  &[0.24]&[0.23]&[0.23]&[0.23]&[0.22]&&[0.24]\\[1ex]
\hline\hline %inserts double horizontal lines
\end{tabular}
\end{adjustbox}
\label{table:nonlin} % is used to refer this table in the text
\end{table}
\vspace{-3mm}
\begin{flushleft}
{\tiny\tiny Note: All the variables that are not categorical are included in logs. All the regional fixed effects are significant and negative, the more negative magnitude belonging to the Southern region, everything with respect to the Northern region. Please refer to the Appendix A to see the detailed results of the regression. Heteroskedasticity-robust standard errors are in brackets. *10\% significance, **5\% significance, ***1\% significance.\par}
\end{flushleft}
\end{center}
\end{singlespace}
\vspace{.75cm}
  • 3
    welcome to tex.se!. float table had not to be inside \begin{center} ... end{center}. why you not use `caption{for table caption? your table is really huge ... and please help us to help you and extend your code sniped to complete small document, which we can copy and test – Zarko Aug 27 '17 at 23:37
  • some errors: \: can be only in math environment, similarly all numbers following by ^{*..}. number of declared columns and used are not the same, this cause bunch of errors. you should carefully check your table and correct this discrepancies. – Zarko Aug 27 '17 at 23:47
  • Thank you very much, Zarko! I'll upload a short version of this table in a while, but I appreciate a lot your guidance! – Ariadna Aug 28 '17 at 0:22
  • Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See minimal working example (MWE). – Henri Menke Aug 28 '17 at 1:37
1

Some progress can be made by shortening some of the header cells.

enter image description here

\documentclass{report} % some document class that provides "\chapter" command
\usepackage{setspace,booktabs,array,graphicx,dcolumn,ragged2e}
\newcolumntype{d}[1]{D..{#1}}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcommand\mc[1]{\multicolumn{1}{@{}c@{}}{#1}}
\begin{document}
\newpage
**\appendix
\chapter{Detailed Regression Results}
\begin{singlespace}
\noindent\textbf{Table 4: Estimation Results of PROCAMPO Capitalization}

\smallskip\noindent
\resizebox{\textwidth}{!}{%
\begin{tabular}{@{} >{\raggedright}p{5.2cm} 
                    *{6}{d{2.5}} @{}}
\toprule
Dependent Variable: Average Rent per Ha (in logs)
& \multicolumn{5}{c}{OLS Estimates with Regional Fixed Effects} 
& \multicolumn{1}{@{}P{2.5cm}@{}}{Heckman Estimates with Regional Fixed Effects} \\      
\cmidrule(lr){2-6}
& \mc{Main} & \mc{Alt.\ 1} & \mc{Alt.\ 2} & \mc{Alt.\ 3} & \mc{Alt.\ 4} &\\  
\midrule 
PROCAMPO per Ha (logs)
&0.0012&0.0023&0.0021&0.00077&0.028&-0.0071\\
&[0.0099]&[0.0100]&[0.0097]&[0.0098]&[0.030]&[0.011]\\
  Adjusted Heckman Estimate&&&&&& 0.114\\ 
  \addlinespace
  Income Stratum 2 (Family subsis-&0.46^{**}&0.45^{**}&0.46^{**}&0.46^{**}
  &0.40^{**}&0.46^{**}\\
  tence with linkage to the market)&[0.17]&[0.18]&[0.18]&[0.18]&[0.17]&[0.18]\\ 
  \addlinespace
  Income Stratum 3 (In transition)&0.78^{***}&0.76^{***}&0.78^{***}&0.80^{***}&0.69^{***}&0.79^{***}\\
  &[0.24]&[0.23]&[0.23]&[0.23]&[0.22]&[0.24]\\
\bottomrule
\end{tabular}}

\smallskip
\RaggedRight\scriptsize
Notes: All  variables that are not categorical are included in logs. All the regional fixed effects are significant and negative, the more negative magnitude belonging to the Southern region, everything with respect to the Northern region. Please see Appendix~A for the detailed results of the regression. Heteroskedasticity-robust standard errors are in brackets. *\,10\% significance, **\,5\% significance, ***\,1\% significance.

\end{singlespace}
\end{document}
| improve this answer | |
  • I see that I never replied to this great help. Thank you so much, Mico, this is very helpful for me, and I would vote for your reply if I had the privileges to do that but I still don't have the sufficient badges to like a comment. THANK YOU! – Ariadna Nov 6 '17 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.