Announcement

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

  • outreg2 adding information on list of units in the regression

    Hello,
    it's just a general question: i tried to add information on the list of countries used in the regression using outreg2 command, but I only succeeded on number of countries, not the list.
    I used
    Code:
    levelsof country if e(sample)
    local n_countries = `r(r)'
    and put
    Code:
    outreg2 ... addtext(Countries, `n_countries')
    I tried to find previous posts regarding this question, but I couldn't find it..
    Someone could help me, please?

  • #2
    I know almost nothing about outreg2 (from SSC, as you are asked to explain) but for this question you don't need posts on Statalist.

    The help for levelsof explains saved results: you seem to need to use r(levels) not r(r).

    That said, I've not tried using its output with outreg2.

    Code:
    . sysuse auto, clear
    (1978 automobile data)
    
    . levelsof rep78
    1 2 3 4 5
    
    . ret li
    
    scalars:
                      r(N) =  69
                      r(r) =  5
    
    macros:
                 r(levels) : "1 2 3 4 5"

    Comment


    • #3
      Nick Cox Thanks a lot for your reply.
      I changed to `r(levels)', however I have the following error:
      Code:
      `"TTT"'
      10 13 16 20 21 22 24 26 27 28 29 31 45 49 55 58 61 62 69 72 73 77
      invalid '13'
      r(198);
      do you have any insights with this error?

      Comment


      • #4
        Sorry to disappoint, but no. The distinction I made is strong for me. levelsof I think I understand, as I first wrote it. outreg2 I don't think I have ever used, so I stop there.

        Comment


        • #5
          or is there any other command to solve this issue with using other command instead of outreg2?

          Comment


          • #6
            Again, I can't comment helpfully on that.

            But many people here use outreg2 or one of the alternatives and they may be able to comment.

            Comment

            Working...
            X