Announcement

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

  • How to switch the values of "encode"d group?

    Dear Statalist,

    I used this code in order to creat new variable and use it as a factor variable later.

    Code:
    encode IMF_dejure, gen (de_jure)
    So it created the value for Fixed Exchange Rate Regime (ERR) = 1, Intermediate = 3 and Floating = 2. But I need Intermediate = 2 and Floating = 3. How I can switch the values between floating and intermediate ERRs?

  • #2
    I found the decision. It seems it is creating the values according to the alphabetical order of the old variable. Thank you~

    Comment


    • #3
      to be clear, the answer to your question in #1 is to set up a label prior to using -encode- and then to apply that label via the label() option to the -encode- command; see
      Code:
      h encode

      Comment

      Working...
      X