Hello,
I'm working with ACS data in Stata 13, but I have access to Stata 14 if necessary.
ACS provides the variable MIGPUMA1 (where the respondent lived last year), which is one or many PUMAs combined. I also have the PUMA variable (where they live now). MIGPUMA1 and PUMA sometimes have the same codes, but usually their codes are different. I want to compare these areas using the larger unit of analysis, MIGPUMA1. The only "crosswalk" provided is an Excel sheet that has the PUMA code in column E and the MIGPUMA1 code in column F.
Is there a way to create a variable, let's say MIGPUMA0 (the larger unit of analysis which would specify where the person lives now), using this Excel sheet and my existing individual level data without having to write 2081 if statements? (There are 2081 PUMA codes).
So far, all I can think of would be something like the following, but I know the coding is wrong. This is just the best way I can think to illustrate what I want:
But I don't know what the code would actually be or how I would direct Stata to look at the Excel sheet (or the sheet as a secondary data file in Stata).
Thank you for any assistance you can offer.
I'm working with ACS data in Stata 13, but I have access to Stata 14 if necessary.
ACS provides the variable MIGPUMA1 (where the respondent lived last year), which is one or many PUMAs combined. I also have the PUMA variable (where they live now). MIGPUMA1 and PUMA sometimes have the same codes, but usually their codes are different. I want to compare these areas using the larger unit of analysis, MIGPUMA1. The only "crosswalk" provided is an Excel sheet that has the PUMA code in column E and the MIGPUMA1 code in column F.
Is there a way to create a variable, let's say MIGPUMA0 (the larger unit of analysis which would specify where the person lives now), using this Excel sheet and my existing individual level data without having to write 2081 if statements? (There are 2081 PUMA codes).
So far, all I can think of would be something like the following, but I know the coding is wrong. This is just the best way I can think to illustrate what I want:
Code:
gen migpuma0=(columnF) if puma==(columnE)
Thank you for any assistance you can offer.
Comment