How could add an identificator to an observation when some of them have the same value?
For example,
idhh rel
11 Jefe(a)
11 Conyuge
11 Hijo
11 Hijo
11 Nieto(a)
11 Nieto(a)
For example, idhh = Household ID, and rel = relationship. So I need to add a suffix or tag to those observations that are the same. For example, Hijo01, Hijo02, or Nieto(a)01, Nieto(a)02. I can“t do it one by one, because my dataset contains 83,000 observations, and many households have the same characteristic.
For example,
idhh rel
11 Jefe(a)
11 Conyuge
11 Hijo
11 Hijo
11 Nieto(a)
11 Nieto(a)
For example, idhh = Household ID, and rel = relationship. So I need to add a suffix or tag to those observations that are the same. For example, Hijo01, Hijo02, or Nieto(a)01, Nieto(a)02. I can“t do it one by one, because my dataset contains 83,000 observations, and many households have the same characteristic.
Comment