I have school level data with the name of different counties they have belonged to across a number of years. Each year has a column for each school, some are missing, some schools might fall into different counties.
1. I want to check how many schools have consistent counties over the year (ignoring any . (missing) values).
2. If schools have consistent counties I want to merge all these 10-15 variables into one giving me the county name if no conflict, and returning "conflict" when conflict, . if data is just missing.
Screenshot is attached.
Array
Related Posts with Extracting unique strings from multiple variables for each observation
snapshot with descriptive names instead of numbersI just upgraded to Stata 16 today and I was experimenting with the new frames feature. This allows a…
How to execute a Matlab script from StataHi all, I'd like to run a Matlab script from within my Stata Do-File. Haven't done this before, but…
Adoupdate not working in new installationDear users, I recently installed Stata 15 in a new machine with Windows 10. I first download -ftools…
Combine cases, but keep values from each.I'd like to combine cases, but in an unusual way -- by keeping values from each. For example, start …
Combine multiple columns into oneHi all, If there is a loop like following: Code: forv y = 2009/2012 { forv p = 1/20 { egen `…
Subscribe to:
Post Comments (Atom)
0 Response to Extracting unique strings from multiple variables for each observation
Post a Comment