I have a dataset in which the data are identified by state, county, and ZIP code - each of these is a different variable.
My problem is that some ZIP codes span over more than one county, so I need to be able to identfy which observation of the variable "ZIP: have different values on the variable "county". Fow example, below, I need to be able to identify that 00112 is a ZIP that has different values (1 and 2) on the variable "county", because it spans across two counties:
County - ZIP
1 - 00111
1 - 00112
2 - 00112
2 - 00113
2 - 00114
What code would allow me to do that for the entire dataset? Thank you in advance!
Related Posts with Identifying observations of var1 that have different values for var2
Missing value: Generating a new variable but only missing values have been generatedHello, I am working on a firm level panel data. I am trying to create a new variable by subtracting…
Quarterly data, year-fixed effectHi, This is more of an Econometrics than a Stata question, I hope you don't mind. I am trying to i…
Question re. F-stat missing in xtreg FE models and potential singleton issue// sorry for the long post - tried to provide all the background info // Dear Statalist community, …
Bivariate Kernal Estimation - optimal bandwidth choiceDear all: I am writing to see if anyone knows a Stata command that helps set the optimal bandwidth …
Parallel trends assumption in the diff commandI've got a doubt about the diff package. You can check the file about it here. I would like to find…
Subscribe to:
Post Comments (Atom)
0 Response to Identifying observations of var1 that have different values for var2
Post a Comment