Changes

Jump to navigation Jump to search
no edit summary
#This is a working title only. The Measuring paper references it under this name for now.
===Instrument for Determinants===
I am going to try shocking the number of ESOs using the political party of the incumbent mayor. Data is available from:
The main steps are:
# Pre-process the data.
## Keep only fips, yeardata, govid_14, name, STATE, mayor_party_final, runnerup_party_final, mayor_votes_final, runnerup_votes_final, mayor_name_final, elecdate, month, ID, FIPS_PLACE_ID, term_length, term_limit, demshare, JURIS
## Remove double-quotes, remove NA, force to UTF8
## Remove duplicate entries (see below)
# Load the data
# prepend zeros to FIPS
# Code mayor_party_final: Variable is DorR, which takes 1 if D, 0 if R and NULL otherwise.
# Blowout years
# Join by GEOID, year
 
There were a small number of erroneous records, which caused duplication at the FIPS-Yeardata level. I manually removed these. For future reference they are (note that geoid is fips with pre-pended zeros where applicable):
SELECT geoid, yeardata, count(*) FROM mayoralelectionsclean GROUP BY geoid, yeardata HAVING count(*) >1;
3956882 2005 2
3916000 2013 2
1882862 2003 2
5323515 2010 4
1842246 2003 2
4824000 2013 2
0973770 2003 2
2567000 1973 2
1710487 2003 2
1255775 2004 2
1840788 2003 2
0952980 2003 2
3539380 2003 2
0943370 2003 2
2622000 2009 2
 
Using this approach I have data for some years for 109 cities in my data, and 83% of the city-year records have democrats or republicans as the winners. It's good enough to try!

Navigation menu