Announcement

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

  • Exporting to .tex files with estout and esttab with interaction terms

    I have a question regarding the estout and esttab packages, avaible from ssc. I am using Stata IC 13.1 on Windows 7 and the newest version of estout.

    What I want to do is export results from regressions to tex files. The problem is that estout and esttab are not replacing the #s in the .tex output as I expect which causes a problem when compiling the .tex file. I have constructed a small example to show what I mean:

    Code:
    sysuse auto, clear
    reg price c.weight##foreign
    estimates store est1
    
    estout est1, style(tex)
    esttab est1, tex
    In both of these cases, the output still contains the #s, which would need to be in a math environment in Latex. In the estout help file it says

    interaction(string) specifies the string to be used as delimiter for interaction terms
    (only relevant in Stata 11 or newer). The default is interaction(" # "). For style(tex)
    the default is interaction(" $\times$ ").
    But that doesn't seem to be the case, even if I add the interaction(" $\times$ ") option. What am I doing wrong?

    EDIT: If I add the -label- option, everything seems to be working as it should. But why not without that option?
    Last edited by Janko Fromme; 11 Nov 2014, 07:48.

  • #2
    You need to specify the label option, additionally. Try

    Code:
    sysuse auto ,clear
    reg price c.weight##i.foreign
    estout ,style(tex) label
    Best
    Daniel
    Last edited by daniel klein; 11 Nov 2014, 07:54. Reason: spelling error in -est[t]out-

    Comment


    • #3
      Dear Daniel,

      thank you! That seems to be the problem. Is there a specific reason, why the #s aren't replaced if I don't specify the label option?

      Comment


      • #4
        My guess is that the # is considered part of the variable name (although this is strictly speaking illegal), and without the label option estout outputs those variable names. You might consider contacting Ben Jann, author of estout, and suggest a change. However the current behavior seems consistent from my perspective.

        Best
        Daniel

        Comment


        • #5
          I just wish this issue would be clarified in the help file. But thank you again for your quick help!

          Comment

          Working...
          X