2
\documentclass[12pt]{article} %
\linespread{1.5} % one-and-a-half spacing; 1.6 for double spacing
\usepackage{times}
\usepackage{lmodern}
\usepackage[margin=3cm]{geometry} % Ajusta margen hoja
\usepackage{float} % Permite opción float en Figures para las que querés fijar en una página
\usepackage{graphicx}
\usepackage{chngpage}  % Permite ajustar margenes para tablas específicas
\usepackage{geometry}
\usepackage[flushleft]{threeparttable}

\begin{document}

 \begin{table}[htbp]
        \centering
      \caption{Regressions with positive trade flows. Dependent variable: trade flows (log)}
        \scalebox{0.6}{
        \begin{tabular}{p{110}ccccccc}
        \toprule
              & (1)   & (2)   & (3)   & (4)   & (5)   & (6)   & (7) \\
                  \midrule
              &       &       &       &       &       &       &  \\
        GDP origin (log) & 1.027*** & 1.026*** & 1.017*** & 1.006*** & 1.031*** & 1.035*** & 1.025*** \\
              & (768.36) & (768.44) & (763.19) & (728.81) & (742.00) & (744.59) & (735.26) \\
              &       &       &       &       &       &       &  \\
        GDP destination (log) & 0.859*** & 0.858*** & 0.850*** & 0.850*** & 0.872*** & 0.876*** & 0.866*** \\
              & (672.51) & (672.43) & (667.15) & (641.06) & (654.84) & (657.39) & (647.66) \\
              &       &       &       &       &       &       &  \\
        Distance (log) & -1.218*** & -1.160*** & -1.049*** & -1.058*** & -1.027*** & -1.024*** & -1.021*** \\
              & (-359.45) & (-315.65) & (-268.14) & (-269.71) & (-263.32) & (-262.83) & (-263.03) \\
              &       &       &       &       &       &       &  \\
        1 for contiguity &       & 0.705*** & 0.674*** & 0.679*** & 0.496*** & 0.457*** & 0.433*** \\
              &       & (40.36) & (38.76) & (39.10) & (28.63) & (26.39) & (25.06) \\
              &       &       &       &       &       &       &  \\
        1 for free trade agreement in force &       &       & 1.137*** & 1.101*** & 1.073*** & 1.057*** & 1.074*** \\
              &       &       & (79.62) & (76.90) & (75.56) & (74.52) & (75.90) \\
              &       &       &       &       &       &       &  \\
        1 if origin is GATT/WTO &       &       &       & 0.210*** & 0.189*** & 0.193*** & 0.190*** \\
              &       &       &       & (31.70) & (28.70) & (29.41) & (29.07) \\
              &       &       &       &       &       &       &  \\
        1 if destination is GATT/WTO &       &       &       & 0.0428*** & 0.0210** & 0.0229*** & 0.0199** \\
              &       &       &       & (6.53) & (3.23) & (3.53) & (3.07) \\
              &       &       &       &       &       &       &  \\
        1 for common official of primary language &       &       &       &       & 0.782*** & 0.632*** & 0.549*** \\
              &       &       &       &       & (103.79) & (76.99) & (66.17) \\
              &       &       &       &       &       &       &  \\
        1 for common legal origin &       &       &       &       &       & 0.296*** & 0.263*** \\
              &       &       &       &       &       & (45.26) & (40.30) \\
              &       &       &       &       &       &       &  \\
        1 if current or past colonial link &       &       &       &       &       &       & 1.093*** \\
              &       &       &       &       &       &       & (60.30) \\
              &       &       &       &       &       &       &  \\
        Constant & -4.008*** & -4.525*** & -5.327*** & -5.274*** & -6.007*** & -6.176*** & -6.061*** \\
              & (-65.52) & (-72.48) & (-84.65) & (-83.84) & (-95.71) & (-98.38) & (-96.79) \\
              &       &       &       &       &       &       &  \\
            Year FE & Yes & Yes & Yes & Yes & Yes & Yes & Yes \\ 
            Observations & 624145 & 624145 & 624145 & 624145 & 624145 & 624145 & 624145 \\
            \bottomrule
        \end{tabular}}%
        \begin{tablenotes}
          \small
          \item Note: t statistics in parentheses.  * p$<$0.05  ** p$<$0.01 *** p$<$0.001
        \end{tablenotes}    
      \label{tab:tab1}%
    \end{table}%

\end{document}
  • 3
    you don't show the document class, so we don't know how wide the page might be. if the table is wider than the defined page width, it will not center. to make it possible to diagnose the problem, please provide a minimal compilable file, beginning with \documentclass and ending with \end{document}. then we won't need to rely on our oft-overused and inconsistent crystal balls., – barbara beeton Dec 1 '17 at 2:26
  • 2
    What does p{110} mean? I guess there is a unit missing like p{110mm}? – Mensch Dec 1 '17 at 2:34
2

Simply change \usepackage[flushleft]{threeparttable} to \usepackage{threeparttable}.

