Announcement

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

  • How to create a categorical variable

    I have a few variables that Stata is recognizing as a continuous, rather than categorical variable. For example, a color category includes 1-7 where 1=white, 2=black, 3=green, etc.

    Is there a place in the Data Editor to indicate which variables should be categorical?

    Thank you.

  • #2
    Originally posted by Daniel Kim View Post
    Is there a place in the Data Editor to indicate which variables should be categorical?
    No.

    I assume that you're having trouble with Stata's recognizing the variables as categorical when used as predictors in estimation commands (regression models). For that
    Code:
    help factor variables

    Comment


    • #3
      And, if you're looking to assign value labels to values (1 = white, 2 = black etc.) of the categorical variable, then
      Code:
      help label

      Comment


      • #4
        Ok great, thank you very much. I will give this a try.

        Comment

        Working...
        X