I nned to merge my statefip code and county code in a specific form.
Like if the statefip = 1 and county code = 9, then the combined state_county code should look like = 1009
If the statefip = 1 and county code = 21, then the combined state_county code should look like = 1021
If the statefip = 1 and county code = 132, then the combined state_county code should look like = 1132.
May I kindly have some idea how I can do that? I have almost 60,000 observations, and doing this manually will take up a lot of time. I'm giving a sample of my data here
Like if the statefip = 1 and county code = 9, then the combined state_county code should look like = 1009
If the statefip = 1 and county code = 21, then the combined state_county code should look like = 1021
If the statefip = 1 and county code = 132, then the combined state_county code should look like = 1132.
May I kindly have some idea how I can do that? I have almost 60,000 observations, and doing this manually will take up a lot of time. I'm giving a sample of my data here
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte statefip int county 1 1 1 3 1 5 1 7 1 9 1 11 1 13 1 15 1 17 1 19 1 21 1 23 1 125 1 127 1 129 end
Comment