Announcement

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

  • Dummy variable

    Will this be right if I create a new variable say games to have values of 1 from each variable


    Variables
    mj takes on values of 1 for participation in this game and 0 for not participating

    me takes on values of 1 for participation in this game and 0 for not participating

    op
    takes on values of 1 for participation in this game and 0 for not participating

    any
    takes on values of 1 for participation in this game and 0 for not participating




    Code:
    gen games =0

    Code:
    replace games=1 if mj==1| me==1 |op==1 |any==1

  • #2
    That will give you a variable that is 1 if for participation in any of the games, and 0 for participation (or unknown participation) in all of them. If that's what you want, that code will work. But you can do it more simply than that:

    Code:
    gen games = inlist(1, mj, me, op, any)

    Comment

    Working...
    X