Announcement

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

  • Problem decoding numeric to string variable

    Hi all,

    I have a fairly simple problem but am struggling to decode a byte variable into a string variable for analysis.
    codebook t_style

    ------------------------------------------------------------------------------------------------------
    t_style A
    ------------------------------------------------------------------------------------------------------

    type: numeric (byte)

    range: [1,3] units: 1
    unique values: 3 missing .: 0/90

    tabulation: Freq. Value
    30 1
    30 2
    30 3

    Anyway, I labeled these values:
    label define t_style 1 "Permissive" 2 "Authoritarian" 3 "Democratic"

    However, when I tab this variable, the labels do not come up. When I try to decode the variable, this is what I end up with:
    . decode t_style, generate(t_style_string)
    t_style not labeled

    But label list DOES say it's labeled:
    label list
    t_style:
    1 Permissive
    2 Authoritarian
    3 Democratic

    Where am I going wrong with this??

    Thanks!

  • #2
    you have defined the label but not attached it;
    Code:
    help label
    la val t_style t_style
    please use code delimiters in the future as what you posted is not easy to read and thus I may well have made a typo (see the FAQ on how to use code delimiters)

    Comment

    Working...
    X