But there is still the problem with the line:

    \begin{tabular}{p{110}ccccccc} % <==================================110

Change it for example to

    \begin{tabular}{p{5cm}ccccccc} % <==================================110

Then your table is small enouph to be centered on the page as the following MWE shows:

\documentclass[12pt]{article} %

\linespread{1.5} % one-and-a-half spacing; 1.6 for double spacing
\usepackage{times}
\usepackage{lmodern}

\usepackage[margin=3cm]{geometry} % Ajusta margen hoja
\usepackage{float} % Permite opción float en Figures para las que querés fijar en una página
\usepackage{graphicx}
\usepackage{chngpage}  % Permite ajustar margenes para tablas específicas

%\usepackage[flushleft]{threeparttable}
\usepackage{threeparttable} % <=========================================

\usepackage{booktabs} % <===============================================


\begin{document}

\begin{table}[htbp]
    \centering
  \caption{Regressions with positive trade flows. Dependent variable: trade flows (log)}
    \label{tab:tab1}%
    \scalebox{0.6}{
    \begin{tabular}{p{5cm}ccccccc} % <==================================110
    \toprule
          & (1)   & (2)   & (3)   & (4)   & (5)   & (6)   & (7) \\
              \midrule
          &       &       &       &       &       &       &  \\
    GDP origin (log) & 1.027*** & 1.026*** & 1.017*** & 1.006*** & 1.031*** & 1.035*** & 1.025*** \\
          & (768.36) & (768.44) & (763.19) & (728.81) & (742.00) & (744.59) & (735.26) \\
          &       &       &       &       &       &       &  \\
    GDP destination (log) & 0.859*** & 0.858*** & 0.850*** & 0.850*** & 0.872*** & 0.876*** & 0.866*** \\
          & (672.51) & (672.43) & (667.15) & (641.06) & (654.84) & (657.39) & (647.66) \\
          &       &       &       &       &       &       &  \\
    Distance (log) & -1.218*** & -1.160*** & -1.049*** & -1.058*** & -1.027*** & -1.024*** & -1.021*** \\
          & (-359.45) & (-315.65) & (-268.14) & (-269.71) & (-263.32) & (-262.83) & (-263.03) \\
          &       &       &       &       &       &       &  \\
    1 for contiguity &       & 0.705*** & 0.674*** & 0.679*** & 0.496*** & 0.457*** & 0.433*** \\
          &       & (40.36) & (38.76) & (39.10) & (28.63) & (26.39) & (25.06) \\
          &       &       &       &       &       &       &  \\
    1 for free trade agreement in force &       &       & 1.137*** & 1.101*** & 1.073*** & 1.057*** & 1.074*** \\
          &       &       & (79.62) & (76.90) & (75.56) & (74.52) & (75.90) \\
          &       &       &       &       &       &       &  \\
    1 if origin is GATT/WTO &       &       &       & 0.210*** & 0.189*** & 0.193*** & 0.190*** \\
          &       &       &       & (31.70) & (28.70) & (29.41) & (29.07) \\
          &       &       &       &       &       &       &  \\
    1 if destination is GATT/WTO &       &       &       & 0.0428*** & 0.0210** & 0.0229*** & 0.0199** \\
          &       &       &       & (6.53) & (3.23) & (3.53) & (3.07) \\
          &       &       &       &       &       &       &  \\
    1 for common official of primary language &       &       &       &       & 0.782*** & 0.632*** & 0.549*** \\
          &       &       &       &       & (103.79) & (76.99) & (66.17) \\
          &       &       &       &       &       &       &  \\
    1 for common legal origin &       &       &       &       &       & 0.296*** & 0.263*** \\
          &       &       &       &       &       & (45.26) & (40.30) \\
          &       &       &       &       &       &       &  \\
    1 if current or past colonial link &       &       &       &       &       &       & 1.093*** \\
          &       &       &       &       &       &       & (60.30) \\
          &       &       &       &       &       &       &  \\
    Constant & -4.008*** & -4.525*** & -5.327*** & -5.274*** & -6.007*** & -6.176*** & -6.061*** \\
          & (-65.52) & (-72.48) & (-84.65) & (-83.84) & (-95.71) & (-98.38) & (-96.79) \\
          &       &       &       &       &       &       &  \\
        Year FE & Yes & Yes & Yes & Yes & Yes & Yes & Yes \\ 
        Observations & 624145 & 624145 & 624145 & 624145 & 624145 & 624145 & 624145 \\
        \bottomrule
    \end{tabular}}%
    \begin{tablenotes}
      \small
      \item Note: t statistics in parentheses.  * p$<$0.05  ** p$<$0.01 *** p$<$0.001
    \end{tablenotes}    
\end{table}%

\end{document}

with the result:

enter image description here

I suggest to not use \scalebox{0.6} for the table, if possible ...

Please see that I moved the command \label after command \caption where it belongs ... And I added the missing package booktabs to the MWE.

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.