Announcement

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

  • estpost tabstat, esttab loop

    Hi!

    I have encountered some problems while trying to export my summary statistics to an excel file.

    Please find below my codes:

    local LFPworking_Sum "work_earning1 work_hrs1 work_earning2 work_hrs2"
    foreach var in `LFPworking_Sum' {
    estpost tabstat `var' if survey_string == "2f" & work == 1, statistics (mean sd n) columns(statistics)
    esttab using Section4_LFPworking_Sum.xls, cells(mean sd n) append
    }

    The commands have successfully exported the result to a single excel file. However, the formatting is all wrong and unreadable. Please refer to the attached screenshot.

    Click image for larger version

Name:	2022-04-01.jpg
Views:	1
Size:	168.1 KB
ID:	1657300



    Could someone kindly help?

    Millions of thanks in advance!


  • #2
    Refer to the "Document format" section of the documentation for -esttab-. -esttab- cannot export to Excel files like .xls or .xlsx. You have created a plain text file with a .xls extension. The most similar document format supported by -esttab- is CSV, so I recommend seeing if that works for your purposes.

    Comment


    • #3
      Millions of thanks! It's working perfectly now!

      Comment

      Working...
      X