Announcement

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

  • Define a dummy variable (if else)

    Hi everyone:


    I want to define a dummy variable, rosneg, which is equal to one if ros<0 and equal to zero if ros ≥ 0. Use CEOSAL1.RAW to estimate the model

    What should I do to get the correct command?


    thanks

  • #2
    I have no idea what your second sentence means; for your first sentence, your request, try the following:
    Code:
    gen byte rosneg=ros<0
    replace rosneg=. if ros==.
    you may or may not need, or want, the second command

    in the future, please use -dataex- (and please read the FAQ)

    Comment


    • #3
      Use CEOSAL1.RAW
      This sounds like the reference to a SAS dataset which doesn't affect the advice you are after here. However, if that really is important, you should tell us why with more words.

      Comment

      Working...
      X