Announcement

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

  • Is there a command for quickly splitting a categorical variable into multiple binary variables?

    Is there a command to split a categorical variable into binary variables? For example, splitting a "race" variable with values "white, black, hispanic" to three variables: race1, race2, race3 where race1 = 1 if race = "white" etc.
    Just wondering if someone created a command like this since it would save a lot of time!

  • #2
    The command concerned has been in Stata for its entire history, although I can't be certain about the option. tabulate, gen() does what you want.

    That said, factor variable notation is usually preferable.

    Comment


    • #3
      Thank you Nick!

      Comment

      Working...
      X