3

The table is big in length and width, hence top and bottom of the table are chopped off from the table generated in a pdf file. Here goes the latex code.

\documentclass{article}

\usepackage[colorlinks]{hyperref}
\usepackage[noabbrev]{cleveref}
\usepackage{graphics}
\usepackage{amsmath}
\usepackage{ragged2e}
\usepackage{rotating}
\usepackage{latexsym}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage[tablename=TABLE,labelsep=newline,aboveskip=0pt,bf]{caption}
\usepackage{clipboard}
\usepackage{booktabs}
\usepackage[svgnames]{xcolor}
\usepackage[round]{natbib}
\usepackage[splitrule]{footmisc}
\usepackage{ltablex}
\usepackage{lipsum}
\usepackage{threeparttablex}
\usepackage{afterpage}
\usepackage{xr}
\usepackage{titlesec}
\usepackage{sectsty,textcase}
\usepackage{longtable}
\usepackage{sepfootnotes}
\usepackage{changepage}
\usepackage{siunitx}

%For making the titles in capital letters
%\allsectionsfont{\MakeTextUppercase}

\sisetup{
    detect-mode,
    %        tight-spacing           = true,
    %        group-digits            = false,
    input-signs             = ,
    input-symbols           = ,
    input-open-uncertainty  = ,
    input-close-uncertainty = ,
    table-align-text-pre    = false,
    %        table-align-text-post   = false,
    %        round-mode              = figures,
    %        round-precision         = 3,
    %        table-space-text-pre    = (,
    %        table-space-text-post   = ),
}
\protected\def\stars#1{$^{#1}$}
\newcolumntype{k}{>{\hsize=.1\hsize}S}

%Set Counter 
\setcounter{footnote}{2}

%Defining text size to control for spacing in tabularx environment 
\newcolumntype{b}{>{\centering}>X}
%\newcolumntype{s}{>{\centering}>{\hsize=.25\hsize}>X}
\newcolumntype{j}{>{\centering}>{\hsize=.75\textwidth}>l}

