Announcement

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

  • Replacing observations with charachters

    I am using the following command:


    gen Cou_Code_O=. in 1/26

    replace Cou_Code_O = "ARG" in 1


    and get this warning:

    ARG not found


    It is a bit strange since you can replace observations in Stata with characters.


    Am I missing something or it is just Stata 14 that didn't allow this command?






  • #2
    You created a variable that was numeric and then tried to put ARG into it. Stata does not know any such variable.

    By the way, I have to doubt that you really typed the β€œ β€œ quotation marks. If you had then the error message would be of a type mismatch. Or so I guess: I am away from a computer at the moment.

    If you want a string variable, initialize it with

    Code:
    gen wanted = β€œARG” in 1/26
    You were right to tell us that you are using Stata 14, although the error is not related to version. The FAQ advises telling us if you are using an outdated version.

    Comment


    • #3
      Thanks a lot Nick.

      Comment

      Working...
      X