Announcement

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

  • Latex formula in eststo estadd

    Hi,

    I am trying to export regression results from Stata to Latex and I want to add a latex formula to the output. The code is the following:

    Code:
    reghdfe y x1 x2 x3, absorb(C#Y)
    estadd local fe "C$\times$Y"
    The $\times$ is the latex formula. When storing the local Stata cuts off the second "$" and the following "Y", so the output only contains "C$\times".

    I tried to escape the "$"

    Code:
    estadd local fe "C\$\times\$Y"
    but the results are the same.

    Does anyone have an idea how to fix this?

    Thanks!

  • #2
    The dollar sign is interpreted as a global macro by Stata. Adding spaces or including both C and Y in the LaTeX code may resolve this.

    Code:
    estadd local fe "C \$\times\$ Y"
    or

    Code:
    estadd local fe "$\text{C}\times\text{Y}$"
    Last edited by Andrew Musau; 17 Dec 2022, 12:34.

    Comment


    • #3
      Both works fine! Thanks for your help, Andrew!

      Comment

      Working...
      X