Dear all,
I am looking to replace by pidp the missing and the negative values in racel_bh, with the only positive value reported over the time period. In the following examples the value that substitute the other is 1 but this takes a range of 1-18. The variables is recorded from wave 13 but the individuals can enter the panel before or after. I am required to replace it from wave 13 (included) since before I have a different variable.
I am looking to replace by pidp the missing and the negative values in racel_bh, with the only positive value reported over the time period. In the following examples the value that substitute the other is 1 but this takes a range of 1-18. The variables is recorded from wave 13 but the individuals can enter the panel before or after. I am required to replace it from wave 13 (included) since before I have a different variable.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long pidp float wave byte(racel_bh) 1073047 11 . 1073047 12 . 1073047 13 1 1073047 14 -8 1073047 15 -8 1073047 16 -8 10485684 13 . 10485684 14 1 10485684 15 -8 10485684 16 -8 10499284 14 1 10499284 15 -8 12545878 15 1 12545878 16 -8 12545878 17 -8 12545878 18 -8 68441325 13 . 68441325 14 . 68441325 15 1 68441325 16 -8 68441325 17 -8 68441325 18 -8 end label values racel_bh bm_racel_bh label def bm_racel_bh -8 "inapplicable", modify label def bm_racel_bh 1 "White British", modify
Comment