Announcement

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

  • How to export variable labels using outreg2 - label option not working?

    Hi all

    I want to export my regression tables, showing variable labels instead of names, using the outreg2 command.

    After running a regression I do:

    outreg2 using "My_results1", replace word label dec(3) sideway noobs

    but that results in:
    ) required

    I've tried adding one of the specifications:

    outreg2 using "My_results1", replace word label(proper) dec(3) sideway noobs

    This works, but it still does not export my labels (only variable names).

    Working in Stata 16.0
    I did an 'update all' before starting.


    Am I using the wrong option here? Can anyone check for themselves whether the word + label option works for you?

    Thank you.



  • #2
    outreg2 is from SSC, as you are asked to explain (refer to FAQ #12). The -label- option works fine on my version of the command, implying that the problem is either with your version or your variables.

    Code:
    . which outreg2
    c:\ado\plus\o\outreg2.ado
    *! outreg2 2.3.2  17aug2014 by [email protected]
    *! based on outreg 3.0.6/4.0.0 by [email protected]
    If you don't have this version:

    Code:
    ssc install outreg2, replace
    Here is a reproducible example that may help.
    Code:
    sysuse auto, clear
    regress price mpg weight i.rep7
    outreg2 using "myfile", replace word label dec(3) sideway noobs
    You want to get the first column as:

    Code:
    VARIABLES
    
    Price
    Mileage (mpg)
    Weight (lbs.)
    Repair Record 1978 = 2
    Repair Record 1978 = 3
    Repair Record 1978 = 4
    Repair Record 1978 = 5
    Constant
    
    R-squared

    Comment


    • #3
      Thank you Andrew.
      My version of outreg2 was up-to-date.
      I found what was causing outreg2 to ignore my -label- option: my dependent variable had a long label; something like "RECODE of Q2 - Did you participate in (the event which is my case)?"
      After changing that label to a shorter one, everything works fine.

      Comment

      Working...
      X