Announcement

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

  • Labeling Dummy Variables

    Hi
    This may sound silly but I am having problems labeling the Stata output from 0 to YES and 1 to NO. I don't know what I am doing wrong. See below commands and table output. Thank you.

    . la define own_home 0 "yes" 1 "no"

    . fre own_home

    own_home -- do you own a home, recoded ea_1
    -----------------------------------------------------------
    | Freq. Percent Valid Cum.
    --------------+--------------------------------------------
    Valid 0 | 3949 78.28 78.68 78.68
    1 | 1070 21.21 21.32 100.00
    Total | 5019 99.48 100.00
    Missing . | 26 0.52
    Total | 5045 100.00
    -----------------------------------------------------------

  • #2
    after you define a label, you must actually "use" it; you want something like
    Code:
    la val own_home own_home
    see
    Code:
    help label

    Comment


    • #3
      As an aside, coding 0 for yes and 1 for no is going to get you in trouble if you use Stata's logical expressions with these variables later on, since Stata expects the opposite. I suggest you recode these variables and change the value labels accordingly. (Alternatively you could negate the names of the variables: -rename own_home doesnt_own_home-.)
      Last edited by Clyde Schechter; 16 Oct 2021, 19:04.

      Comment

      Working...
      X