Hello. I have a dataset like this:
I need to give this instruction: in the row where x1 == 3, replace the value of c with the value of x3 when x2 == 2. The result must be like this:
How can I do this?
Thanks
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(x1 x2) int x3 byte c 1 1 121 . 2 2 133 . 3 3 132 . 4 4 144 . end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(x1 x2) int(x3 c) 1 1 121 . 2 2 133 . 3 3 132 133 4 4 144 . end
Thanks
Comment