Announcement

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

  • How to write a local variable as a set of dummies

    Hi everyone,
    I am a beginner, so my question could sound fool for someone, sorry about that.

    I'm working with a set of 51 dummies and I need to create a local variable to collect them all.
    Dummies are generated from the same variable, so they have the same name with a different scalar at the end [every dummy is called "birth_state(number)"].
    Could I implement a loop? How?

    Thank you a lot


  • #2
    can you provide us with more details? If possible, use -dataex-.

    Comment


    • #3
      You could use a local macro to store the indicator (you say "dummy") names as say


      Code:
      local myindicators birth_state1-birth_state51
      but there is rarely need or advantage in doing that. In most contexts you can just refer to the wildcard directly, as say birth_state1-birth_state51 In fact, using factor variable notation often makes holding such indicators unnecessary,

      Code:
      help fvvarlist

      Comment

      Working...
      X