Announcement

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

  • Replacing missing values in an address variable

    I really need help, I have data that looks similar to this:
    id Wave Address change Previous address
    1 1 890 no change .
    2 1 440 address change 22
    3 1 330 no change .
    4 1 440 no change .
    5 1 600 emigrated .
    1 2 . no change
    2 2 . no change
    3 2 360 address change 330
    1 3 500 adress change 330
    2 3 . no change .


    I need to replace the missing values in the address variable. These are missing because there is "no change" in address, I am unsure how to replace a missing value to equal the last recorded observation for that individual (and it will be in a different wave) e.g replace the missing value in address for id= 1 and wave = 2, to be equal to 440 when id= 1 and wave =1.











  • #2
    I am confused. In you example, I would think you would want to fill in 890 for id 1, wave 2.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      See if example 5 does what you want. http://www.stata.com/support/faqs/da...issing-values/
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment

      Working...
      X