Hello,
I'm kindly requesting for guidance on this.
I am trying to create a variable age whose information is based on four variables.
In this case, if an observation/id has a value for one variable, it should have data for the other 3.
An example of the code is below.
I'm not sure if the explanation is helpful but I want to create a variable age with just one value based on the variables age_m age_f age_j and age_p
I'll be grateful for any help.
Thanks.
I'm kindly requesting for guidance on this.
I am trying to create a variable age whose information is based on four variables.
In this case, if an observation/id has a value for one variable, it should have data for the other 3.
An example of the code is below.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(ptid age_m age_f age_j age_p) 1 23 . . . 2 . 44 . . 3 . 16 . . 4 45 . . . 5 . 51 . . 6 65 . . . 7 . . 27 . 8 . . . 36 end
I'll be grateful for any help.
Thanks.
Comment