Dear Statalist,
I want to fill the missing values, if values of variable "d" is equal to "age". So, in the first row, I want to rellocate all of values in var dest to type into values/row "13" in variable d, and let the first row (d=12) missing because there is not matching values between d and age. In sum, i want to relocate all values if condition "age" equal to "d". What i should to do for this situations?
initial dataset
desired dataset
Thank you in advance
I want to fill the missing values, if values of variable "d" is equal to "age". So, in the first row, I want to rellocate all of values in var dest to type into values/row "13" in variable d, and let the first row (d=12) missing because there is not matching values between d and age. In sum, i want to relocate all values if condition "age" equal to "d". What i should to do for this situations?
initial dataset
id | d | age | dest | type |
1 | 12 | 13 | mountain | primer |
1 | 13 | |||
1 | 14 | |||
2 | 12 | |||
2 | 13 | |||
2 | 14 | 12 | beach | secondary |
id | d | age | dest | type |
1 | 12 | |||
1 | 13 | 13 | mountain | primer |
1 | 14 | |||
2 | 12 | 12 | beach | secondary |
2 | 13 | |||
2 | 14 |
Thank you in advance
Comment