Announcement

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

  • Renaming names of variables in a stata graph output

    Dear Statalisters,

    Hello.

    I am relatively new to Stata and I am stuck with a small technical problem when creating a graph with marginsplot.
    I am plotting my coefficients on a graph as follows;

    Code:
    *Model1
    quietly xtreg x1 x2 x3 x4 x5 x6 x7 x8 x9 x9, fe
    quietly margins, dydx(*)
    marginsplot, horizontal xline(0) yscale(reverse) recast(scatter) level(90)
    The output graph for the above code is attached.

    What I want to do is to change the variables names of x1~x9 on the y-axis.
    I know I can do this manually, but since I will make many graphs and combine them afterwards, I really hope someone can help me to write a code that will do this.
    I cannot change the names of the variables in the actual dataset because I want to rename the variables into Japanese.
    Attached Files
    Last edited by Tate Kihara; 21 Aug 2016, 04:36.

  • #2
    Code:
    , ylabel(x9 "mylabel 9" x8 "my label 8" x7 "my label 7"...  x1 "my label 1")

    Comment


    • #3
      Stata 14 would allow Japanese variable names, but already in v13 (and perhaps below) you can use Japanese characters in variable labels. You can use those in most graphs, but I cant figure out how to do it for the marginsplot. Perhaps someone else does. That way you could always just refer to the variable labels instead of having to assign labels manually every time.

      Comment

      Working...
      X