Announcement

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

  • change value type byte into numeric

    Hi all,

    I am a novice stata user...


    Most of values of my dataset are stored as byte type.

    The thing is, I wanted to change those values into numeric values,

    for example ;

    I wrote a command

    replace m1ac2=1 if m1ac2=="Nam"

    but it keeps saying invalid syntax

    here my var named m1ac2 is stored as byte type...

    How can I handle this issue...

    Please give me some suggestions.


    Many Thanks

    Manny


  • #2
    A byte variable already is numeric. I guess that you are trying to work on the value labels.

    Try this:

    Code:
    tab m1ac2
    
    tab m1ac2, nolabel
    So, if the goal is to produce a numeric variable, you already have one and there is nothing to do.

    Otherwise if you have reason to make other changes, you should tell us what that reason is.

    Comment


    • #3

      I did as you told me.

      I think I made it!!!

      Thank you so much Nick !

      Manny

      Comment

      Working...
      X