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
xtivreg2 with time fixed effectsHello I want to find the causal effect of the number of new electric vehicles on the number of char…
Splitting Multiple Response VariableI have a multiple response variable that may take any combination of responses between 1 to 5 and 97…
Outreg2 and other issues with xtprobitHi all, I have a few questions regarding my code below: 1- Using Code: xtset dep time gives me th…
syntax: add a minus before a list of variablesDear Stata users, I want to make a convenient wrapper using gsort command. My question is how to ad…
How to convert a scalar value into a large matrixSay I have a value of 2 How can I convert this into say a [50,1] matrix such that it is the same si…
Subscribe to:
Post Comments (Atom)
0 Response to Identifying observations of var1 that have different values for var2
Post a Comment