Hi guys,
I have one quick question since I am little confused how to do it while dealing with the big dataset. I have generated a fake data here to put up my question. As you can see three variables in the example first one is id, the second one is wave and third which is the last variable is about insurance. As you can see here in wave 1 it is asked if somebody is insured as shown by 1 otherwise missing. Now here is my question. If an ID is insured in wave 1, I want to replace 1 in rest of the waves for that ID otherwise missing. Thanks for the help.
----------------------- copy starting from the next line -----------------------
I have one quick question since I am little confused how to do it while dealing with the big dataset. I have generated a fake data here to put up my question. As you can see three variables in the example first one is id, the second one is wave and third which is the last variable is about insurance. As you can see here in wave 1 it is asked if somebody is insured as shown by 1 otherwise missing. Now here is my question. If an ID is insured in wave 1, I want to replace 1 in rest of the waves for that ID otherwise missing. Thanks for the help.
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(id wave insurance) 12 1 1 12 2 . 12 3 . 13 1 . 13 2 . 13 3 . 14 1 1 14 2 . 14 3 . 15 1 . 15 2 . 5 3 . 16 1 1 16 2 . 16 3 . 17 1 . 17 2 . 17 3 . end
Comment