Announcement

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

  • generate dummy variables

    Hi everyone,
    i'm a Master Economics student and i'm new to the use of Stata, so i need some help
    I have a continuos variable called "Deal_size" and i would like to generate a dummy variable according to the variable "Deal_size" itself.
    In other words, i want a dummy variable=0 if deal_size is >= to 50000 and equal to 1 if Deal_size<50000.
    How can i??
    Thank you in advance!
    V

  • #2
    try this:
    Code:
    gen byte dummy = deal_size<5000
    replace dummy=. if deal_size==.
    you may or may not need (or want; you did not say what your rule was if deal-size was missing) the last line

    Comment


    • #3
      it worked! thank you so much!!

      Comment

      Working...
      X