Announcement

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

  • Using the "esttab" to save teffects result tables in LaTex

    Dear all,

    I have Potential Outcome Mean (POMs) and Treatment Effect tables that I want to save as Tex files using the "esttab" command but I can't find my way around it. Can someone please help me?. Attached are samples of the tables I want to save in Tex:

    Counting on your usual kind support.

    Thank you.
    Attached Files

  • #2
    estout is from SSC (FAQ Advice #12). "ATE" and "POmean" are equations is the output of teffects, so you can specify to keep them. The option -tex- will output a LaTeX table.

    Code:
    webuse cattaneo2, clear
    eststo m1: teffects ipwra (bweight) (mbsmoke mmarried c.mage##c.mage fbaby medu, probit)
    esttab m1, keep(ATE: POmean:) tex
    Res.:

    Code:
    . eststo m1: teffects ipwra (bweight) (mbsmoke mmarried c.mage##c.mage fbaby medu, probit)
    
    Iteration 0:   EE criterion =  4.623e-21  
    Iteration 1:   EE criterion =  2.498e-26  
    
    Treatment-effects estimation                    Number of obs     =      4,642
    Estimator      : IPW regression adjustment
    Outcome model  : linear
    Treatment model: probit
    ----------------------------------------------------------------------------------------
                           |               Robust
                   bweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -----------------------+----------------------------------------------------------------
    ATE                    |
                   mbsmoke |
    (smoker vs nonsmoker)  |  -230.6886   25.81524    -8.94   0.000    -281.2856   -180.0917
    -----------------------+----------------------------------------------------------------
    POmean                 |
                   mbsmoke |
                nonsmoker  |   3403.463   9.571369   355.59   0.000     3384.703    3422.222
    ----------------------------------------------------------------------------------------
    
    . 
    . esttab m1, keep(ATE: POmean:) tex
    
    {
    \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
    \begin{tabular}{l*{1}{c}}
    \hline\hline
                &\multicolumn{1}{c}{(1)}\\
                &\multicolumn{1}{c}{bweight}\\
    \hline
    ATE         &                     \\
    r1vs0.mbsmoke&      -230.7\sym{***}\\
                &     (-8.94)         \\
    \hline
    POmean      &                     \\
    0.mbsmoke   &      3403.5\sym{***}\\
                &    (355.59)         \\
    \hline
    \(N\)       &        4642         \\
    \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}
    }
    
    .

    Comment


    • #3
      Glad to hear from you once again Prof. Thank you for your help again as well. I will give it a short and revert.

      Best Regards,

      Felix

      Comment


      • #4
        Thank you so much Prof. your trick of getting the treatment effect estimates to LaTeX worked perfectly for me. I'm very grateful for your kind technical supports always.

        Comment

        Working...
        X