Announcement

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

  • outreg2 and asterisk

    Dear Statalist,

    I am using outreg2 command to construct my regression table as follow:
    Code:
    biprobit (lp = $x1) (tel = $x2), robust
        outreg2 using Table_A.doc,adds(Rho,e(rho), Loglikelihood, e(ll)) dec(3) ///
        drop(i.dcode) addtext(District Dummy, Yes) symbol(a,b,c) replace
    In order to economize the space, I am replacing stars(***) which indicates the level of significance with symbols a, b, c for for 1, 5 and 10% level of significance respectively. However from my above command my result looks as follow
    tel 1.340a
    (0.222)
    rad 0.173a 0.059
    (0.048) (0.042)
    ele 0.497a 0.900a
    (0.106) (0.066)

    In the table above, symbols " a, b, and c " which indicates level of significance should superscripted, meaning that 1.340a is supposed to be displayed as 1.340a.
    Your help will be highly appreciated. Many thanks.

  • #2
    Superscripting takes place in the word processor (here MS word) so you'd need to format it after exporting the table - Stata doesnt have a text format for superscripting (the asterisks are in 'superscripted' position because that is how they are naturally drawn/defined, not because of any formatting that -outreg2- is doing.) More importantly, even if you use the unicode superscripted characters ᵃ ᵇ ᶜ ᵈ ᵉ here (assuming you have a recent version of Stata that supports it (>= Stata 13 I think)), you lose the superscripting with -outreg2- because it exports a plain text file .txt that is then converted to MS Word format which leaves you with a regular a, b, c... I suppose you could select some of the naturally superscripted characters such as (these are ascii character codes and the symbols ) 187 ª 188 º 246 ˆ 247 ˜ 248 ¯ 249 ˘ 250 ˙ 251 ˚, but although there is a superscripted ascii code "a" (187) I don't think there is a "b" or "c" . When I run this code, it 'works' in sending superscripted characters to MS Word, but I bet a find/replace in Word after the export will be a faster solution for what you need.

    Code:
    sysuse auto, clear
    
     
    recode rep78 (4/.=0) (1/3=1)
    biprobit (for = mpg) (rep78 = price), robust
        outreg2 using Table_A.doc,adds(Rho,e(rho), Loglikelihood, e(ll)) dec(3) ///
          addtext(District Dummy, Yes) symbol( ª,º,c ) replace
    Eric A. Booth | Senior Director of Research | Far Harbor | Austin TX

    Comment


    • #3
      Many thanks eric.

      Comment

      Working...
      X