%Redefining multicolumn environment to take care of @{}
\newcommand{\gmc}[2]{\multicolumn{#1}{@{}#2@{}}}



\begin{document}


    \afterpage{
        \begin{sidewaystable}
            \begin{ThreePartTable}

                \begin{TableNotes}[flushleft]
                    \small 
                    \item \label{r2:a} \noindent This table presents the analyses of the nonlinear relationship between absolute discretionary accruals and observable characteristics. All models are estimated using multivariate linear regression, with dependent variable being absolute discretionary accrual and independent regressors being observable characteristics and their second order power transformations. *,**,*** indicate significance at the 0.10, 0.05, and 0.01 levels, respectively using two-tailed tests. All t-statistics (in parentheses) and p-values are calculated using heteroscedasticity-adjusted clustered (HAC) standard errors by company. Only the model in column (I) includes year and industry-specific intercepts, but for brevity those are not reported. 
                \end{TableNotes}

                \begin{tabularx}{\textwidth}{@{}Xcccccccccccc@{}}

                    \caption{\textit{Nonlinear Relationship}}\label{tab:sample}\\\toprule\toprule
                    & \gmc{12}{l} \mbox{Dependent Variable = Absolute Discretionary Accrual}\\\cmidrule(l r){2-13}\\
                    Variables & (I) & (II) & (III) & (IV) & (V) & (VI) & (VII)& (VIII)& (IX)& (X)& (XI) & (XII) \\\midrule\endfirsthead

                    \caption{\textit{Nonlinear Relationship - Continued}}\\\toprule\toprule
                    & \gmc{12}{l} \mbox{Dependent Variable = Absolute Discretionary Accrual}\\\cmidrule(l r){2-13}\\
                    Variables & (I) & (II) & (III) & (IV) & (V) & (VI) & (VII)& (VIII)& (IX)& (X)& (XI) & (XII) \\\midrule\endhead

                    \bottomrule\gmc{2}{r}{\small\textit{(Continued)}}\endfoot
                    \bottomrule\insertTableNotes\endlastfoot

                    (Intercept)         & $0.034^{***}$  & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$ & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$ & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$  \\
                    & $(8.256)$      & $(326.308)$    & $(302.004)$    & $(295.880)$    & $(285.826)$   & $(308.718)$    & $(307.844)$    & $(284.705)$    & $(285.351)$   & $(293.573)$    & $(291.619)$    & $(285.588)$    \\
                    poly(LOGASSETS, 2)1 & $-4.942^{***}$ & $-6.068^{***}$ & $-5.532^{***}$ &                &               &                &                &                &               &                &                &                \\
                    & $(-20.000)$    & $(-25.236)$    & $(-94.950)$    &                &               &                &                &                &               &                &                &                \\
                    poly(LOGASSETS, 2)2 & $-1.280^{***}$ & $-1.709^{***}$ & $0.948^{***}$  &                &               &                &                &                &               &                &                &                \\
                    & $(-11.620)$    & $(-15.860)$    & $(15.861)$     &                &               &                &                &                &               &                &                &                \\
                    poly(LOGMKT, 2)1    & $0.855^{***}$  & $1.401^{***}$  &                & $-4.618^{***}$ &               &                &                &                &               &                &                &                \\
                    & $(3.435)$      & $(5.758)$      &                & $(-80.615)$    &               &                &                &                &               &                &                &                \\
                    poly(LOGMKT, 2)2    & $0.747^{***}$  & $0.985^{***}$  &                & $0.161^{***}$  &               &                &                &                &               &                &                &                \\
                    & $(7.709)$      & $(10.244)$     &                & $(2.740)$      &               &                &                &                &               &                &                &                \\
                    poly(LEV, 2)1       & $0.486^{***}$  & $0.295^{***}$  &                &                & $0.123$       &                &                &                &               &                &                &                \\
                    & $(4.894)$      & $(3.009)$      &                &                & $(1.588)$     &                &                &                &               &                &                &                \\
                    poly(LEV, 2)2       & $-0.381^{***}$ & $-0.307^{***}$ &                &                & $1.808^{***}$ &                &                &                &               &                &                &                \\
                    & $(-3.967)$     & $(-3.202)$     &                &                & $(15.131)$    &                &                &                &               &                &                &                \\
                    poly(ROA, 2)1       & $-2.520^{***}$ & $-2.685^{***}$ &                &                &               & $-6.478^{***}$ &                &                &               &                &                &                \\
                    & $(-10.658)$    & $(-11.346)$    &                &                &               & $(-66.153)$    &                &                &               &                &                &                \\
                    poly(ROA, 2)2       & $-1.987^{***}$ & $-1.961^{***}$ &                &                &               & $-0.103$       &                &                &               &                &                &                \\
                    & $(-11.164)$    & $(-11.039)$    &                &                &               & $(-0.912)$     &                &                &               &                &                &                \\
                    poly(CFO, 2)1       & $-2.219^{***}$ & $-2.349^{***}$ &                &                &               &                & $-5.851^{***}$ &                &               &                &                &                \\
                    & $(-10.461)$    & $(-11.399)$    &                &                &               &                & $(-60.246)$    &                &               &                &                &                \\
                    poly(CFO, 2)2       & $3.444^{***}$  & $3.281^{***}$  &                &                &               &                & $2.536^{***}$  &                &               &                &                &                \\
                    & $(22.091)$     & $(21.086)$     &                &                &               &                & $(21.182)$     &                &               &                &                &                \\
                    poly(BTM, 2)1       & $-0.315^{***}$ & $-0.288^{***}$ &                &                &               &                &                & $-0.882^{***}$ &               &                &                &                \\
                    & $(-3.768)$     & $(-3.406)$     &                &                &               &                &                & $(-12.263)$    &               &                &                &                \\
                    poly(BTM, 2)2       & $0.046$        & $0.077$        &                &                &               &                &                & $0.590^{***}$  &               &                &                &                \\
                    & $(0.582)$      & $(0.963)$      &                &                &               &                &                & $(7.778)$      &               &                &                &                \\
                    poly(GROWTH, 2)1    & $0.431^{***}$  & $0.482^{***}$  &                &                &               &                &                &                & $0.826^{***}$ &                &                &                \\
                    & $(6.145)$      & $(6.971)$      &                &                &               &                &                &                & $(10.033)$    &                &                &                \\
                    poly(GROWTH, 2)2    & $-0.233^{***}$ & $-0.288^{***}$ &                &                &               &                &                &                & $1.298^{***}$ &                &                &                \\
                    & $(-3.318)$     & $(-4.113)$     &                &                &               &                &                &                & $(14.251)$    &                &                &                \\
                    poly(ABSACCRL, 2)1  & $1.299^{***}$  & $1.375^{***}$  &                &                &               &                &                &                &               & $4.043^{***}$  &                &                \\
                    & $(15.240)$     & $(16.018)$     &                &                &               &                &                &                &               & $(48.167)$     &                &                \\
                    poly(ABSACCRL, 2)2  & $-0.470^{***}$ & $-0.489^{***}$ &                &                &               &                &                &                &               & $-1.020^{***}$ &                &                \\
                    & $(-5.455)$     & $(-5.619)$     &                &                &               &                &                &                &               & $(-11.227)$    &                &                \\
                    poly(ALTMAN, 2)1    & $0.362^{***}$  & $0.434^{***}$  &                &                &               &                &                &                &               &                & $-3.508^{***}$ &                \\
                    & $(3.427)$      & $(4.219)$      &                &                &               &                &                &                &               &                & $(-37.658)$    &                \\
                    poly(ALTMAN, 2)2    & $0.177^{*}$    & $0.211^{**}$   &                &                &               &                &                &                &               &                & $1.280^{***}$  &                \\
                    & $(1.951)$      & $(2.315)$      &                &                &               &                &                &                &               &                & $(11.271)$     &                \\
                    poly(STDEARN, 2)1   & $1.557^{***}$  & $1.821^{***}$  &                &                &               &                &                &                &               &                &                & $-1.212^{***}$ \\
                    & $(21.667)$     & $(25.899)$     &                &                &               &                &                &                &               &                &                & $(-21.981)$    \\
                    poly(STDEARN, 2)2   & $-0.840^{***}$ & $-0.992^{***}$ &                &                &               &                &                &                &               &                &                & $1.155^{***}$  \\
                    & $(-13.228)$    & $(-15.603)$    &                &                &               &                &                &                &               &                &                & $(19.654)$     \\
                    Industry and Year F.E. Included & Yes & No & No & No & No & No & No & No & No & No & No & No \\
                    Adjusted $R^2$ & 0.2622 & 0.2425 & \\
                \end{tabularx}
            \end{ThreePartTable}
        \end{sidewaystable}
    }

\end{document}
1

3 Answers 3

2

Using a default tabularx with package ltablex

\documentclass[a4paper]{article}
\usepackage{geometry}
\usepackage[tablename=TABLE,labelsep=newline,aboveskip=0pt,bf]{caption}
\usepackage{booktabs}
\usepackage[svgnames]{xcolor}
\usepackage{ltablex}
\usepackage{amsmath}
\protected\def\stars#1{$^{#1}$}
\newcolumntype{k}{>{\hsize=.1\hsize}S}
\newcolumntype{b}{>{\centering}>X}
\newcolumntype{j}{>{\centering}>{\hsize=.75\textwidth}>l}
\newcommand{\gmc}[2]{\multicolumn{#1}{@{}#2@{}}}
\geometry{landscape, textheight = 15.75cm, textwidth = 23.4cm, marginratio={1:1}, nomarginpar}
\pagestyle{empty}

\begin{document}

\begingroup
\setlength\tabcolsep{3pt}\renewcommand\arraystretch{1.333}\small

\begin{tabularx}{\textwidth}{@{}X*{12}{>{$}c<{$}}@{}}
\caption{\textit{Nonlinear Relationship}}\label{tab:sample}\\\toprule\toprule
    & \gmc{12}{l}{Dependent Variable = Absolute Discretionary Accrual}\\\cmidrule(l r){2-13}
   Variables & (I) & (II) & (III) & (IV) & (V) & (VI) & (VII)& (VIII)& (IX)& (X)& (XI) & (XII) \\\midrule
\endfirsthead
\multicolumn{13}{c}{\itshape Nonlinear Relationship -- Continued}\\\hline
    & \gmc{12}{l}{Dependent Variable = Absolute Discretionary Accrual}\\\cmidrule(l r){2-13}
   Variables & (I) & (II) & (III) & (IV) & (V) & (VI) & (VII)& (VIII)& (IX)& (X)& (XI) & (XII) \\\midrule
\endhead
\bottomrule\gmc{13}{c}{\small\textit{(Continued)}}
\endfoot
\bottomrule
\endlastfoot
 (Intercept) & 0.034^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} \\
     & (8.256) & (326.308) & (302.004) & (295.880) & (285.826) & (308.718) & (307.844) & (284.705) & (285.351) & (293.573) & (291.619) & (285.588) \\
     poly(LOGASSETS, 2)1 & -4.942^{***} & -6.068^{***} & -5.532^{***} & & & & & & & & & \\
     & (-20.000) & (-25.236) & (-94.950) & & & & & & & & & \\
     poly(LOGASSETS, 2)2 & -1.280^{***} & -1.709^{***} & 0.948^{***} & & & & & & & & & \\
     & (-11.620) & (-15.860) & (15.861) & & & & & & & & & \\
     poly(LOGMKT, 2)1 & 0.855^{***} & 1.401^{***} & & -4.618^{***} & & & & & & & & \\
     & (3.435) & (5.758) & & (-80.615) & & & & & & & & \\
     poly(LOGMKT, 2)2 & 0.747^{***} & 0.985^{***} & & 0.161^{***} & & & & & & & & \\
     & (7.709) & (10.244) & & (2.740) & & & & & & & & \\
     poly(LEV, 2)1 & 0.486^{***} & 0.295^{***} & & & 0.123 & & & & & & & \\
     & (4.894) & (3.009) & & & (1.588) & & & & & & & \\
     poly(LEV, 2)2 & -0.381^{***} & -0.307^{***} & & & 1.808^{***} & & & & & & & \\
     & (-3.967) & (-3.202) & & & (15.131) & & & & & & & \\
     poly(ROA, 2)1 & -2.520^{***} & -2.685^{***} & & & & -6.478^{***} & & & & & & \\
     & (-10.658) & (-11.346) & & & & (-66.153) & & & & & & \\
     poly(ROA, 2)2 & -1.987^{***} & -1.961^{***} & & & & -0.103 & & & & & & \\
     & (-11.164) & (-11.039) & & & & (-0.912) & & & & & & \\
     poly(CFO, 2)1 & -2.219^{***} & -2.349^{***} & & & & & -5.851^{***} & & & & & \\
     & (-10.461) & (-11.399) & & & & & (-60.246) & & & & & \\
     poly(CFO, 2)2 & 3.444^{***} & 3.281^{***} & & & & & 2.536^{***} & & & & & \\
     & (22.091) & (21.086) & & & & & (21.182) & & & & & \\
     poly(BTM, 2)1 & -0.315^{***} & -0.288^{***} & & & & & & -0.882^{***} & & & & \\
     & (-3.768) & (-3.406) & & & & & & (-12.263) & & & & \\
     poly(BTM, 2)2 & 0.046 & 0.077 & & & & & & 0.590^{***} & & & & \\
     & (0.582) & (0.963) & & & & & & (7.778) & & & & \\
     poly(GROWTH, 2)1 & 0.431^{***} & 0.482^{***} & & & & & & & 0.826^{***} & & & \\
     & (6.145) & (6.971) & & & & & & & (10.033) & & & \\
     poly(GROWTH, 2)2 & -0.233^{***} & -0.288^{***} & & & & & & & 1.298^{***} & & & \\
     & (-3.318) & (-4.113) & & & & & & & (14.251) & & & \\
     poly(ABSACCRL, 2)1 & 1.299^{***} & 1.375^{***} & & & & & & & & 4.043^{***} & & \\
     & (15.240) & (16.018) & & & & & & & & (48.167) & & \\
     poly(ABSACCRL, 2)2 & -0.470^{***} & -0.489^{***} & & & & & & & & -1.020^{***} & & \\
     & (-5.455) & (-5.619) & & & & & & & & (-11.227) & & \\
     poly(ALTMAN, 2)1 & 0.362^{***} & 0.434^{***} & & & & & & & & & -3.508^{***} & \\
     & (3.427) & (4.219) & & & & & & & & & (-37.658) & \\
     poly(ALTMAN, 2)2 & 0.177^{*} & 0.211^{**} & & & & & & & & & 1.280^{***} & \\
     & (1.951) & (2.315) & & & & & & & & & (11.271) & \\
     poly(STDEARN, 2)1 & 1.557^{***} & 1.821^{***} & & & & & & & & & & -1.212^{***} \\
     & (21.667) & (25.899) & & & & & & & & & & (-21.981) \\
     poly(STDEARN, 2)2 & -0.840^{***} & -0.992^{***} & & & & & & & & & & 1.155^{***} \\
     & (-13.228) & (-15.603) & & & & & & & & & & (19.654) \\
     Industry and Year F.E. Included & \text{Yes} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} \\
     Adjusted $ R² $ & 0.2622 & 0.2425 & \\
\end{tabularx}

\smallskip\noindent      
\small\label{r2:a}%
This table presents the analyses of the nonlinear relationship between absolute discretionary accruals and observable characteristics. All models are estimated using multivariate linear regression, with dependent variable being absolute discretionary accrual and independent regressors being observable characteristics and their second order power transformations. *,**,*** indicate significance at the 0.10, 0.05, and 0.01 levels, respectively using two-tailed tests. All t-statistics (in parentheses) and p-values are calculated using heteroscedasticity-adjusted clustered (HAC) standard errors by company. Only the model in column (I) includes year and industry-specific intercepts, but for brevity those are not reported.
\endgroup

\end{document} 

enter image description here

2
  • can you explain what does \begingroup do? I also couldn't follow {>{$}c<{$}}.
    – Sumit
    Jul 20, 2014 at 10:40
  • Hold the changes of \tabcolsep and others local. >{$}c<{$}}: Before (>) the cell entry write $ and after (<) write again $. In short: use math mode.
    – user2478
    Jul 20, 2014 at 13:19
2

I would compile the long table as in independent file in landscape format, then include it in the main file, using the pdfpages package. Here is a code for landscape form

    \documentclass[a4paper]{article}%
    \usepackage{geometry}%,showframe, nomarginpar [textwidth = 15.75cm, textheight = 25cm, marginratio={4:6,5:7}]
    \usepackage[colorlinks]{hyperref}
    \usepackage[noabbrev]{cleveref}
    %\usepackage{graphics}
    \usepackage{amsmath}
    \usepackage{ragged2e}
    \usepackage{rotating}
    \usepackage{latexsym}
    %\usepackage{epsfig}
    \usepackage{graphicx}
    \usepackage{enumitem}
    \usepackage[tablename=TABLE,labelsep=newline,aboveskip=0pt,bf]{caption}
    %\usepackage{clipboard}
    \usepackage{booktabs}
    \usepackage[svgnames]{xcolor}
    %\usepackage[round]{natbib}
    \usepackage[splitrule]{footmisc}
    \usepackage{ltablex}
    \usepackage{lipsum}
    \usepackage{threeparttablex}
    \usepackage{afterpage}
    \usepackage{xr}
    \usepackage{titlesec}
    %\usepackage{sectsty,textcase}
    %\usepackage{longtable}
    %\usepackage{sepfootnotes}
    \usepackage{changepage}
    \usepackage{siunitx}

    %For making the titles in capital letters
    %\allsectionsfont{\MakeTextUppercase}

    \sisetup{
     detect-mode,
      tight-spacing = true,
      group-digits = false,
     input-signs = ,
     input-symbols = ,
     input-open-uncertainty = ,
     input-close-uncertainty = ,
     table-align-text-pre = false,
      table-align-text-post = false,
      round-mode = figures,
      round-precision = 3,
      table-space-text-pre = (,
      table-space-text-post = ),
    }
    \protected\def\stars#1{$^{#1}$}
    \newcolumntype{k}{>{\hsize=.1\hsize}S}

    \setcounter{footnote}{2}

    %Defining text size to control for spacing in tabularx environment
    \newcolumntype{b}{>{\centering}>X}
    %\newcolumntype{s}{>{\centering}>{\hsize=.25\hsize}>X}
    \newcolumntype{j}{>{\centering}>{\hsize=.75\textwidth}>l}

    %Redefining multicolumn environment to take care of @{}
    \newcommand{\gmc}[2]{\multicolumn{#1}{@{}#2@{}}}

    \geometry{landscape, textheight = 15.75cm, textwidth = 23.4cm, marginratio={1:1},showframe, nomarginpar}
    \pagestyle{empty}

    \begin{document}

     \begin{ThreePartTable}
    \setlength\tabcolsep{4pt}\renewcommand\arraystretch{1.333}\small
     \begin{TableNotes}[flushleft]
     \small
     \item \label{r2:a} \noindent This table presents the analyses of the nonlinear relationship between absolute discretionary accruals and observable characteristics. All models are estimated using multivariate linear regression, with dependent variable being absolute discretionary accrual and independent regressors being observable characteristics and their second order power transformations. *,**,*** indicate significance at the 0.10, 0.05, and 0.01 levels, respectively using two-tailed tests. All t-statistics (in parentheses) and p-values are calculated using heteroscedasticity-adjusted clustered (HAC) standard errors by company. Only the model in column (I) includes year and industry-specific intercepts, but for brevity those are not reported.
     \end{TableNotes}
                    \begin{tabularx}{\textwidth}{@{}X*{12}{>{$}c<{$}}@{}}

                        \caption{\textit{Nonlinear Relationship}}\label{tab:sample}\\\toprule\toprule
                        & \gmc{12}{l} \mbox{Dependent Variable = Absolute Discretionary Accrual}\\\cmidrule(l r){2-13}\\
                        Variables & (I) & (II) & (III) & (IV) & (V) & (VI) & (VII)& (VIII)& (IX)& (X)& (XI) & (XII) \\
                        \midrule\endfirsthead
                        \caption{\textit{Nonlinear Relationship -- Continued}}\\
                        \toprule\toprule
                        & \gmc{12}{l} \mbox{Dependent Variable = Absolute Discretionary Accrual}\\\cmidrule(l r){2-13}\\
                        Variables & \text{(I)} & \text{(II)} & \text{(III)} & \text{(IV)} & \text{(V)} & \text{(VI)} & \text{(VII)}& \text{(VIII)}& \text{(IX)} & \text{(X)} & \text{(XI)} & \text{(XII)} \\
                        \midrule\endhead
    %
                        \bottomrule\gmc{2}{r}{\small\textit{(Continued)}}
                        \endfoot
                        \bottomrule
                        \noalign{\vskip 2ex}
                     \insertTableNotes
                        \endlastfoot
    %
                        (Intercept) & 0.034^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} & 0.059^{***} \\
     & (8.256) & (326.308) & (302.004) & (295.880) & (285.826) & (308.718) & (307.844) & (284.705) & (285.351) & (293.573) & (291.619) & (285.588) \\
     poly(LOGASSETS, 2)1 & -4.942^{***} & -6.068^{***} & -5.532^{***} & & & & & & & & & \\
     & (-20.000) & (-25.236) & (-94.950) & & & & & & & & & \\
     poly(LOGASSETS, 2)2 & -1.280^{***} & -1.709^{***} & 0.948^{***} & & & & & & & & & \\
     & (-11.620) & (-15.860) & (15.861) & & & & & & & & & \\
     poly(LOGMKT, 2)1 & 0.855^{***} & 1.401^{***} & & -4.618^{***} & & & & & & & & \\
     & (3.435) & (5.758) & & (-80.615) & & & & & & & & \\
     poly(LOGMKT, 2)2 & 0.747^{***} & 0.985^{***} & & 0.161^{***} & & & & & & & & \\
     & (7.709) & (10.244) & & (2.740) & & & & & & & & \\
     poly(LEV, 2)1 & 0.486^{***} & 0.295^{***} & & & 0.123 & & & & & & & \\
     & (4.894) & (3.009) & & & (1.588) & & & & & & & \\
     poly(LEV, 2)2 & -0.381^{***} & -0.307^{***} & & & 1.808^{***} & & & & & & & \\
     & (-3.967) & (-3.202) & & & (15.131) & & & & & & & \\
     poly(ROA, 2)1 & -2.520^{***} & -2.685^{***} & & & & -6.478^{***} & & & & & & \\
     & (-10.658) & (-11.346) & & & & (-66.153) & & & & & & \\
     poly(ROA, 2)2 & -1.987^{***} & -1.961^{***} & & & & -0.103 & & & & & & \\
     & (-11.164) & (-11.039) & & & & (-0.912) & & & & & & \\
     poly(CFO, 2)1 & -2.219^{***} & -2.349^{***} & & & & & -5.851^{***} & & & & & \\
     & (-10.461) & (-11.399) & & & & & (-60.246) & & & & & \\
     poly(CFO, 2)2 & 3.444^{***} & 3.281^{***} & & & & & 2.536^{***} & & & & & \\
     & (22.091) & (21.086) & & & & & (21.182) & & & & & \\
     poly(BTM, 2)1 & -0.315^{***} & -0.288^{***} & & & & & & -0.882^{***} & & & & \\
     & (-3.768) & (-3.406) & & & & & & (-12.263) & & & & \\
     poly(BTM, 2)2 & 0.046 & 0.077 & & & & & & 0.590^{***} & & & & \\
     & (0.582) & (0.963) & & & & & & (7.778) & & & & \\
     poly(GROWTH, 2)1 & 0.431^{***} & 0.482^{***} & & & & & & & 0.826^{***} & & & \\
     & (6.145) & (6.971) & & & & & & & (10.033) & & & \\
     poly(GROWTH, 2)2 & -0.233^{***} & -0.288^{***} & & & & & & & 1.298^{***} & & & \\
     & (-3.318) & (-4.113) & & & & & & & (14.251) & & & \\
     poly(ABSACCRL, 2)1 & 1.299^{***} & 1.375^{***} & & & & & & & & 4.043^{***} & & \\
     & (15.240) & (16.018) & & & & & & & & (48.167) & & \\
     poly(ABSACCRL, 2)2 & -0.470^{***} & -0.489^{***} & & & & & & & & -1.020^{***} & & \\
     & (-5.455) & (-5.619) & & & & & & & & (-11.227) & & \\
     poly(ALTMAN, 2)1 & 0.362^{***} & 0.434^{***} & & & & & & & & & -3.508^{***} & \\
     & (3.427) & (4.219) & & & & & & & & & (-37.658) & \\
     poly(ALTMAN, 2)2 & 0.177^{*} & 0.211^{**} & & & & & & & & & 1.280^{***} & \\
     & (1.951) & (2.315) & & & & & & & & & (11.271) & \\
     poly(STDEARN, 2)1 & 1.557^{***} & 1.821^{***} & & & & & & & & & & -1.212^{***} \\
     & (21.667) & (25.899) & & & & & & & & & & (-21.981) \\
     poly(STDEARN, 2)2 & -0.840^{***} & -0.992^{***} & & & & & & & & & & 1.155^{***} \\
     & (-13.228) & (-15.603) & & & & & & & & & & (19.654) \\
     Industry and Year F.E. Included & \text{Yes} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} & \text{No} \\
     Adjusted $ R² $ & 0.2622 & 0.2425 & \\
                    \end{tabularx}
     \end{ThreePartTable}

    \end{document} 

Here is the result:

enter image description here enter image description here

Another way would be to use the pdflscape package to temporarily set landscape format, but then the first column can't use the X specifier, as it seems to be incompatible with tabularx. So I used a p{…} specifier. The only difference with the previous code, besides not using the landscape option, consists in wrapping the table in a landscape environment.

Result:

enter image description here

1

tabularx adjusts the table width by adjusting the column width for line breaking paragraphs it rarely makes sense to use it on tabular data as here.

I made your "minimal" example more minimal by removing unused packages, used tabular instead of tabularx and truncated the last entry in column 1 which was making it too wide.

\documentclass{article}




\usepackage{threeparttablex}
\usepackage{rotating}
\usepackage{booktabs,array}



\protected\def\stars#1{$^{#1}$}


%Set Counter 
\setcounter{footnote}{2}



%Redefining multicolumn environment to take care of @{}
\newcommand{\gmc}[2]{\multicolumn{#1}{@{}#2@{}}}



\begin{document}

        \begin{sidewaystable}
            \begin{ThreePartTable}

                \begin{TableNotes}[flushleft]
                    \small 
                    \item \label{r2:a} \noindent This table presents the analyses of the nonlinear relationship between absolute discretionary accruals and observable characteristics. All models are estimated using multivariate linear regression, with dependent variable being absolute discretionary accrual and independent regressors being observable characteristics and their second order power transformations. *,**,*** indicate significance at the 0.10, 0.05, and 0.01 levels, respectively using two-tailed tests. All t-statistics (in parentheses) and p-values are calculated using heteroscedasticity-adjusted clustered (HAC) standard errors by company. Only the model in column (I) includes year and industry-specific intercepts, but for brevity those are not reported. 
                \end{TableNotes}

                    \caption{\textit{Nonlinear Relationship}}\label{tab:sample}
\setlength\tabcolsep{1pt}
                \hspace*{-.7cm}\begin{tabular}{@{}>{\footnotesize}lcccccccccccc@{}}
\toprule
                    & \gmc{12}{l}{Dependent Variable = Absolute Discretionary Accrual}\\\cmidrule(l r){2-13}\\
     \small               Variables & (I) & (II) & (III) & (IV) & (V) & (VI) & (VII)& (VIII)& (IX)& (X)& (XI) & (XII) \\\midrule


                    (Intercept)         & $0.034^{***}$  & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$ & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$ & $0.059^{***}$  & $0.059^{***}$  & $0.059^{***}$  \\
                    & $(8.256)$      & $(326.308)$    & $(302.004)$    & $(295.880)$    & $(285.826)$   & $(308.718)$    & $(307.844)$    & $(284.705)$    & $(285.351)$   & $(293.573)$    & $(291.619)$    & $(285.588)$    \\
                    poly(LOGASSETS, 2)1 & $-4.942^{***}$ & $-6.068^{***}$ & $-5.532^{***}$ &                &               &                &                &                &               &                &                &                \\
                    & $(-20.000)$    & $(-25.236)$    & $(-94.950)$    &                &               &                &                &                &               &                &                &                \\
                    poly(LOGASSETS, 2)2 & $-1.280^{***}$ & $-1.709^{***}$ & $0.948^{***}$  &                &               &                &                &                &               &                &                &                \\
                    & $(-11.620)$    & $(-15.860)$    & $(15.861)$     &                &               &                &                &                &               &                &                &                \\
                    poly(LOGMKT, 2)1    & $0.855^{***}$  & $1.401^{***}$  &                & $-4.618^{***}$ &               &                &                &                &               &                &                &                \\
                    & $(3.435)$      & $(5.758)$      &                & $(-80.615)$    &               &                &                &                &               &                &                &                \\
                    poly(LOGMKT, 2)2    & $0.747^{***}$  & $0.985^{***}$  &                & $0.161^{***}$  &               &                &                &                &               &                &                &                \\
                    & $(7.709)$      & $(10.244)$     &                & $(2.740)$      &               &                &                &                &               &                &                &                \\
                    poly(LEV, 2)1       & $0.486^{***}$  & $0.295^{***}$  &                &                & $0.123$       &                &                &                &               &                &                &                \\
                    & $(4.894)$      & $(3.009)$      &                &                & $(1.588)$     &                &                &                &               &                &                &                \\
                    poly(LEV, 2)2       & $-0.381^{***}$ & $-0.307^{***}$ &                &                & $1.808^{***}$ &                &                &                &               &                &                &                \\
                    & $(-3.967)$     & $(-3.202)$     &                &                & $(15.131)$    &                &                &                &               &                &                &                \\
                    poly(ROA, 2)1       & $-2.520^{***}$ & $-2.685^{***}$ &                &                &               & $-6.478^{***}$ &                &                &               &                &                &                \\
                    & $(-10.658)$    & $(-11.346)$    &                &                &               & $(-66.153)$    &                &                &               &                &                &                \\
                    poly(ROA, 2)2       & $-1.987^{***}$ & $-1.961^{***}$ &                &                &               & $-0.103$       &                &                &               &                &                &                \\
                    & $(-11.164)$    & $(-11.039)$    &                &                &               & $(-0.912)$     &                &                &               &                &                &                \\
                    poly(CFO, 2)1       & $-2.219^{***}$ & $-2.349^{***}$ &                &                &               &                & $-5.851^{***}$ &                &               &                &                &                \\
                    & $(-10.461)$    & $(-11.399)$    &                &                &               &                & $(-60.246)$    &                &               &                &                &                \\
                    poly(CFO, 2)2       & $3.444^{***}$  & $3.281^{***}$  &                &                &               &                & $2.536^{***}$  &                &               &                &                &                \\
                    & $(22.091)$     & $(21.086)$     &                &                &               &                & $(21.182)$     &                &               &                &                &                \\
                    poly(BTM, 2)1       & $-0.315^{***}$ & $-0.288^{***}$ &                &                &               &                &                & $-0.882^{***}$ &               &                &                &                \\
                    & $(-3.768)$     & $(-3.406)$     &                &                &               &                &                & $(-12.263)$    &               &                &                &                \\
                    poly(BTM, 2)2       & $0.046$        & $0.077$        &                &                &               &                &                & $0.590^{***}$  &               &                &                &                \\
                    & $(0.582)$      & $(0.963)$      &                &                &               &                &                & $(7.778)$      &               &                &                &                \\
                    poly(GROWTH, 2)1    & $0.431^{***}$  & $0.482^{***}$  &                &                &               &                &                &                & $0.826^{***}$ &                &                &                \\
                    & $(6.145)$      & $(6.971)$      &                &                &               &                &                &                & $(10.033)$    &                &                &                \\
                    poly(GROWTH, 2)2    & $-0.233^{***}$ & $-0.288^{***}$ &                &                &               &                &                &                & $1.298^{***}$ &                &                &                \\
                    & $(-3.318)$     & $(-4.113)$     &                &                &               &                &                &                & $(14.251)$    &                &                &                \\
                    poly(ABSACCRL, 2)1  & $1.299^{***}$  & $1.375^{***}$  &                &                &               &                &                &                &               & $4.043^{***}$  &                &                \\
                    & $(15.240)$     & $(16.018)$     &                &                &               &                &                &                &               & $(48.167)$     &                &                \\
                    poly(ABSACCRL, 2)2  & $-0.470^{***}$ & $-0.489^{***}$ &                &                &               &                &                &                &               & $-1.020^{***}$ &                &                \\
                    & $(-5.455)$     & $(-5.619)$     &                &                &               &                &                &                &               & $(-11.227)$    &                &                \\
                    poly(ALTMAN, 2)1    & $0.362^{***}$  & $0.434^{***}$  &                &                &               &                &                &                &               &                & $-3.508^{***}$ &                \\
                    & $(3.427)$      & $(4.219)$      &                &                &               &                &                &                &               &                & $(-37.658)$    &                \\
                    poly(ALTMAN, 2)2    & $0.177^{*}$    & $0.211^{**}$   &                &                &               &                &                &                &               &                & $1.280^{***}$  &                \\
                    & $(1.951)$      & $(2.315)$      &                &                &               &                &                &                &               &                & $(11.271)$     &                \\
                    poly(STDEARN, 2)1   & $1.557^{***}$  & $1.821^{***}$  &                &                &               &                &                &                &               &                &                & $-1.212^{***}$ \\
                    & $(21.667)$     & $(25.899)$     &                &                &               &                &                &                &               &                &                & $(-21.981)$    \\
                    poly(STDEARN, 2)2   & $-0.840^{***}$ & $-0.992^{***}$ &                &                &               &                &                &                &               &                &                & $1.155^{***}$  \\
                    & $(-13.228)$    & $(-15.603)$    &                &                &               &                &                &                &               &                &                & $(19.654)$     \\
                    Industry and Year F.E. & Yes & No & No & No & No & No & No & No & No & No & No & No \\
                    Adjusted $R^2$ & 0.2622 & 0.2425 & \\
                \end{tabular}\hspace*{-3cm}
            \end{ThreePartTable}
        \end{sidewaystable}


\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .