Announcement

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

  • How to export difference-in-differences table from Stata to Latex?

    I'm trying to export the results from a difference-in-differences from Stata to Latex. I tried the following commands:

    Code:
    diff var, t(type) p(period)
    , which gives a nice table in Stata, however, I don't know how to export this to Latex

    I also tried
    Code:
     ieddtab var, time(period) treatment(type)
    , where I also couldn't find the option to export the displayed table to Latex.

    Any suggestion on the commands above or any other command / way how to best handle these tables to be exported from Stata to Latex?

    Many thanks!

  • #2
    You will increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using datex.

    There are several user-written procedures for creating tables in Word or Latex, or whatever - google it. I like outreg2, but there are many others. If you search for outreg2 on Statalist, you'll find others mentioned as well. If you want to simply copy from Stata, you can use copy with the copy table or copy html option. This can be pasted into excel or another document with reasonable results.

    Comment


    • #3
      One solution can be to use esttab:

      esttab: eststo clear
      eststo: quietly diff var, t(type) p(period)
      esttab using Diff_Diff.tex, se(2)

      where Diff_Diff is the name of the file and se(2) displays standard errors in 2 decimal places. This will create a .tex file in the folder where your .dta file is. In your Latex document use:

      \input{Diff_Diff.tex}

      Comment


      • #4
        Hi,

        Although this is a bit late but for others the following might help

        Code:
        outreg2 using file_name,  addstat(Mean control t(0), r(mean_c0), Mean treated t(0), r(mean_t0), Diff t(0), r(diff0), Mean control t(1), r(mean_c1), Mean treated t(1), r(mean_t1), Diff t(1), r(diff1)) label nor2  tex
        alternatively you can use STATA's native DiD command.

        Comment

        Working...
        X