Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • estout: Use \tabularnewline instead of \\ at the end of lines

    The question is in the title :-) Is it possible to make estout use \tabularnewline instead of \\ for new lines?

  • #2
    For esttab, just use end(\tabularnewline. But don't know yet for estout.
    Last edited by Fredrik Paues; 04 May 2023, 23:30.

    Comment


    • #3
      For estout, you also just use \tabularnewline. (But you can't have more than one end() option...

      Comment


      • #4
        estout is from SSC (FAQ Advice #12).

        Code:
        sysuse auto, clear
        regress mpg weight disp, robust
        esttab, tex
        esttab, tex substitute(\\ "\tabularnewline")
        Res.:

        Code:
        . esttab, tex
        
        {
        \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
        \begin{tabular}{l*{1}{c}}
        \hline\hline
                    &\multicolumn{1}{c}{(1)}\\
                    &\multicolumn{1}{c}{mpg}\\
        \hline
        weight      &    -0.00657\sym{***}\\
                    &     (-7.04)         \\
        [1em]
        displacement&     0.00528         \\
                    &      (0.71)         \\
        [1em]
        \_cons      &       40.08\sym{***}\\
                    &     (19.33)         \\
        \hline
        \(N\)       &          74         \\
        \hline\hline
        \multicolumn{2}{l}{\footnotesize \textit{t} statistics in parentheses}\\
        \multicolumn{2}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
        \end{tabular}
        }
        
        . esttab, tex substitute(\\ "\tabularnewline")
        
        {
        \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
        \begin{tabular}{l*{1}{c}}
        \hline\hline
                    &\multicolumn{1}{c}{(1)}\tabularnewline
                    &\multicolumn{1}{c}{mpg}\tabularnewline
        \hline
        weight      &    -0.00657\sym{***}\tabularnewline
                    &     (-7.04)         \tabularnewline
        [1em]
        displacement&     0.00528         \tabularnewline
                    &      (0.71)         \tabularnewline
        [1em]
        _cons       &       40.08\sym{***}\tabularnewline
                    &     (19.33)         \tabularnewline
        \hline
        \(N\)       &          74         \tabularnewline
        \hline\hline
        \multicolumn{2}{l}{\footnotesize \textit{t} statistics in parentheses}\tabularnewline
        \multicolumn{2}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\tabularnewline
        \end{tabular}
        }
        
        .

        Comment

        Working...
        X