block by michalskop 91a24fcaba5e2caa42d8a596f8abf4a2

CZ: Elections 2017, PCA

Full Screen

Political map of Czechia - Elections 2017

Position of districts, towns, regions in a political space based on the elections results. Mathod: Weighted MDS, rotated by PCA

Analysis flow

  1. Download from https://volby.cz/opendata/ps2017/ps2017_opendata.htm
  2. cz_2017_okrsky_neuplny.csv - manually from pst4p.csv (pivot table) and pst4.csv
  3. more_info_okrsky.py - using info from previous elections (ep_2014_okrsky.csv)
  4. manually add missing info to cz_2017_okrsky.csv using https://volby.cz/pls/ps2017/ps311?xjazyk=CZ&xkraj=2&xobec=500194
  5. csv2matrix_db_selected_voted.py - distance matrix based on sample: raw_matrix_voted.csv
  6. create manually pbop.csv+ correct manually Praha’s subregion id, using e.g. https://volby.cz/pls/ps2017/ps34?xjazyk=CZ&xkraj=4&xobec=554791
  7. create districts.csv manually from cz_2017_okrsky.csv
  8. district2regions.py - creating regions_1.csv, regions_2.csv, regions_3.csv and regions_4.csv
  9. manually cz_total.csv from regions_1.csv
  10. anal.r
  11. create_data2show.py creates data2show.csv
  12. add_parents.py
  13. ellipse sizes manually cz_2017_show.ods

index.html

add_parents.py

anal.r

create_data2show.py

csv2matrix_db_selected_voted.py

more_info_okrsky.csv

cz_2017_party.csv

cz_coords.csv

cz_coords_rot.csv

d3.tip.js

districts2regions.py

more_info_okrsky.py

party_coords.csv

pbop_coords.csv

pbop_coords_rot.csv

regions_0.csv

regions_1.csv

regions_2.csv

regions_4.csv

regions_coords.csv

regions_coords_rot.csv

subregions_coords.csv

subregions_coords_rot.csv

zahranicni_okrsky.csv