2

I have the following table with environment threeparttable which can't fit on one page. I was pretty happy with all my LaTeX code and would really appreciate a solution where I don't need to change the interior of the table or write all the numbers again.

\documentclass[11pt]{article}

\usepackage{longtable}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage{booktabs, caption}
\usepackage[flushleft]{threeparttable}
\usepackage{tabularx}
\DeclareMathOperator*{\plim}{plim}
\begin{document}


\title{title}
\author{Author}
\date{\today}
\maketitle

    \begin{table}[p]
    \centering
      \begin{threeparttable}
        \caption{Pooled OLS and Fixed effects estimation on the initial model (eq. 1)}
         \begin{tabular}{llllll}
            \toprule
           \(Dependent variable: \Delta H_{it}\)  & \( Initial\ POLS \) & \( Initial\ FE \) & \ \\
            \midrule
                \\
    $Male$ & -.00154*** &  & &  &  \\
           & (.00033) &&&& \\
    $Age$ & .00195*** & .00094 &  &  &  \\
    & (.00069) & (.00113) &&& \\
    $Age^{2}$ & -.00002*** & -.00002*** &  &  &  \\
    & (.00000) & (.00000) &&& \\
    $Black$ & .00180*** &  &  & &  \\
    & (.00052) &&&& \\
    $Hispanic$ & .00095 &  &  & &  \\
    & (.00068) &&&& \\
    $Married/partner$ & -.00069*** & -.00357*** &  &  &  \\
    & (.00043) & (.00127) &&& \\
    $log(assets)$ & .00055*** & .00031* & 0.362 & 0 & 1 \\
    & (.00008) &(.00017) &&& \\
    $log(debt)$ & -.00016*** & -.00006 & 0.245 & 0 & 1 \\
    & (.00005) & (.00008)&&& \\
    $Some highschool$ & .00146** & &  &  &  \\
    & (.00063) &&&& \\
    $Highschool (GED)$ & .00120** &  &  & &  \\
    & (.00057) &&&& \\
    $AA$ & .00122 &  &  &  &  \\
    & (.00084) &&&& \\
    $Bachelor degree$ & .00228*** &  &  & &  \\
    & (.00067) &&&& \\
    $Graduate degree$ & .00287*** &  &  &  & \\
    & (.00067) &&&& \\
    $RS_{it}$* & -.00884*** & -.00717*** &  &  &  \\
    & (.00101) & (.00112) &&& \\
    $RL_{it}$ & -.00014 & .00135 &  &  &  \\
    & (.00051) & (.00089) &&& \\
    $Constant$ & -.07498*** & -.00814 &  & &  \\
    & (.02142) & (.04949) &&& \\
    \\
    $time$ & &  &  &  &  \\
    3 & .00209* & .00369* &  &  &  \\
    & (.00051) & (.00193) &&& \\
    4 & -.00717 & -.00398 &  &  &  \\
    & (.00104) & (.00323) &&& \\
    5 & .004299*** & .00950** &  &  &  \\
    & (.00097) & (.00468) &&& \\
    6 & -.00268*** & .00476 &  & &  \\
    & (.00100) & (.00636) &&& \\
    7 & -.00348*** & .00602 &  & & \\
    & (.00104) & (.00787) &&& \\
    8 & -.00000 & .01158 &  &  &  \\
    & (.00091) & (.00949) &&& \\
    9 & -.00327*** & .01006 &  &  &  \\
    & (.00095) & (.01099) &&& \\
    10 & -.00154 & .01719 &  &  &  \\
    & (.00100) & (.01278) &&& \\

                  \end{tabular}
               \begin{tablenotes}
            \small
          \item Notes:
          \item *: dummy variable estimates refer to sample                     proportions rather than averages
          \item A: Originally 1 - excellent, 2 - very good, 3 - good, 4 - fair, 5 - poor. Probit estimations did not work so I rescaled to 0 - poor, 0.25 - fair, 0.5 - good, 0.75 - very good, 1 - excellent
          \item B: See section 3.2
       \end{tablenotes}
     \end{threeparttable}
    \end{table}
end{document}

I also tried this:

\documentclass[11pt]{article}

    \usepackage{longtable}
    \usepackage{amsmath}
    \usepackage[T1]{fontenc}
    \usepackage{booktabs, caption}
    \usepackage[flushleft]{threeparttable}
    \usepackage{tabularx}
    \DeclareMathOperator*{\plim}{plim}
    \begin{document}


    \title{title}
    \author{Author}
    \date{\today}
    \maketitle


        \begin{center}
        \begin{longtable}{|c|c|c|c|}

        \hline
        \textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\
        \hline
        \endfirsthead
        \multicolumn{4}{c}%
        {\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
        \hline
        \textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\
        \hline
        \endhead
        \hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
        \endfoot
        \hline
        \endlastfoot

          \begin{threeparttable}
            \caption{Pooled OLS and Fixed effects estimation on the initial model (eq. 1)}
             \begin{tabular}{llllll}
                \toprule
               \(Dependent variable: \Delta H_{it}\)  & \( Initial\ POLS \) & \( Initial\ FE \) & \ \\
                \midrule

                  \\
        $Male$ & -.00154*** &  & &  &  \\
               & (.00033) &&&& \\
        $Age$ & .00195*** & .00094 &  &  &  \\
        & (.00069) & (.00113) &&& \\
        $Age^{2}$ & -.00002*** & -.00002*** &  &  &  \\
        & (.00000) & (.00000) &&& \\
        $Black$ & .00180*** &  &  & &  \\
        & (.00052) &&&& \\
        $Hispanic$ & .00095 &  &  & &  \\
        & (.00068) &&&& \\
        $Married/partner$ & -.00069*** & -.00357*** &  &  &  \\
        & (.00043) & (.00127) &&& \\
        $log(assets)$ & .00055*** & .00031* & 0.362 & 0 & 1 \\
        & (.00008) &(.00017) &&& \\
        $log(debt)$ & -.00016*** & -.00006 & 0.245 & 0 & 1 \\
        & (.00005) & (.00008)&&& \\
        $Some highschool$ & .00146** & &  &  &  \\
        & (.00063) &&&& \\
        $Highschool (GED)$ & .00120** &  &  & &  \\
        & (.00057) &&&& \\
        $AA$ & .00122 &  &  &  &  \\
        & (.00084) &&&& \\
        $Bachelor degree$ & .00228*** &  &  & &  \\
        & (.00067) &&&& \\
        $Graduate degree$ & .00287*** &  &  &  & \\
        & (.00067) &&&& \\
        $RS_{it}$* & -.00884*** & -.00717*** &  &  &  \\
        & (.00101) & (.00112) &&& \\
        $RL_{it}$ & -.00014 & .00135 &  &  &  \\
        & (.00051) & (.00089) &&& \\
        $Constant$ & -.07498*** & -.00814 &  & &  \\
        & (.02142) & (.04949) &&& \\
        \\
        $time$ & &  &  &  &  \\
        3 & .00209* & .00369* &  &  &  \\
        & (.00051) & (.00193) &&& \\
        4 & -.00717 & -.00398 &  &  &  \\
        & (.00104) & (.00323) &&& \\
        5 & .004299*** & .00950** &  &  &  \\
        & (.00097) & (.00468) &&& \\
        6 & -.00268*** & .00476 &  & &  \\
        & (.00100) & (.00636) &&& \\
        7 & -.00348*** & .00602 &  & & \\
        & (.00104) & (.00787) &&& \\
        8 & -.00000 & .01158 &  &  &  \\
        & (.00091) & (.00949) &&& \\
        9 & -.00327*** & .01006 &  &  &  \\
        & (.00095) & (.01099) &&& \\
        10 & -.00154 & .01719 &  &  &  \\
        & (.00100) & (.01278) &&& \\

                  \end{tabular}


                   \begin{tablenotes}
                \small
              \item Notes:
              \item *: dummy variable estimates refer to sample                     proportions rather than averages
              \item A: Originally 1 - excellent, 2 - very good, 3 - good, 4 - fair, 5 - poor. Probit estimations did not work so I rescaled to 0 - poor, 0.25 - fair, 0.5 - good, 0.75 - very good, 1 - excellent
              \item B: See section 3.2
           \end{tablenotes}
         \end{threeparttable}


        \end{longtable}
        \end{center}

    \end{document}
  • Please add a preamble with the necessary packages and beginning with \documentclass and ending with \end{document}. – Bernard Apr 18 at 18:00
  • 1
    unrelated but never use math italic for words like $Married/partner$ the math font is designed to separate letters so they look like a product of variables not a word. so $\log(\mathrm{assets})$ not $log(assets)$ – David Carlisle Apr 18 at 18:00
  • @DavidCarlisle you mean all my variable names should be non-italic? except when using operators like "log" ? – Emil Krabbe Apr 18 at 18:05
  • if you want then italic that is fine but use \mathit compare $difficult$ and $\mathit{difficult}$ \log does not just use the right font it also provides the right spacing. $\log x$ is not the same a $\mathrm{log} x$ – David Carlisle Apr 18 at 18:12
  • First, lose the center environment. See also tex.stackexchange.com/questions/359903/… – John Kormylo Apr 18 at 18:57
2

I show you a possibility to change your second table compiling with longtable and threeparttablex.

Please see that I did a pretty printing of your table tex code I recommend to get a table code the reader can better understand and to be able to find easy the cell he needs to change ...

Because your given code seems to be a mix of several tries I simply reduced the length of your used cell titles. At last you have to rework the complete table to fit your needs. BTW: the header for the last two columns in the table are missing. But the following is a starting point containing a compilable threeparttable in combination with longtable:

\documentclass[11pt]{article}

\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usepackage{longtable} % <==============================================
\usepackage[]{threeparttablex} % <======================================

\usepackage{amsmath}


\begin{document}

\title{title}
\author{Author}
\date{\today}
\maketitle

\begin{ThreePartTable}
%\renewcommand\TPTminimum{\textwidth}

\begin{TableNotes}
  \small
  \item Notes:
  \item *: dummy variable estimates refer to sample proportions rather than averages
  \item A: Originally 1 - excellent, 2 - very good, 3 - good, 4 - fair, 
    5 - poor. Probit estimations did not work so I rescaled to 0 - poor, 
    0.25 - fair, 0.5 - good, 0.75 - very good, 1 - excellent
  \item B: See section 3.2
\end{TableNotes}

\begin{longtable}{llllll}
  \caption{Pooled OLS and Fixed effects estimation on the initial model (eq. 1)}\label{tab:OLS}\\
  \toprule
  \textbf{Dependent:}          & \textbf{Initial} & \textbf{Initial} & \textbf{Fourth} & 5 & 6\\
  \textbf{$\Delta H_{it}$}     & \textbf{POLS}    & \textbf{FE}      & \textbf{Fourth} & & \\
  \midrule
\endfirsthead
  \multicolumn{6}{c}%
    {\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
  \toprule
  \textbf{Dependent:}          & \textbf{Initial} & \textbf{Initial} & \textbf{Fourth} & 5 & 6\\
  \textbf{$\Delta H_{it}$}     & \textbf{POLS}    & \textbf{FE}      & \textbf{Fourth} & & \\
  \midrule
\endhead
  \midrule 
  \multicolumn{6}{r}{\textit{Continued on next page}} \\
\endfoot
  \bottomrule
  \insertTableNotes % <========== tell LaTeX where to insert the table-related notes
\endlastfoot
  Male               & -.00154*** &            &       &   &  \\
                     & (.00033)   &            &       &   & \\
  Age                & .00195***  & .00094     &       &   &  \\
                     & (.00069)   & (.00113)   &       &   & \\
  Age$^{2}$          & -.00002*** & -.00002*** &       &   &  \\
                     & (.00000)   & (.00000)   &       &   & \\
  Black              & .00180***  &            &       &   &  \\
                     & (.00052)   &            &       &   & \\
  Hispanic           & .00095     &            &       &   &  \\
                     & (.00068)   &            &       &   & \\
  Married/partner    & -.00069*** & -.00357*** &       &   &  \\
                     & (.00043)   & (.00127)   &       &   & \\
  log(assets)        & .00055***  & .00031*    & 0.362 & 0 & 1 \\
                     & (.00008)   &(.00017)    &       &   & \\
  log(debt)          & -.00016*** & -.00006    & 0.245 & 0 & 1 \\
                     & (.00005)   & (.00008)   &       &   & \\
  Some highschool    & .00146**   &            &       &   &  \\
                     & (.00063)   &            &       &   & \\
  Highschool (GED)   & .00120**   &            &       &   &  \\
                     & (.00057)   &            &       &   & \\
  AA                 & .00122     &            &       &   &  \\
                     & (.00084)   &            &       &   & \\
  Bachelor degree    & .00228***  &            &       &   &  \\
                     & (.00067)   &            &       &   & \\
  Graduate degree    & .00287***  &            &       &   & \\
                     & (.00067)   &            &       &   & \\
  RS$_{it}$*         & -.00884*** & -.00717*** &       &   &  \\
                     & (.00101)   & (.00112)   &       &   & \\
  RL$_{it}$          & -.00014    & .00135     &       &   &  \\
                     & (.00051)   & (.00089)   &       &   & \\
  Constant           & -.07498*** & -.00814    &       &   &  \\
                     & (.02142)   & (.04949)   &       &   & \\
  \midrule
  time               &            &            &       &   &  \\
  3                  & .00209*    & .00369*    &       &   &  \\
                     & (.00051)   & (.00193)   &       &   & \\
  4                  & -.00717    & -.00398    &       &   &  \\
                     & (.00104)   & (.00323)   &       &   & \\
  5                  & .004299*** & .00950**   &       &   &  \\
                     & (.00097)   & (.00468)   &       &   & \\
  6                  & -.00268*** & .00476     &       &   &  \\
                     & (.00100)   & (.00636)   &       &   & \\
  7                  & -.00348*** & .00602     &       &   & \\
                     & (.00104)   & (.00787)   &       &   & \\
  8                  & -.00000    & .01158     &       &   &  \\
                     & (.00091)   & (.00949)   &       &   & \\
  9                  & -.00327*** & .01006     &       &   &  \\
                     & (.00095)   & (.01099)   &       &   & \\
  10                 & -.00154    & .01719     &       &   &  \\
                     & (.00100)   & (.01278)   &       &   & \\
\end{longtable}
\end{ThreePartTable}

\end{document}

resulting in:

first page

and the second page:

second page

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.