Announcement

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

  • Variable Problem

    Hi, everybody,
    How can I change observations with non-numerical content?
    I have a variable that is numerical, but due to typing errors I have in some observations "15kg" "first harvest", I would like to give a unique value to all of them

    How can I do it quickly?

  • #2
    Post an example of your data with -dataex- and say how you want the new variable to look like.

    Comment


    • #3
      For Example:

      876. | XXXAA - 2015 |
      877. | GGGTR - 2002 |
      878. | 0 |
      879. | 0 |
      880. | WERT - 2002 |
      |--------------|
      881. | AERT - 2002 |
      882. | XXXX - 2015 |
      883. | AXXX - 2002 |
      884. | ASXXX - 2002 |
      885. | XXLL - 2002 |
      |--------------|
      886. | BHGF - 2002 |
      887. | AFFSL - 2002 |
      888. | YTGFL - 2015 |
      889. | AHGFGL - 2002 |
      890. | AGHGH - 2002 |
      |--------------|
      891. | ASHH - 2002 |
      892. | ASFHHHL - 2002 |
      893. | AEREL - 2002 |
      894. | ASDSG - 2003 |
      895. | 0 |
      |--------------|

      I WANT TO GIVE THEM THE VALUE OF 1
      Last edited by Fiamma Benson; 03 Aug 2020, 02:11.

      Comment


      • #4
        Maybe
        Code:
        replace var = "1" if missing(real(var))
        That's a whole lot of typing errors. Are you sure that you want to trust anything from this source of data?

        Comment


        • #5
          Originally posted by Joseph Coveney View Post
          Maybe
          Code:
          replace var = "1" if missing(real(var))
          That's a whole lot of typing errors. Are you sure that you want to trust anything from this source of data?
          Believe me, no!!! and there are more such mistakes in other variables plus illogical things

          Comment

          Working...
          X