* this code assumes that one is already in the directory data_generation/datasources/Political_vars/Propvote

use countryname ifs year pluralty pr housesys liec using http://siteresources.worldbank.org/INTRES/Resources/469232-1107449512766/DPI2012.dta, clear
recode liec pluralty pr housesys (-999 = .)
drop if mi(liec)
label variable liec "Legislative Electoral Competitiveness (WB DPI 2012)"
gen democracy=liec==7
label var democracy "score of 7 on WB-DPI LIEC (2012)"
gen propvote=(2+pr - housesys - pluralty)/3
label var propvote "(2+pr - housesys - pluralty)/3 (WB DPI 2012)"
drop pluralty pr housesys
gen propdem=propvote
recode propdem (. = 0)
replace propdem=propdem*democracy
label var propdem "proportional democracy (WB DPI 2012 LIEC=7 x propvote)"
merge m:1 ifs countryname using IFS_ISO_translation.dta, keepusing(ISO3code) keep(3) nogenerate
append using additional_data.dta // these are hand-collected by me (Holger Spamann) and an RA (Dominika) from Wikipedia and similar sources, as documented in the folder
duplicates drop
compress
