Clustering Value Systems and Worldviews¶



Imports and Settings¶


In [1]:
import numpy as np
import pandas as pd

# preprocessing libraries
from sklearn.preprocessing import MinMaxScaler, StandardScaler

# visualization libraries
import matplotlib.pyplot as plt
import seaborn as sns

# clustering libraries
from sklearn.cluster import KMeans # k-Means and DBSCAN

# evaluation libraries
from sklearn.metrics import confusion_matrix
from yellowbrick.cluster import SilhouetteVisualizer, InterclusterDistance, KElbowVisualizer

# dimensionality reduction libraries
from pca import pca

# make pandas display ALL columns of a dataframe
pd.options.display.max_columns = None
random_state = 42

The Data¶


The Raw Data¶

In [2]:
# read in the file that contains the data
raw = pd.read_csv("WVS_Cross-National_Wave_7_csv_v6_0.csv", low_memory=False)
raw.head()
Out[2]:
version doi A_WAVE A_YEAR A_STUDY B_COUNTRY B_COUNTRY_ALPHA C_COW_NUM C_COW_ALPHA D_INTERVIEW S007 J_INTDATE FW_START FW_END K_TIME_START K_TIME_END K_DURATION Q_MODE N_REGION_ISO N_REGION_WVS N_REGION_NUTS2 N_REG_NUTS1 N_TOWN G_TOWNSIZE G_TOWNSIZE2 H_SETTLEMENT H_URBRURAL I_PSU O1_LONGITUDE O2_LATITUDE L_INTERVIEWER_NUMBER S_INTLANGUAGE LNGE_ISO E_RESPINT F_INTPRIVACY E1_LITERACY W_WEIGHT S018 PWGHT S025 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 Q23 Q24 Q25 Q26 Q27 Q28 Q29 Q30 Q31 Q32 Q33 Q33_3 Q34 Q34_3 Q35 Q35_3 Q36 Q37 Q38 Q39 Q40 Q41 Q42 Q43 Q44 Q45 Q46 Q47 Q48 Q49 Q50 Q51 Q52 Q53 Q54 Q55 Q56 Q57 Q58 Q59 Q60 Q61 Q62 Q63 Q64 Q65 Q66 Q67 Q68 Q69 Q70 Q71 Q72 Q73 Q74 Q75 Q76 Q77 Q78 Q79 Q80 Q81 Q82 Q82_AFRICANUNION Q82_APEC Q82_ARABLEAGUE Q82_ASEAN Q82_CIS Q82_CUSMA Q82_ECO Q82_EU Q82_GULFCOOP Q82_ISLCOOP Q82_MERCOSUR Q82_NAFTA Q82_OAS Q82_SAARC Q82_SCO Q82_TLC Q82_UNDP Q83 Q84 Q85 Q86 Q87 Q88 Q89 Q90 Q91 Q92 Q93 Q94 Q94R Q95 Q95R Q96 Q96R Q97 Q97R Q98 Q98R Q99 Q99R Q100 Q100R Q101 Q101R Q102 Q102R Q103 Q103R Q104 Q104R Q105 Q105R Q106 Q107 Q108 Q109 Q110 Q111 Q112 Q113 Q114 Q115 Q116 Q117 Q118 Q119 Q120 Q121 Q122 Q123 Q124 Q125 Q126 Q127 Q128 Q129 Q130 Q131 Q132 Q133 Q134 Q135 Q136 Q137 Q138 Q139 Q140 Q141 Q142 Q143 Q144 Q145 Q146 Q147 Q148 Q149 Q150 Q151 Q152 Q153 Q154 Q155 Q156 Q157 Q158 Q159 Q160 Q161 Q162 Q163 Q164 Q165 Q166 Q167 Q168 Q169 Q170 Q171 Q172 Q172R Q173 Q174 Q175 Q176 Q177 Q178 Q179 Q180 Q181 Q182 Q183 Q184 Q185 Q186 Q187 Q188 Q189 Q190 Q191 Q192 Q193 Q194 Q195 Q196 Q197 Q198 Q199 Q200 Q201 Q202 Q203 Q204 Q205 Q206 Q207 Q208 Q209 Q210 Q211 Q212 Q213 Q214 Q215 Q216 Q217 Q218 Q219 Q220 Q221 Q222 Q223 Q223_ABREV Q223_LOCAL Q224 Q225 Q226 Q227 Q228 Q229 Q230 Q231 Q232 Q233 Q234 Q234A Q235 Q236 Q237 Q238 Q239 Q240 Q241 Q242 Q243 Q244 Q245 Q246 Q247 Q248 Q249 Q250 Q251 Q252 Q253 Q254 Q255 Q256 Q257 Q258 Q259 Q260 Q261 Q262 X003R X003R2 Q263 Q264 V002 Q265 V001 Q266 X002_02B Q267 V002A_01 Q268 V001A_01 Q269 Q270 Q271 Q272 Q273 Q274 Q275 Q275A Q275R Q276 Q276A Q276R Q277 Q277A Q277R Q278 Q278A Q278R Q279 Q280 Q281 Q282 Q283 Q284 Q285 Q286 Q287 Q288 Q288R Q289 Q289CS9 Q290 Q291G1 Q291G2 Q291G3 Q291G4 Q291G5 Q291G6 Q291P1 Q291P2 Q291P3 Q291P4 Q291P5 Q291P6 Q291UN1 Q291UN2 Q291UN3 Q291UN4 Q291UN5 Q291UN6 Q292A Q292B Q292C Q292D Q292E Q292F Q292G Q292H Q292I Q292J Q292K Q292L Q292M Q292N Q292O Q293 Q294A Q294B Y001 Y002 Y003 SACSECVAL RESEMAVAL I_AUTHORITY I_NATIONALISM I_DEVOUT DEFIANCE I_RELIGIMP I_RELIGBEL I_RELIGPRAC DISBELIEF I_NORM1 I_NORM2 I_NORM3 RELATIVISM I_TRUSTARMY I_TRUSTPOLICE I_TRUSTCOURTS SCEPTICISM I_INDEP I_IMAGIN I_NONOBED AUTONOMY I_WOMJOB I_WOMPOL I_WOMEDU EQUALITY I_HOMOLIB I_ABORTLIB I_DIVORLIB CHOICE I_VOICE1 I_VOICE2 I_VOI2_00 VOICE SECVALWGT RESEMAVALWGT fhregion polregfh freestfh prfhrat prfhscore clfhrat clfhscore democ autoc polity durable regtype ruleoflaw corrupttransp electintegr btiregion btistatus btidemstatus btistate btipolpart btiruleoflaw btistability btiintegration btimarket btigovindex btigoveperform btiregime regionWB incomeWB landWB GDPpercap1 GDPpercap2 giniWB incrichest10p popWB1990 popWB2000 popWB2019 lifeexpect popgrowth urbanpop laborforce deathrate unemployfem unemploymale unemploytotal accessclfuel accesselectr renewelectr co2emis co2percap easeofbusiness militaryexp Trade healthexp educationexp medageun meanschooling educationHDI compulseduc GII DGI womenparl hdi incomeindexHDI humanineqiality lifeexpectHDI homiciderate Refugeesorigin internetusers mobphone migrationrate schoolgpi femchoutsch choutsch v2x_polyarchy v2x_libdem v2x_partipdem v2x_delibdem v2x_egaldem v2x_freexp_altinf v2x_frassoc_thick v2xel_frefair v2xcl_rol v2x_cspart v2xeg_eqdr v2excrptps v2exthftps v2juaccnt v2cltrnslw v2clacjust v2clsocgrp v2clacfree v2clrelig v2csrlgrep v2mecenefm v2mecenefi v2mebias v2pepwrses v2pepwrgen v2peedueq v2pehealth v2peapsecon v2peasjsoecon v2clgencl v2peasjgen v2peasbgen v2cafres v2cafexch v2x_corr v2x_gender v2x_gencl v2x_genpp v2x_rule v2xcl_acjst td_voiacc td_polstab td_goveff td_regqual td_rulelaw td_ctrlcorr ID_GPS ID_PartyFacts Partyname Partyabb CPARTY CPARTYABB Type_Values Type_Populism Type_Populist_Values Type_Partysize_vote Type_Partysize_seat GPS_V4_Scale GPS_V6_Scale GPS_V8_Scale GPS_V9 GPS_V10 GPS_V11 GPS_V12 GPS_V13 GPS_V14 GPS_V15 GPS_V16 GPS_V17 WVS_LR_PartyVoter WVS_LibCon_PartyVoter WVS_Polmistrust_PartyVoter WVS_LR_MedianVoter WVS_LibCon_MedianVoter v2psbars v2psorgs v2psprbrch v2psprlnks v2psplats v2xnp_client v2xps_party
0 6-0-0 (2024-04-30) doi.org/10.14281/18241.24 7 2018 2 20 AND 232 AND 20070001 20720001 20180704 201807 201809 18.20 19.48 88 2 20007 20005 -4 -3 20005.0 5 3 1 1 -4 1.52 42.51 -5 810 ca 1 1 -4 1.0 0.996016 0.006845 202018 1 1 1 3 1 4 1 1 2 1 1 2 2 2 2 2 1 1 2 1 2 2 2 1 2 2 3 3 3 3 3 3 4 2 2 1 3 3 3 4 3 2 3 3 2 2 3 1 1 3 10 10 5 4 4 4 4 4 1 2 1 2 2 2 2 2 1 -4 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 -4 -4 -4 -4 -4 -4 -4 2 -4 -4 -4 -4 -4 -4 -4 -4 -4 2 2 2 2 2 2 2 6 -2 3 -2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 8 2 10 2 2 2 -2 -2 -2 -2 -2 1 2 6 5 1 -2 0 2 0 -2 2 0 2 1 4 4 4 4 4 4 4 2 2 2 2 2 2 2 4 2 4 1 2 1 1 4 3 1 1 3 7 6 7 5 2 6 7 1 1 2 1 3 1 7 6 3 1 2 2 4 1 1 1 1 1 4 3 2 5 4 1 1 1 1 1 1 1 1 1 2 4 4 2 2 2 2 1 5 5 5 5 2 2 3 3 3 3 3 3 3 3 3 3 3 1 1 20001 20001 20001 3 4 2 3 1 2 3 4 2 3 2 2 4 4 4 2 3 6 7 2 8 8 1 7 7 7 6 8 8 8 2 5 1 1 1 1 1 2 1958 60 5 3 2 2 0 2 0 724 ES 724 ES 724 ES 2 2 1 1270 1 2 3 20003 2 3 20003 2 3 20003 2 3 20003 2 1 1 4 7 9 2 2 3 3 5 2 1 10100000 20001 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 1 1 0 0.287062 0.413241 0.0 NaN 0.66 0.38258 1.00 0.0 1.0 0.666667 0.0 0.0 0.0 0.0 NaN 0.00 0.00 0.09900 1.0 1.0 0.0 0.666667 0.75 0.66 0.66 0.690000 0.333333 0.111111 0.444444 0.296296 0.00 0.0 0.000 0.000 0.830 1.0 4.0 3.0 94.0 1.0 39.0 1.0 55.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 6.0 4.0 470.0 0.0 0.0 -9999.0 -9999.0 54509.0 65390.0 77142.0 -9999.0 0.18 87.98 -9999.0 4.4 -9999.0 -9999.0 -9999.0 100.0 100.0 86.12 469.38 6.07 -9999.0 -9999.0 -9999.0 10.32 3.2 -9999.0 10.2 0.708 10.0 -9999.0 -9999.0 46.43 0.857 0.935 -9999.0 0.951 0.0 0.0 91.6 107.3 -9999.0 0.96 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 1.11 1.6 1.9 1.23 1.57 1.23 -999.0 -999.0 NaN NaN NaN NaN -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 5.944634 3.908421 62.434211 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0
1 6-0-0 (2024-04-30) doi.org/10.14281/18241.24 7 2018 2 20 AND 232 AND 20070002 20720002 20180714 201807 201809 9.35 11.00 85 2 20003 20002 -4 -3 20002.0 3 2 2 1 -4 1.53 42.51 -5 810 ca 1 1 -4 1.0 0.996016 0.006845 202018 1 1 1 4 1 4 1 2 1 1 2 1 2 2 2 2 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 4 2 2 1 4 2 2 4 2 2 2 2 2 2 1 1 1 1 9 9 9 4 4 4 4 4 1 2 1 2 2 3 2 2 4 -4 3 3 4 3 3 4 4 4 3 2 3 3 3 3 3 3 3 -4 -4 -4 -4 -4 -4 -4 3 -4 -4 -4 -4 -4 -4 -4 -4 -4 3 3 3 3 3 3 3 6 3 3 2 0 0 2 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 2 2 2 2 3 10 3 3 3 3 3 1 3 2 4 2 2 1 0 0 2 0 1 2 1 4 4 4 4 4 4 4 2 2 2 2 2 2 2 4 4 4 2 2 1 1 4 4 2 1 4 9 9 9 2 2 10 1 2 2 2 2 3 3 7 8 4 2 2 2 -2 1 1 1 1 1 9 5 9 9 10 1 9 1 1 1 1 5 1 1 1 4 4 4 2 2 2 5 1 1 1 1 1 1 2 2 2 1 2 1 1 1 2 2 3 1 1 20001 20001 20001 1 4 1 4 1 1 3 4 1 1 1 1 4 4 4 2 4 5 9 7 10 6 1 10 4 5 10 10 6 6 1 1 1 1 1 1 1 1 1971 47 4 2 1 2 0 2 0 20 AD 724 ES 724 ES 1 4 1 1270 2 0 7 20007 3 6 20006 3 3 20003 2 3 20003 2 1 1 1 3 4 2 1 1 2 9 3 1 10100000 20001 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 2 3 -1 0.467525 0.519722 0.0 0.00 0.66 0.22000 1.00 1.0 1.0 1.000000 0.0 0.0 0.0 0.0 NaN 0.66 0.66 0.65010 0.0 0.0 0.0 0.000000 0.75 0.66 0.66 0.690000 0.888889 0.888889 0.888889 0.888889 1.00 0.0 0.500 0.500 0.915 1.0 4.0 3.0 94.0 1.0 39.0 1.0 55.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 6.0 4.0 470.0 0.0 0.0 -9999.0 -9999.0 54509.0 65390.0 77142.0 -9999.0 0.18 87.98 -9999.0 4.4 -9999.0 -9999.0 -9999.0 100.0 100.0 86.12 469.38 6.07 -9999.0 -9999.0 -9999.0 10.32 3.2 -9999.0 10.2 0.708 10.0 -9999.0 -9999.0 46.43 0.857 0.935 -9999.0 0.951 0.0 0.0 91.6 107.3 -9999.0 0.96 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 1.11 1.6 1.9 1.23 1.57 1.23 -999.0 -999.0 NaN NaN NaN NaN -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 5.944634 3.908421 62.434211 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0
2 6-0-0 (2024-04-30) doi.org/10.14281/18241.24 7 2018 2 20 AND 232 AND 20070003 20720003 20180704 201807 201809 10.15 10.45 30 2 20003 20002 -4 -3 20002.0 3 2 2 1 -4 1.58 42.53 -5 810 ca 1 1 -4 1.0 0.996016 0.006845 202018 1 2 2 2 3 3 2 1 2 1 1 1 2 1 2 2 2 1 2 2 2 2 2 1 2 2 3 3 3 3 3 -2 4 2 4 2 2 1 4 4 3 2 4 4 2 1 2 1 2 1 9 9 8 4 4 4 3 4 2 2 1 3 2 4 3 3 2 -4 4 4 3 2 2 3 3 3 3 2 3 3 2 2 2 2 2 -4 -4 -4 -4 -4 -4 -4 2 -4 -4 -4 -4 -4 -4 -4 -4 -4 2 3 2 2 3 3 3 4 3 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 5 5 2 4 1 7 2 2 2 2 2 1 2 7 4 2 2 0 1 0 2 0 0 2 1 4 2 3 3 4 3 4 2 2 2 3 4 2 2 4 4 4 1 1 1 1 3 1 2 2 3 5 6 8 5 4 5 8 1 1 2 2 3 4 7 8 4 2 2 2 5 1 1 1 1 1 10 6 5 6 6 5 8 1 1 2 1 5 1 2 4 4 4 3 2 1 1 1 5 5 2 5 4 1 3 1 2 1 1 1 2 2 1 2 2 2 2 20001 20001 20001 1 4 2 2 -2 1 2 4 4 2 1 4 4 2 4 2 4 7 7 7 10 7 4 8 4 7 10 10 8 3 1 3 2 2 2 2 2 1 1969 48 4 2 2 2 0 2 0 724 ES 724 ES 724 ES 2 2 1 810 4 0 7 20007 3 -3 -3 -3 5 20005 3 6 20006 3 1 -3 5 -3 5 2 1 2 3 5 2 1 10100000 20001 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 4 2 2 0.425304 0.692917 0.0 0.66 0.66 0.44000 0.66 1.0 1.0 0.886667 0.0 0.0 0.0 0.0 NaN 0.33 0.33 0.37455 1.0 1.0 1.0 1.000000 0.75 0.66 0.66 0.690000 1.000000 0.444444 0.555556 0.666667 0.33 0.5 0.415 0.415 0.915 1.0 4.0 3.0 94.0 1.0 39.0 1.0 55.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 6.0 4.0 470.0 0.0 0.0 -9999.0 -9999.0 54509.0 65390.0 77142.0 -9999.0 0.18 87.98 -9999.0 4.4 -9999.0 -9999.0 -9999.0 100.0 100.0 86.12 469.38 6.07 -9999.0 -9999.0 -9999.0 10.32 3.2 -9999.0 10.2 0.708 10.0 -9999.0 -9999.0 46.43 0.857 0.935 -9999.0 0.951 0.0 0.0 91.6 107.3 -9999.0 0.96 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 1.11 1.6 1.9 1.23 1.57 1.23 -999.0 -999.0 NaN NaN NaN NaN -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 5.944634 3.908421 62.434211 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0
3 6-0-0 (2024-04-30) doi.org/10.14281/18241.24 7 2018 2 20 AND 232 AND 20070004 20720004 20180702 201807 201809 17.05 18.20 75 2 20003 20002 -4 -3 20002.0 3 2 2 1 -4 1.58 42.53 -5 810 ca 2 1 -4 1.0 0.996016 0.006845 202018 1 1 1 4 2 4 1 2 2 1 2 1 2 1 2 2 1 1 2 2 2 2 2 2 2 2 3 3 4 4 4 4 4 2 2 1 4 2 3 4 4 2 4 4 1 1 1 2 2 2 9 8 6 4 4 4 4 4 3 2 1 2 3 3 3 3 3 -4 3 3 3 3 3 3 3 3 3 -2 3 3 3 3 3 3 3 -4 -4 -4 -4 -4 -4 -4 3 -4 -4 -4 -4 -4 -4 -4 -4 -4 3 3 3 3 3 3 3 1 2 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 8 5 4 8 1 5 3 3 3 3 2 1 4 7 4 1 1 0 0 1 1 1 1 3 2 4 4 4 4 4 4 4 2 2 2 2 2 2 2 3 4 4 1 1 2 1 3 3 4 1 2 7 6 5 6 3 6 1 2 2 2 2 3 3 7 8 4 3 2 2 4 1 1 1 1 1 6 6 4 9 10 3 3 1 1 1 1 7 1 1 2 4 4 2 -2 1 2 5 5 5 5 5 5 2 2 2 2 2 3 2 2 2 3 3 3 2 2 2 2 2 3 4 2 2 1 3 2 4 2 3 2 2 3 2 4 2 4 5 9 8 8 10 2 9 7 7 9 7 6 6 2 5 2 2 2 2 2 2 1956 62 5 3 2 2 0 2 0 724 ES 724 ES 724 ES 2 2 1 1270 2 1 2 20002 1 2 20002 1 1 20001 1 1 20001 1 1 1 4 6 9 2 2 2 4 4 2 0 100000020 20001 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 3 2 0 0.556170 0.481065 0.5 NaN 0.66 0.57458 1.00 1.0 1.0 1.000000 0.0 0.0 0.0 0.0 NaN 0.66 0.66 0.65010 0.0 0.0 0.0 0.000000 0.75 1.00 1.00 0.916667 0.555556 0.333333 0.888889 0.592593 0.33 0.5 0.415 0.415 0.830 1.0 4.0 3.0 94.0 1.0 39.0 1.0 55.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 6.0 4.0 470.0 0.0 0.0 -9999.0 -9999.0 54509.0 65390.0 77142.0 -9999.0 0.18 87.98 -9999.0 4.4 -9999.0 -9999.0 -9999.0 100.0 100.0 86.12 469.38 6.07 -9999.0 -9999.0 -9999.0 10.32 3.2 -9999.0 10.2 0.708 10.0 -9999.0 -9999.0 46.43 0.857 0.935 -9999.0 0.951 0.0 0.0 91.6 107.3 -9999.0 0.96 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 1.11 1.6 1.9 1.23 1.57 1.23 NaN NaN I would not vote NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
4 6-0-0 (2024-04-30) doi.org/10.14281/18241.24 7 2018 2 20 AND 232 AND 20070005 20720005 20180708 201807 201809 10.20 11.48 89 2 20003 20002 -4 -3 20002.0 3 2 2 1 -4 1.58 42.54 -5 810 ca 2 1 -4 1.0 0.996016 0.006845 202018 1 1 1 3 1 3 1 2 1 1 2 1 2 1 2 2 2 1 2 2 2 2 2 1 2 2 3 3 3 3 3 2 4 2 4 2 4 2 3 3 3 3 3 4 1 1 1 2 2 2 8 7 7 4 4 4 4 4 -2 2 1 2 2 3 3 3 3 -4 3 3 2 2 2 2 3 2 3 -2 3 2 3 3 3 3 2 -4 -4 -4 -4 -4 -4 -4 2 -4 -4 -4 -4 -4 -4 -4 -4 -4 2 2 2 2 3 2 3 2 3 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 7 7 2 6 1 5 2 2 2 2 1 1 3 7 4 1 2 1 1 0 2 1 1 3 2 4 4 4 4 4 4 4 2 2 2 2 2 2 2 3 2 4 1 2 2 1 3 3 1 1 3 7 7 6 5 2 6 4 2 2 2 2 3 3 7 8 4 2 2 2 5 1 1 1 1 1 8 6 5 7 8 1 5 1 1 1 1 6 1 1 1 4 4 2 2 1 2 5 2 2 2 2 2 1 3 1 1 1 3 2 2 1 2 2 3 2 2 20005 20005 20005 2 4 3 3 2 2 3 4 1 2 2 3 3 3 4 2 3 6 8 2 8 7 2 8 6 8 7 8 8 7 2 5 2 2 2 2 2 1 1969 49 4 2 2 2 0 2 0 724 ES 724 ES 724 ES 2 2 1 1270 2 0 2 20002 1 2 20002 1 1 20001 1 1 20001 1 1 1 4 5 8 2 1 1 4 4 2 0 100000020 20001 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 2 1 1 0.458949 0.475741 0.5 NaN 0.66 0.57458 0.66 1.0 1.0 0.886667 0.0 0.0 0.0 0.0 NaN 0.33 0.33 0.37455 0.0 0.0 1.0 0.333333 0.75 0.66 0.66 0.690000 0.777778 0.444444 0.666667 0.629630 0.00 0.5 0.250 0.250 0.830 1.0 4.0 3.0 94.0 1.0 39.0 1.0 55.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 6.0 4.0 470.0 0.0 0.0 -9999.0 -9999.0 54509.0 65390.0 77142.0 -9999.0 0.18 87.98 -9999.0 4.4 -9999.0 -9999.0 -9999.0 100.0 100.0 86.12 469.38 6.07 -9999.0 -9999.0 -9999.0 10.32 3.2 -9999.0 10.2 0.708 10.0 -9999.0 -9999.0 46.43 0.857 0.935 -9999.0 0.951 0.0 0.0 91.6 107.3 -9999.0 0.96 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 -9999.0 1.11 1.6 1.9 1.23 1.57 1.23 -999.0 -999.0 NaN NaN NaN NaN -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 3.899767 2.816576 66.964286 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0 -999.0

The dataset contains a total of 613 columns. For this reason, the table below only shows the characteristics used in the final dataset. The cell below shows the questions in the dataset that were derived from an additional csv file.

The draft explored both the analysis of the raw responses to the survey questions and the clustering of the value scales derived from the responses. In the final version, I decided to use the value scales because it exploited the intention with which the survey was designed. As with any survey, the questions are designed to measure a particular value or belief. This knowledge can therefore be used to construct characteristics with reduced dimensionality. Furthermore, this reduced dimensionality has been shown to improve performance in the design.

Other columns contain mostly respondent metadata or country-specific questions that are not relevant for value-based clustering. They are displayed and described in the cell where the final dataset is selected.

The keyword 'inverse' or 'I_' refers to the fact that the scale of the trait is inverted, i.e. I_RELIGIMP is high if people don't attach importance to religion. Also, most of the scales listed below are calculated as weighted averages, so they can only take rational values.

Feature Range Explanation
Y001 0,1,2, ... 5 Post-Materialist index 12-item
Y002 1,2 Post-Materialist index 4-item
Y003 0,1,2 Autonomy Index
SACSECVAL $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ Overall Secular Values
RESEMAVAL $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ emancipative values
I_AUTHORITY 0.0, 0.5, 1.0 Inverse respect for authority
I_NATIONALISM 0.33, 0.0, 0.66, 1.0 Inverse national pride
I_DEVOUT 0.0, 0.33, 0.66, 1.0 Inverse devoutness
I_RELIGIMP 0.0, 0.33, 0.66, 1.0 Inverse importance of religion
I_RELIGBEL 0, 1 Inverse religious person
I_RELIGPRAC $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ Inverse religious practice
I_NORM1 0, 1 Inverse norm conform1
I_NORM2 0, 1 Inverse norm conform2
I_NORM3 0, 1 Inverse norm conform3
I_TRUSTARMY 0.0, 0.33, 0.66, 1.0 skepticism- 1: Inverse trust in army
I_TRUSTPOLICE 0.0, 0.33, 0.66, 1.0 skepticism- 2: Inverse trust in police
I_TRUSTCOURTS 0.0, 0.33, 0.66, 1.0 skepticism- 3: Inverse trust in courts
I_INDEP 0, 1 autonomy-1: Independence as kid quality
I_IMAGIN 0, 1 autonomy-2: Imagination as kid quality
I_NONOBED 0, 1 Emancipative Values-1: Obedience not kid quality
I_WOMJOB 0.0, 0.25, 0.5, 0.75, 1.0 equality-1: Gender equality: job
I_WOMPOL 0.0, 0.33, 0.66, 1.0 equality-2: Gender equality: politics
I_WOMEDU 0.0, 0.33, 0.66, 1.0 equality-3: Gender equality: education
I_HOMOLIB $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ choice-1: Homosexuality acceptance
I_ABORTLIB $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ choice-2: Abortion acceptable
I_DIVORLIB $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ choice-3: Divorce acceptable
I_VOICE1 0.0, 0.33, 0.66, 1.0 Inverse freedom of expression, representing respondent’s support for voice and protest
I_VOICE2 0.0, 0.33, 0.66, 1.0 Inverse value of democracy as expression, distinct from I_VOICE1
I_VOI2_00 0.0 - 1.0 Auxiliary voice variable, averaged from I_VOICE1 and I_VOICE2
DEFIANCE $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ Welzel defiance sub-index
DISBELIEF $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ disbelief sub-index
RELATIVISM 0.0, 0.33, 0.66, 1.0 relativism
SCEPTICISM $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ skepticism index
AUTONOMY 0.0, 0.33, 0.66, 1.0 Autonomy sub index
EQUALITY $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ Emancipative Values-2: Equality sub-index
CHOICE $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ choice sub-index
VOICE $${\{x\in \mathbb {Q} \mid 0\leq x\leq 1\}}$$ Overall support for expression and societal voice, averaged across voice metrics
WVS_LR_PartyVoter $${\{x\in \mathbb {Q} \mid 0\leq x\leq 10\}}$$ Party voters' mean position on Left-Right values scale
WVS_LibCon_PartyVoter $${\{x\in \mathbb {Q} \mid 0\leq x\leq 10\}}$$ Party voters' mean position on Liberal-Conservative (Homosexual rights, abortion, divorce)
WVS_Polmistrust_PartyVoter $${\{x\in \mathbb {Q} \mid 0\leq x\leq 100\}}$$ Party voters' mean Political Mistrust scale
In [3]:
# read in additional information (variable names and explanations)
df_translation = pd.read_csv("IVS_EVS_and_WVS_Variables-Tabelle.csv", sep=";", encoding="latin1")
df_translation = df_translation[
    ["WVS 7: Variable name", "Common Dictionary: Variable name"]
]

# read in additional information (specific to Wave 7 but does not include explanations)
df_features = pd.read_csv("Code_book.csv")
# merge the two dataframes
df_features = pd.merge(
    df_features,
    df_translation,
    left_on="Variable",
    right_on="Common Dictionary: Variable name",
    how="left",
)
# drop columns that are not needed or duplicate 
df_features.drop(
    [
        "Type",
        "IDX",
        "Common Dictionary: Variable name",
        "Variable",
    ],
    axis=1,
    inplace=True,
)
df_features.rename(columns={"WVS 7: Variable name": "Feature", "Label": "Explanation", }, inplace=True)
df_features.dropna(subset=['Feature'],inplace=True)
# create column for range from categories columns
df_features["Categories"] = df_features["Categories"].apply(lambda x: x.split("\n"))
df_features["Categories"] = df_features["Categories"].apply(lambda x: [i.split(":") for i in x])
df_features["Range"] = df_features["Categories"].apply(lambda x: [i[0] for i in x])
df_features.set_index("Feature", inplace=True)

# process df_translation for later use
df_translation.rename(columns={"WVS 7: Variable name": "Feature", "Common Dictionary: Variable name": "Explanation"}, inplace=True)
df_translation.set_index("Feature", inplace=True)

pd.set_option('display.max_colwidth', 500)
df_features[['Range', 'Explanation']].head(50)
Out[3]:
Range Explanation
Feature
Q1 [1, 2, 3, 4, -5, -4, -3, -2, -1, ] Important in life: Family
Q2 [1, 2, 3, 4, -5, -4, -3, -2, -1, ] Important in life: Friends
Q3 [-5, -4, -3, -2, -1, 1, 2, 3, 4, ] Important in life: Leisure time
Q4 [1, 2, 3, 4, -5, -4, -3, -2, -1, ] Important in life: Politics
Q5 [1, 2, 3, 4, -5, -4, -3, -2, -1, ] Important in life: Work
Q6 [-5, -4, -3, -2, -1, 1, 2, 3, 4, ] Important in life: Religion
Q46 [1, 2, 3, 4, -5, -4, -3, -2, -1, ] Feeling of happiness
Q47 [1, 2, 3, 4, 5, -5, -4, -3, -2, -1, ] State of health (subjective)
Q7 [-5, -4, -3, -2, -1, 0, 1, ] Important child qualities: good manners
Q8 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: independence
Q9 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: hard work
Q10 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: feeling of responsibility
Q11 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: imagination
Q12 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: tolerance and respect for other people
Q13 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: thrift saving money and things
Q14 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: determination perseverance
Q15 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: religious faith
Q16 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: unselfishness
Q17 [0, 1, -5, -4, -3, -2, -1, ] Important child qualities: obedience
Q200 [1, 2, 3, -5, -4, -3, -2, -1, ] How often discusses political matters with friends
Q94R [0, 1, -5, -4, -3, -2, -1, ] Member: Belong to religious organization
Q96R [0, 1, -5, -4, -3, -2, -1, ] Member: Belong to education, arts, music or cultural activities
Q97R [0, 1, -5, -4, -3, -2, -1, ] Member: Belong to labour unions
Q98R [0, 1, -5, -4, -3, -2, -1, ] Member: Belong to political parties
Q99R [0, 1, -5, -4, -3, -2, -1, ] Member: Belong to conservation, the environment, ecology
Q100R [0, 1, -5, -4, -3, -2, -1, ] Member: Belong to professional associations
Q95R [0, 1, -5, -4, -3, -2, -1, ] Member: Belong to sports or recreation
Q104R [0, 1, -5, -4, -3, -2, -1, ] Member: Belong to women´s group
Q102R [0, 1, -5, -4, -3, -2, -1, ] Belong: Cconsumer groups
Q105R [0, 1, -5, -4, -3, -2, -1, ] Member: Belong to other groups
Q94 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership of church or religious organization
Q95 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership of sport or recreation
Q96 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership of art, music, educational
Q97 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership of labour unions
Q98 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership of political party
Q99 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership of environmental organization
Q100 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership of professional organization
Q101 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership of charitable/humanitarian organization
Q105 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership of any other organization
Q102 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership: Consumer organization
Q103 [0, 1, 2, -5, -4, -3, -2, -1, ] Active/Inactive membership: Self-help group, mutual aid group
Q19 [0, 1, -5, -4, -3, -2, -1, ] Neighbours: People of a different race
Q24 [0, 1, -5, -4, -3, -2, -1, ] Neighbours: Heavy drinkers
Q21 [0, 1, -5, -4, -3, -2, -1, ] Neighbours: Immigrants/foreign workers
Q20 [0, 1, -5, -4, -3, -2, -1, ] Neighbours: People who have AIDS
Q18 [0, 1, -5, -4, -3, -2, -1, ] Neighbours: Drug addicts
Q22 [0, 1, -5, -4, -3, -2, -1, ] Neighbours: Homosexuals
Q23 [0, 1, -5, -4, -3, -2, -1, ] Neighbours: People of a different religion
Q25 [0, 1, -5, -4, -3, -2, -1, ] Neighbours: Unmarried couples living together
Q26 [0, 1, -5, -4, -3, -2, -1, ] Neighbours: People who speak a different language

The table above shows some of the questions in the data, their explanation and the values they can take.

In [4]:
raw.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 97220 entries, 0 to 97219
Columns: 613 entries, version to v2xps_party
dtypes: float64(195), int64(406), object(12)
memory usage: 454.7+ MB
In [5]:
raw.describe()
Out[5]:
A_WAVE A_YEAR A_STUDY B_COUNTRY C_COW_NUM D_INTERVIEW S007 J_INTDATE FW_START FW_END K_TIME_START K_TIME_END K_DURATION Q_MODE N_REGION_ISO N_REGION_WVS N_REGION_NUTS2 N_REG_NUTS1 N_TOWN G_TOWNSIZE G_TOWNSIZE2 H_SETTLEMENT H_URBRURAL I_PSU O1_LONGITUDE O2_LATITUDE L_INTERVIEWER_NUMBER S_INTLANGUAGE E_RESPINT F_INTPRIVACY E1_LITERACY W_WEIGHT S018 PWGHT S025 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 Q23 Q24 Q25 Q26 Q27 Q28 Q29 Q30 Q31 Q32 Q33 Q33_3 Q34 Q34_3 Q35 Q35_3 Q36 Q37 Q38 Q39 Q40 Q41 Q42 Q43 Q44 Q45 Q46 Q47 Q48 Q49 Q50 Q51 Q52 Q53 Q54 Q55 Q56 Q57 Q58 Q59 Q60 Q61 Q62 Q63 Q64 Q65 Q66 Q67 Q68 Q69 Q70 Q71 Q72 Q73 Q74 Q75 Q76 Q77 Q78 Q79 Q80 Q81 Q82 Q82_AFRICANUNION Q82_APEC Q82_ARABLEAGUE Q82_ASEAN Q82_CIS Q82_CUSMA Q82_ECO Q82_EU Q82_GULFCOOP Q82_ISLCOOP Q82_MERCOSUR Q82_NAFTA Q82_OAS Q82_SAARC Q82_SCO Q82_TLC Q82_UNDP Q83 Q84 Q85 Q86 Q87 Q88 Q89 Q90 Q91 Q92 Q93 Q94 Q94R Q95 Q95R Q96 Q96R Q97 Q97R Q98 Q98R Q99 Q99R Q100 Q100R Q101 Q101R Q102 Q102R Q103 Q103R Q104 Q104R Q105 Q105R Q106 Q107 Q108 Q109 Q110 Q111 Q112 Q113 Q114 Q115 Q116 Q117 Q118 Q119 Q120 Q121 Q122 Q123 Q124 Q125 Q126 Q127 Q128 Q129 Q130 Q131 Q132 Q133 Q134 Q135 Q136 Q137 Q138 Q139 Q140 Q141 Q142 Q143 Q144 Q145 Q146 Q147 Q148 Q149 Q150 Q151 Q152 Q153 Q154 Q155 Q156 Q157 Q158 Q159 Q160 Q161 Q162 Q163 Q164 Q165 Q166 Q167 Q168 Q169 Q170 Q171 Q172 Q172R Q173 Q174 Q175 Q176 Q177 Q178 Q179 Q180 Q181 Q182 Q183 Q184 Q185 Q186 Q187 Q188 Q189 Q190 Q191 Q192 Q193 Q194 Q195 Q196 Q197 Q198 Q199 Q200 Q201 Q202 Q203 Q204 Q205 Q206 Q207 Q208 Q209 Q210 Q211 Q212 Q213 Q214 Q215 Q216 Q217 Q218 Q219 Q220 Q221 Q222 Q223 Q223_ABREV Q223_LOCAL Q224 Q225 Q226 Q227 Q228 Q229 Q230 Q231 Q232 Q233 Q234 Q234A Q235 Q236 Q237 Q238 Q239 Q240 Q241 Q242 Q243 Q244 Q245 Q246 Q247 Q248 Q249 Q250 Q251 Q252 Q253 Q254 Q255 Q256 Q257 Q258 Q259 Q260 Q261 Q262 X003R X003R2 Q263 Q264 V002 Q265 V001 Q266 Q267 Q268 Q269 Q270 Q271 Q272 Q273 Q274 Q275 Q275A Q275R Q276 Q276A Q276R Q277 Q277A Q277R Q278 Q278A Q278R Q279 Q280 Q281 Q282 Q283 Q284 Q285 Q286 Q287 Q288 Q288R Q289 Q289CS9 Q290 Q291G1 Q291G2 Q291G3 Q291G4 Q291G5 Q291G6 Q291P1 Q291P2 Q291P3 Q291P4 Q291P5 Q291P6 Q291UN1 Q291UN2 Q291UN3 Q291UN4 Q291UN5 Q291UN6 Q292A Q292B Q292C Q292D Q292E Q292F Q292G Q292H Q292I Q292J Q292K Q292L Q292M Q292N Q292O Q293 Q294A Q294B Y001 Y002 Y003 SACSECVAL RESEMAVAL I_AUTHORITY I_NATIONALISM I_DEVOUT DEFIANCE I_RELIGIMP I_RELIGBEL I_RELIGPRAC DISBELIEF I_NORM1 I_NORM2 I_NORM3 RELATIVISM I_TRUSTARMY I_TRUSTPOLICE I_TRUSTCOURTS SCEPTICISM I_INDEP I_IMAGIN I_NONOBED AUTONOMY I_WOMJOB I_WOMPOL I_WOMEDU EQUALITY I_HOMOLIB I_ABORTLIB I_DIVORLIB CHOICE I_VOICE1 I_VOICE2 I_VOI2_00 VOICE SECVALWGT RESEMAVALWGT fhregion polregfh freestfh prfhrat prfhscore clfhrat clfhscore democ autoc polity durable regtype ruleoflaw corrupttransp electintegr btiregion btistatus btidemstatus btistate btipolpart btiruleoflaw btistability btiintegration btimarket btigovindex btigoveperform btiregime regionWB incomeWB landWB GDPpercap1 GDPpercap2 giniWB incrichest10p popWB1990 popWB2000 popWB2019 lifeexpect popgrowth urbanpop laborforce deathrate unemployfem unemploymale unemploytotal accessclfuel accesselectr renewelectr co2emis co2percap easeofbusiness militaryexp Trade healthexp educationexp medageun meanschooling educationHDI compulseduc GII DGI womenparl hdi incomeindexHDI humanineqiality lifeexpectHDI homiciderate Refugeesorigin internetusers mobphone migrationrate schoolgpi femchoutsch choutsch v2x_polyarchy v2x_libdem v2x_partipdem v2x_delibdem v2x_egaldem v2x_freexp_altinf v2x_frassoc_thick v2xel_frefair v2xcl_rol v2x_cspart v2xeg_eqdr v2excrptps v2exthftps v2juaccnt v2cltrnslw v2clacjust v2clsocgrp v2clacfree v2clrelig v2csrlgrep v2mecenefm v2mecenefi v2mebias v2pepwrses v2pepwrgen v2peedueq v2pehealth v2peapsecon v2peasjsoecon v2clgencl v2peasjgen v2peasbgen v2cafres v2cafexch v2x_corr v2x_gender v2x_gencl v2x_genpp v2x_rule v2xcl_acjst td_voiacc td_polstab td_goveff td_regqual td_rulelaw td_ctrlcorr ID_GPS ID_PartyFacts Type_Values Type_Populism Type_Populist_Values Type_Partysize_vote Type_Partysize_seat GPS_V4_Scale GPS_V6_Scale GPS_V8_Scale GPS_V9 GPS_V10 GPS_V11 GPS_V12 GPS_V13 GPS_V14 GPS_V15 GPS_V16 GPS_V17 WVS_LR_PartyVoter WVS_LibCon_PartyVoter WVS_Polmistrust_PartyVoter WVS_LR_MedianVoter WVS_LibCon_MedianVoter v2psbars v2psorgs v2psprbrch v2psprlnks v2psplats v2xnp_client v2xps_party
count 97220.0 97220.000000 97220.0 97220.000000 97220.000000 9.722000e+04 9.722000e+04 9.722000e+04 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 9.722000e+04 97220.000000 97219.000000 97220.000000 97220.000000 97220.000000 97220.000000 9.722000e+04 97216.000000 97216.000000 9.722000e+04 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 9.722000e+04 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.00000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.00000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.00000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 9.722000e+04 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 97220.000000 96740.000000 96472.000000 94496.000000 94132.000000 95544.000000 96653.000000 96294.000000 94568.000000 96008.000000 96520.000000 93681.000000 95941.000000 96026.000000 96257.000000 92897.000000 94808.000000 93709.000000 94837.000000 96182.000000 96017.000000 96028.000000 96006.000000 96484.000000 94579.000000 95792.000000 96342.000000 89705.000000 94945.000000 95291.000000 95255.000000 94078.000000 92940.000000 91841.000000 95206.000000 97220.000000 97220.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 9.677300e+04 96773.000000 96773.000000 96773.000000 96773.000000 9.677300e+04 9.677300e+04 9.677300e+04 96773.000000 96773.000000 96773.000000 9.677300e+04 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 9.677300e+04 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 95773.000000 95773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 96773.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000 3918.000000
mean 7.0 2019.132082 2.0 447.872146 476.555153 4.479431e+08 4.485726e+08 1.905207e+07 201901.606881 201919.989683 10.342846 11.477696 45.639714 1.733717 427774.216900 404544.464297 7.814099e+05 10443.596852 344510.689155 5.144888 3.021138 3.082586 1.319420 2.778437e+07 -14.424866 -7.652924 6.103356e+05 1969.124049 0.948581 0.693705 -1.769554 1.000000 0.677474 4.988747 4.480741e+06 1.106388 1.695207 1.761819 2.550391 1.509556 1.947048 1.209813 1.531352 1.440321 1.330395 1.739807 1.347470 1.657272 1.623946 1.614832 1.675643 1.647017 1.134900 1.793222 1.551049 1.734581 1.362981 1.775859 1.282030 1.642522 1.802376 1.595834 2.482411 2.543592 2.943993 2.674779 2.125242 3.023668 1.728266 2.162456 1.404886 3.033553 1.803549 2.081475 2.705431 2.047645 2.160625 2.137276 2.499414 1.856151 2.078235 1.332092 1.490671 1.827721 2.176373 7.129819 7.012312 6.155832 3.463289 3.416540 3.316560 3.147223 3.677206 1.666478 1.704300 1.259545 2.148601 2.033666 2.945536 2.509844 2.613351 2.112631 1.893088 2.61402 2.569862 2.409165 2.217692 2.250802 2.460307 2.822701 2.652746 2.430107 2.007807 2.405472 2.400658 2.307282 2.137461 2.009257 2.084674 1.539807 -3.700998 -3.760924 -3.440547 -3.155698 -3.518679 -3.722825 -3.915666 -2.416931 -3.541391 -3.542666 -3.225447 -3.823452 -3.909185 -3.818967 -3.564164 -3.819811 -3.792553 1.949126 1.860790 1.754114 1.525468 1.710121 1.594939 1.612847 5.091514 1.059473 0.704104 0.49064 0.546626 0.340547 0.363248 0.225766 0.293880 0.180272 0.202880 0.134293 0.179624 0.120664 0.16691 0.108578 0.219296 0.136536 0.247953 0.154228 0.125807 0.078832 0.193211 0.116828 0.082524 0.015799 0.053045 -0.014894 6.169358 5.398725 4.945155 3.968731 4.372341 1.321199 7.442748 2.250051 2.149301 2.022814 2.087575 1.939220 1.823575 1.870160 6.059329 2.864472 1.123020 1.188480 1.068186 0.930858 1.046431 1.304413 1.126887 1.141946 2.248107 1.979284 2.781321 2.568155 2.937040 2.997645 2.795711 2.850031 2.855935 0.954732 1.042224 1.149866 1.943623 1.695988 1.690630 1.652160 1.911633 1.964297 1.867342 1.365604 1.631876 0.952109 1.810512 2.175417 2.013382 2.330724 1.833697 2.467712 7.170037 7.256861 5.223401 5.059370 4.344908 6.822732 7.117260 1.002314 1.082174 1.143870 1.063567 2.237708 2.141833 4.114976 3.658743 2.165408 1.388953 1.387071 1.324306 5.134252 2.892203 2.616612 1.780786 2.179912 1.918103 3.528153 2.475561 3.433069 4.874625 4.285291 2.479192 3.665419 1.633182 2.779531 1.918515 1.528173 3.019615 1.708136 3.954248 2.107334 2.675273 2.744569 2.623586 2.148930 3.320788 1.814503 3.028832 2.373812 3.385137 2.432102 2.448251 2.281886 2.054536 2.360163 2.230097 2.376157 1.973246 2.176311 2.090197 2.076126 1.611510 1.684396 1.758023 1.871693 1.407159 1.294806 282078.550689 282078.550689 282078.550689 1.707828 2.207210 1.554999 1.976939 1.881640 1.803189 1.875941 2.488901 1.664411 1.580796 1.280241 1.253322 2.297141 2.066910 2.441288 1.543952 2.649424 3.177618 6.074830 3.832586 7.687657 6.591164 4.034612 6.961263 5.649825 5.571076 7.783656 8.195279 5.963814 5.058681 2.214380 1.551615 1.461921 1.489529 1.684396 2.300154 2.356213 1.521384 1943.379654 42.932185 3.295310 2.069111 1.041062 0.869492 0.685065 0.865336 0.675334 483.651821 467.833162 468.812251 0.755647 3.956377 1.226805 2249.973935 2.630981 1.487554 3.493150 302817.994312 1.961777 0.962847 186128.021107 0.085209 1.447038 256806.642625 0.925982 1.552211 252588.841442 0.931516 3.047192 0.479696 3.556089 1.287821 4.747696 0.723154 1.391432 1.910183 2.881814 4.700483 1.737924 2.793222 5.287940e+07 398007.952787 -2.714627 -2.718216 -2.733800 -2.728338 -2.622382 -2.676959 -2.718309 -2.739179 -2.757190 -2.729150 -2.633676 -2.683182 -2.813197 -2.751872 -2.678955 -2.807653 -2.663526 -2.781794 -2.825674 -2.783769 -2.897243 -2.870109 -2.873771 -2.810224 -2.909679 -2.849054 -2.850771 -2.852829 -2.875180 -2.843633 -2.859905 -2.866293 -2.836063 -2.866098 -3.527474 -3.502006 1.815820 1.547583 0.026517 0.365714 0.435595 0.287811 0.180968 0.215316 0.232894 0.327671 0.383872 0.533077 0.416716 0.484111 0.370968 0.308219 0.387995 0.367303 0.445678 0.470598 0.428984 0.432461 0.215504 0.689486 0.445503 0.515057 0.547447 0.666989 0.576234 0.339097 0.283798 0.445251 0.353275 0.385355 0.349021 0.366866 0.367562 0.981269 0.983043 -219.478202 -20.083649 -164.857615 -218.741074 -199.186839 -218.792711 -187.817966 -765.319531 -769.894661 -766.637254 -731.503343 -767.921755 -1284.343246 -281.324998 -1050.967667 -2640.365681 -2639.508605 -2639.654259 -2638.280206 -2639.641697 -2640.042777 -2640.249646 -2639.994992 -2639.362916 -2640.175697 -2639.685862 -2641.387629 5.179017 3.055470 2.064219e+06 26034.996150 24973.223048 -1704.854337 -1334.441063 9.451313e+07 1.081586e+08 1.300344e+08 -156.152175 -125.369137 -58.734514 6.207792e+07 -119.240332 -222.824735 -224.364344 -223.946297 -989.203645 -32.180002 -97.528469 7.027965e+05 -237.445540 -268.267657 -1142.777459 -1693.522623 -680.094604 -2171.420626 -420.394522 -339.128796 -347.818512 -223.504738 -794.182725 -451.345534 -540.629487 -347.764009 -347.775967 -696.901694 -347.685904 -722.021103 -301.567852 -287.084271 -235.006708 -451.475448 -381.656042 -820.564874 -365.767254 -325.363571 -325.476140 -325.544006 -325.472821 -325.500369 -325.238262 -325.244894 -325.289222 -325.232213 -325.222011 -325.308940 -325.763757 -325.605177 -324.959551 -325.297187 -325.044717 -325.543340 -325.200820 -325.397775 -325.415097 -325.278138 -325.798415 -325.192103 -325.429458 -324.773113 -325.527202 -325.400394 -2496.776949 -2339.568127 -2496.249070 -2339.134513 -2470.285270 -1656.127758 -1656.033358 -325.437044 -325.139432 -325.209938 -325.023409 -325.299214 -325.251255 -0.031416 -0.260963 0.277855 0.242419 0.109424 0.061914 -306.788157 1470.211843 -334.381062 -334.111281 -334.316233 -381.413987 -388.681981 -332.609558 -332.697113 -332.311622 -331.292358 -332.435901 -332.907479 -332.615529 -331.761996 -334.086331 -333.330175 -332.976980 -332.036952 5.735796 6.120533 67.689823 -331.856360 -331.510837 -334.689260 -334.827539 -335.095391 -334.788026 -334.811147 -335.648640 -335.268652
std 0.0 1.601004 0.0 256.491312 288.386918 2.564912e+08 2.564602e+08 4.658281e+06 160.980181 160.412353 8.077889 8.274940 37.321287 0.869583 259946.240794 271564.672112 2.064516e+06 24477.344708 314322.884026 2.689833 1.721306 1.538648 0.483092 1.568710e+08 203.391740 156.547844 5.349224e+06 1314.394525 1.770141 1.663554 2.524477 0.427385 0.235396 10.229459 2.564913e+06 0.407485 0.785849 0.851692 1.092988 0.950227 1.181863 0.488928 0.614170 0.590460 0.553037 0.582881 0.566821 0.602408 0.613818 0.610908 0.600402 0.608704 0.474748 0.568497 0.648135 0.599745 1.103467 0.576373 0.563772 0.862967 0.548195 0.865133 1.077505 1.158396 1.060935 1.113145 1.109812 1.421477 0.763885 1.242355 0.775712 1.330231 0.840424 2.690132 1.376015 1.138165 1.189161 1.099845 1.254273 0.894623 1.035008 0.787063 0.919969 0.783155 0.916183 2.411960 2.336692 2.510540 0.963396 0.983681 1.054358 1.103533 0.886914 0.974080 0.645985 0.616781 0.881143 0.862756 0.976348 1.213223 1.219288 1.151147 1.395104 1.07158 1.019465 1.365203 1.249408 1.307627 1.350511 1.190471 1.219013 1.141597 1.088429 1.358608 1.226956 1.130142 1.258808 1.329408 1.217427 2.347616 1.332104 1.198279 1.891761 2.100016 1.673012 1.342828 0.708125 2.828242 1.709159 1.693086 2.147759 1.078654 0.775312 1.052465 1.596319 1.085165 1.135518 1.828318 1.988249 1.978149 2.322544 2.078037 1.895453 2.084758 3.464498 2.021949 1.826405 2.15097 0.857103 0.561479 0.767992 0.525369 0.722782 0.501621 0.635431 0.480144 0.601262 0.461428 0.59105 0.445763 0.672826 0.493611 0.687213 0.489088 0.568679 0.447835 0.646109 0.473873 0.894943 0.786080 0.796917 0.664023 3.115625 3.071016 3.086484 2.812444 3.007810 0.851500 2.709389 1.507335 1.489827 1.728283 1.458063 1.528096 1.314853 1.696211 3.208724 1.269359 0.957445 0.971287 0.959421 1.316609 0.974702 0.933153 0.957391 0.953895 1.519640 0.885732 1.611142 1.638642 1.845841 1.712105 1.816185 1.661433 1.935421 1.564213 1.575789 1.997186 1.645497 1.887219 1.132406 1.158102 1.491269 1.320190 1.897989 0.680808 0.660651 1.227289 1.205089 1.479840 1.225060 1.418423 1.271128 1.472241 2.911947 2.887270 3.271204 3.241982 3.171522 2.944686 3.569618 0.997041 1.124175 1.138839 1.104163 1.382683 1.739376 2.311773 2.825904 1.400822 0.854113 1.275772 1.328813 2.969395 2.723056 2.793597 1.829419 2.194509 1.959069 3.761349 3.166417 3.060473 3.308980 3.734662 2.501859 3.287652 2.132408 2.578285 1.898353 2.147010 3.458963 2.273789 3.270889 1.399683 1.498146 1.494191 1.055872 0.798742 1.689949 1.352075 1.773990 1.785977 1.871081 1.857499 2.125412 1.512895 1.072932 1.069499 1.022488 1.059469 1.046878 1.028317 1.606222 1.066724 1.959254 2.123055 2.199580 2.233427 1.380653 1.457848 298689.567090 298689.567090 298689.567090 1.643007 1.922384 2.107674 1.820870 1.693313 1.696436 1.816364 1.944934 1.609648 1.520174 1.292818 3.214004 1.406023 1.319818 2.053757 1.065845 1.501753 4.497682 3.331431 3.227941 3.031041 3.199682 3.778564 3.269278 3.360329 3.342551 2.992797 2.511631 2.884745 3.063971 1.038346 1.009128 1.145716 1.461494 0.909052 1.178388 1.225578 0.526727 251.184290 16.880809 1.677478 0.877520 0.376351 1.069452 1.030328 1.083265 1.042204 656.237711 735.941275 746.140761 1.135214 2.646628 1.024208 1995.309976 2.187596 2.096530 2.129134 323896.839646 0.971317 3.472447 286882.213861 2.502294 2.486612 309397.831609 1.692968 2.612624 308090.448768 1.754147 2.154336 3.335539 3.370270 4.416269 4.122301 2.039342 1.013446 1.150535 1.777338 2.383291 0.891734 2.631263 3.328675e+07 280880.605557 2.733628 2.723531 2.694139 2.705058 2.925590 2.814092 2.732640 2.687841 2.653215 2.709616 2.912077 2.809751 2.547643 2.678594 2.727022 2.557054 2.770103 2.618725 2.703219 2.791566 2.544259 2.604667 2.595772 2.734949 2.514959 2.649914 2.650296 2.644078 2.595529 2.663656 2.627347 2.613043 2.680291 3.238925 1.402086 1.496491 1.515545 1.451382 1.295941 0.177934 0.181639 0.374153 0.247577 0.246482 0.199394 0.364166 0.486330 0.365959 0.337187 0.499750 0.483066 0.461760 0.403530 0.310110 0.311396 0.312738 0.254646 0.495420 0.411173 0.462706 0.299986 0.339512 0.318214 0.301188 0.257771 0.378684 0.332093 0.355807 0.303081 0.324892 0.396206 0.286456 0.284618 0.045262 0.041385 1474.147567 147.562009 1482.653183 1474.259401 1477.261507 1474.251242 1479.005899 2669.412313 2668.088362 2669.035040 2679.572306 2668.658016 3346.291547 1783.773277 3148.475021 4411.760141 4412.273831 4412.186590 4413.010319 4412.194336 4411.953716 4411.829919 4411.982262 4412.361167 4411.873790 4412.167547 4411.147248 1.748826 0.841732 3.520072e+06 24150.872179 23153.838025 3801.109589 3437.025613 2.235578e+08 2.541421e+08 2.956285e+08 1510.652046 1117.061594 1124.781622 1.479152e+08 1117.757370 1500.421980 1500.176952 1500.242548 3102.711802 1127.668545 1120.530564 1.869263e+06 1539.990265 1814.668512 3184.062549 3848.427400 2530.171625 4127.070483 2084.821972 1835.729626 1834.076558 1512.330417 2704.285205 2078.072167 2310.182875 1834.086914 1834.084643 2574.658986 1834.101755 2597.695702 1848.085305 1845.762471 1855.854830 2078.048518 1918.356826 2753.848700 1888.107397 1775.582494 1775.561833 1775.549369 1775.562440 1775.557382 1775.605497 1775.604278 1775.596148 1775.606606 1775.608473 1775.592522 1775.509642 1775.538706 1775.657052 1775.595165 1775.641333 1775.549876 1775.612984 1775.576680 1775.573448 1775.598713 1775.503064 1775.614328 1775.570649 1775.691116 1775.552902 1775.576235 4328.657996 4234.054281 4328.962495 4234.293984 4313.519126 3717.851183 3717.893250 1775.569015 1775.623623 1775.610688 1775.644918 1775.594314 1775.603110 0.941325 0.961830 0.978977 1.062124 1.051166 1.059692 492.963743 2725.971521 472.990276 473.181735 473.035657 487.274681 488.847295 474.252541 474.190620 474.465192 475.189463 474.375396 474.041703 474.247327 474.854708 473.199218 473.738154 473.992435 474.660624 1.080328 2.142268 9.814691 474.786005 475.033906 472.769807 472.671155 472.481026 472.700209 472.683543 472.086732 472.357142
min 7.0 2017.000000 2.0 20.000000 2.000000 2.007000e+07 2.072000e+07 -5.000000e+00 201701.000000 201703.000000 -5.000000 -5.000000 -5.000000 1.000000 -5.000000 -5.000000 -5.000000e+00 -5.000000 -4.000000 -5.000000 -5.000000 -5.000000 -5.000000 -4.000000e+00 -999.000000 -999.000000 -5.000000e+00 140.000000 -5.000000 -4.000000 -5.000000 0.100485 0.248880 0.006845 2.020180e+05 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.00000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -4.000000 -4.000000 -5.000000 -4.000000 -4.000000 -4.000000 -5.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -5.000000 -4.000000 -4.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.00000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.00000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000e+00 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -5.000000 -4.000000 -4.000000 -4.000000 -2.000000 -5.000000 -5.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.660000 0.660000 -9999.000000 -999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 1.000000 1.000000 -9.999000e+03 0.000000 0.000000 -9999.000000 -9999.000000 -9.999000e+03 -9.999000e+03 -9.999000e+03 -9999.000000 -9999.000000 -9999.000000 -9.999000e+03 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9.999000e+03 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -1.800000 -2.600000 -1.750000 -2.360000 -2.250000 -1.560000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 3.615385 2.543114 43.750000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000
25% 7.0 2018.000000 2.0 218.000000 201.000000 2.180700e+08 2.187200e+08 2.018022e+07 201804.000000 201806.000000 9.060000 10.340000 22.000000 1.000000 170028.000000 156109.000000 -4.000000e+00 -3.000000 -4.000000 3.000000 2.000000 2.000000 1.000000 -4.000000e+00 -4.000000 -4.000000 -4.000000e+00 1240.000000 1.000000 1.000000 -4.000000 0.899689 0.497018 0.598052 2.182018e+06 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 1.000000 1.000000 2.000000 1.000000 2.000000 2.000000 3.000000 2.000000 2.000000 2.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 2.000000 2.000000 1.000000 1.000000 1.000000 1.000000 2.000000 6.000000 6.000000 5.000000 3.000000 3.000000 3.000000 2.000000 4.000000 1.000000 1.000000 1.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 1.000000 2.00000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 1.000000 1.000000 1.000000 -1.000000 1.000000 1.000000 1.000000 3.000000 -1.000000 -1.000000 -1.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 4.000000 3.000000 2.000000 1.000000 1.000000 1.000000 6.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 1.000000 4.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 2.000000 1.000000 2.000000 2.000000 3.000000 3.000000 2.000000 2.000000 3.000000 1.000000 1.000000 2.000000 1.000000 1.000000 2.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 6.000000 6.000000 3.000000 3.000000 1.000000 5.000000 5.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 1.000000 2.000000 2.000000 2.000000 1.000000 2.000000 2.000000 1.000000 1.000000 1.000000 2.000000 2.000000 1.000000 1.000000 -1.000000 -1.000000 -1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 -1.000000 1.000000 1.000000 2.000000 1.000000 2.000000 -1.000000 4.000000 1.000000 6.000000 5.000000 1.000000 5.000000 3.000000 3.000000 6.000000 7.000000 4.000000 3.000000 2.000000 1.000000 1.000000 1.000000 1.000000 2.000000 2.000000 1.000000 1962.000000 29.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 218.000000 170.000000 170.000000 1.000000 2.000000 1.000000 1240.000000 1.000000 0.000000 2.000000 -4.000000 1.000000 -3.000000 -4.000000 -3.000000 0.000000 -4.000000 1.000000 0.000000 -4.000000 1.000000 1.000000 -3.000000 1.000000 -3.000000 2.000000 1.000000 1.000000 1.000000 2.000000 3.000000 1.000000 0.000000 2.000000e+07 124007.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 1.000000 1.000000 -1.000000 0.234167 0.304583 0.000000 0.000000 0.000000 0.110000 0.000000 0.000000 0.166667 0.111111 0.000000 0.000000 0.000000 0.000000 0.000000 0.330000 0.330000 0.220000 0.000000 0.000000 0.000000 0.333333 0.250000 0.330000 0.660000 0.413333 0.000000 0.000000 0.000000 0.074074 0.000000 0.000000 0.165000 0.165000 1.000000 1.000000 1.000000 1.000000 32.000000 1.000000 12.000000 1.000000 18.000000 1.000000 0.000000 -3.000000 7.000000 2.000000 0.420000 29.000000 44.183700 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 4.000000 2.000000 1.289000e+05 8995.540000 8637.560000 29.500000 23.800000 6.864842e+06 7.516346e+06 1.010169e+07 71.570000 0.360000 53.730000 3.953996e+06 5.410000 3.580000 3.280000 3.500000 45.230000 98.510000 8.780000 2.536831e+04 1.960000 23.000000 0.920000 33.400000 4.170000 2.500000 27.600000 7.700000 0.625000 9.000000 0.119000 0.925000 16.000000 0.703000 0.652000 8.500000 0.792000 0.700000 0.100000 43.800000 93.000000 -0.800000 0.980000 1.000000 0.000000 0.289000 0.156000 0.155000 0.175000 0.199000 0.418000 0.505000 0.356000 0.405000 0.512000 0.353000 -0.999000 -1.035000 0.201000 -0.401000 0.099000 -0.710000 -0.490000 -0.420000 -0.557000 -0.674000 -1.056000 0.229000 -0.353000 0.439000 -0.805000 -0.612000 -2.232000 -1.104000 -0.721000 -1.126000 -2.052000 -1.312000 -1.311000 0.110000 0.667000 0.492000 0.818000 0.306000 0.404000 -0.850000 -0.920000 -0.340000 -0.460000 -0.650000 -0.760000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 4.721298 4.738187 66.964286 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000 -999.000000
50% 7.0 2018.000000 2.0 422.000000 552.000000 4.220707e+08 4.227207e+08 2.018111e+07 201811.000000 201812.000000 12.520000 14.050000 49.000000 2.000000 410041.000000 400012.000000 -4.000000e+00 -3.000000 364036.000000 6.000000 3.000000 3.000000 1.000000 4.500000e+01 13.420000 12.800000 1.700000e+01 1270.000000 1.000000 1.000000 -4.000000 1.000000 0.761615 1.709467 4.222018e+06 1.000000 2.000000 2.000000 3.000000 1.000000 2.000000 1.000000 2.000000 1.000000 1.000000 2.000000 1.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 2.000000 2.000000 1.000000 3.000000 3.000000 3.000000 3.000000 2.000000 3.000000 2.000000 2.000000 1.000000 3.000000 2.000000 3.000000 3.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 1.000000 2.000000 2.000000 7.000000 7.000000 6.000000 4.000000 4.000000 4.000000 4.000000 4.000000 1.000000 2.000000 1.000000 2.000000 2.000000 3.000000 3.000000 3.000000 2.000000 2.000000 3.00000 3.000000 3.000000 2.000000 2.000000 3.000000 3.000000 3.000000 2.000000 2.000000 3.000000 3.000000 2.000000 2.000000 2.000000 2.000000 2.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 5.000000 2.000000 1.000000 2.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 7.000000 5.000000 5.000000 4.000000 4.000000 1.000000 8.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 6.000000 3.000000 1.000000 2.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 3.000000 2.000000 3.000000 3.000000 4.000000 4.000000 3.000000 3.000000 4.000000 1.000000 1.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 2.000000 1.000000 2.000000 2.000000 2.000000 3.000000 1.000000 3.000000 8.000000 8.000000 5.000000 5.000000 4.000000 7.000000 9.000000 1.000000 1.000000 1.000000 1.000000 2.000000 3.000000 4.000000 3.000000 2.000000 1.000000 2.000000 2.000000 5.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 2.000000 5.000000 4.000000 1.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 3.000000 2.000000 3.000000 3.000000 3.000000 2.000000 4.000000 1.000000 3.000000 1.000000 4.000000 2.000000 2.000000 2.000000 2.000000 3.000000 2.000000 3.000000 2.000000 2.000000 3.000000 2.000000 2.000000 2.000000 3.000000 3.000000 1.000000 1.000000 170021.000000 170021.000000 170021.000000 2.000000 3.000000 2.000000 2.000000 2.000000 2.000000 2.000000 3.000000 2.000000 2.000000 1.000000 2.000000 2.000000 2.000000 3.000000 1.000000 3.000000 5.000000 7.000000 3.000000 9.000000 7.000000 4.000000 8.000000 6.000000 6.000000 9.000000 9.000000 6.000000 5.000000 2.000000 1.000000 1.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1977.000000 41.000000 3.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 422.000000 410.000000 410.000000 1.000000 4.000000 1.000000 1270.000000 1.000000 2.000000 3.000000 203103.000000 2.000000 1.000000 -3.000000 1.000000 1.000000 -1.000000 1.000000 1.000000 -1.000000 1.000000 3.000000 1.000000 4.000000 1.000000 6.000000 2.000000 2.000000 2.000000 3.000000 5.000000 2.000000 2.000000 5.000000e+07 398025.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 2.000000 2.000000 0.000000 0.359722 0.417518 0.000000 0.000000 0.330000 0.220000 0.330000 0.000000 0.500000 0.333333 0.000000 0.000000 0.000000 0.333333 0.330000 0.330000 0.330000 0.440000 0.000000 0.000000 1.000000 0.333333 0.500000 0.660000 0.660000 0.606667 0.222222 0.111111 0.444444 0.296296 0.330000 0.000000 0.330000 0.330000 1.000000 1.000000 2.000000 2.000000 61.000000 3.000000 25.000000 3.000000 34.000000 7.000000 0.000000 7.000000 25.000000 4.000000 0.500000 39.000000 53.339000 4.000000 5.020000 4.370000 6.800000 3.800000 3.800000 2.500000 4.000000 5.460000 4.410000 4.850000 2.000000 6.000000 3.000000 5.108900e+05 16784.660000 16116.700000 34.400000 27.800000 2.372458e+07 2.879368e+07 3.758926e+07 76.450000 1.100000 73.920000 1.886490e+07 6.470000 5.230000 4.780000 4.690000 92.280000 100.000000 20.650000 1.222871e+05 4.490000 60.000000 1.500000 61.390000 6.190000 3.900000 31.500000 10.000000 0.712000 10.000000 0.303000 0.963000 20.630000 0.760000 0.759000 13.600000 0.862000 2.100000 2.000000 65.800000 115.000000 -0.200000 1.000000 2.000000 1.310000 0.498000 0.339000 0.325000 0.360000 0.319000 0.712000 0.739000 0.681000 0.706000 0.713000 0.566000 -0.263000 -0.011000 0.868000 0.299000 0.783000 0.354000 0.783000 0.843000 0.720000 0.786000 0.432000 0.833000 0.395000 0.972000 0.068000 0.262000 0.052000 0.610000 1.058000 1.127000 0.696000 0.075000 0.694000 0.475000 0.792000 0.733000 0.949000 0.645000 0.700000 0.020000 -0.260000 0.070000 0.040000 -0.240000 -0.290000 31.000000 623.000000 1.000000 2.000000 1.000000 3.000000 3.000000 3.500000 3.083333 2.636364 4.888889 3.500000 2.636364 3.400000 5.300000 1.769231 2.250000 2.153846 3.125000 6.052555 5.824041 68.210839 5.420000 5.083400 0.552000 0.869000 -0.403000 -0.107000 -0.099000 0.059000 0.591000
75% 7.0 2020.000000 2.0 688.000000 714.000000 6.880703e+08 6.887203e+08 2.020041e+07 202003.000000 202010.000000 16.140000 17.230000 65.000000 2.000000 642034.000000 630004.000000 -4.000000e+00 -3.000000 642096.000000 8.000000 5.000000 5.000000 2.000000 2.680000e+02 71.195000 34.400000 5.350000e+02 2870.000000 2.000000 2.000000 1.000000 1.000000 0.833333 5.871278 6.882017e+06 1.000000 2.000000 2.000000 3.000000 2.000000 3.000000 1.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 1.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 3.000000 3.000000 4.000000 3.000000 3.000000 4.000000 2.000000 3.000000 2.000000 4.000000 2.000000 4.000000 4.000000 3.000000 3.000000 3.000000 4.000000 2.000000 3.000000 2.000000 2.000000 2.000000 3.000000 9.000000 9.000000 8.000000 4.000000 4.000000 4.000000 4.000000 4.000000 3.000000 2.000000 1.000000 3.000000 2.000000 4.000000 3.000000 3.000000 3.000000 3.000000 3.00000 3.000000 3.000000 3.000000 3.000000 3.000000 4.000000 4.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -2.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 8.000000 3.000000 2.000000 2.00000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 9.000000 8.000000 7.000000 6.000000 7.000000 2.000000 10.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 9.000000 4.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 3.000000 2.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 2.000000 2.000000 2.000000 3.000000 3.000000 2.000000 2.000000 3.000000 3.000000 3.000000 2.000000 2.000000 2.000000 3.000000 3.000000 3.000000 3.000000 3.000000 4.000000 10.000000 10.000000 8.000000 8.000000 7.000000 9.000000 10.000000 1.000000 2.000000 2.000000 2.000000 3.000000 3.000000 7.000000 7.000000 4.000000 2.000000 2.000000 2.000000 7.000000 5.000000 4.000000 2.000000 3.000000 2.000000 6.000000 5.000000 5.000000 8.000000 8.000000 4.000000 6.000000 2.000000 4.000000 2.000000 1.000000 5.000000 2.000000 6.000000 3.000000 4.000000 4.000000 3.000000 3.000000 5.000000 2.000000 5.000000 5.000000 5.000000 5.000000 5.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 2.000000 2.000000 504009.000000 504009.000000 504009.000000 3.000000 4.000000 3.000000 3.000000 3.000000 3.000000 3.000000 4.000000 3.000000 2.000000 2.000000 4.000000 3.000000 3.000000 4.000000 2.000000 4.000000 6.000000 9.000000 6.000000 10.000000 10.000000 7.000000 10.000000 9.000000 8.000000 10.000000 10.000000 8.000000 7.000000 3.000000 2.000000 2.000000 2.000000 2.000000 3.000000 3.000000 2.000000 1989.000000 55.000000 5.000000 3.000000 1.000000 1.000000 1.000000 1.000000 1.000000 688.000000 643.000000 642.000000 1.000000 5.000000 2.000000 3530.000000 5.000000 3.000000 5.000000 604007.000000 3.000000 3.000000 398005.000000 2.000000 3.000000 558002.000000 2.000000 3.000000 554003.000000 2.000000 5.000000 3.000000 6.000000 5.000000 8.000000 2.000000 2.000000 2.000000 4.000000 6.000000 2.000000 5.000000 9.010100e+07 642005.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 -4.000000 3.000000 2.000000 1.000000 0.485278 0.549259 0.500000 0.330000 0.330000 0.386667 0.660000 1.000000 1.000000 0.720000 1.000000 1.000000 1.000000 0.666667 0.660000 0.660000 0.660000 0.660000 1.000000 0.000000 1.000000 0.666667 0.750000 0.660000 1.000000 0.750000 0.666667 0.444444 0.777778 0.555556 0.660000 0.500000 0.580000 0.580000 1.000000 1.000000 4.000000 3.000000 86.000000 5.000000 36.000000 5.000000 52.000000 9.000000 1.000000 9.000000 53.000000 4.000000 0.710000 65.000000 66.216700 6.000000 6.460000 6.500000 8.300000 7.000000 5.800000 6.500000 5.800000 6.430000 5.450000 6.070000 4.000000 7.000000 4.000000 1.759540e+06 42575.610000 40314.230000 40.800000 31.300000 6.798886e+07 7.991041e+07 1.003881e+08 79.780000 1.420000 83.650000 4.481539e+07 8.200000 8.910000 7.240000 8.190000 98.490000 100.000000 43.600000 4.622987e+05 7.790000 106.000000 2.500000 91.430000 8.980000 5.200000 40.100000 12.000000 0.837000 12.000000 0.446000 0.988000 28.990000 0.873000 0.876000 20.200000 0.911000 5.300000 20.900000 84.400000 129.700000 2.900000 1.000000 7.000000 5.000000 0.798000 0.697000 0.549000 0.652000 0.592000 0.890000 0.873000 0.887000 0.930000 0.845000 0.838000 1.338000 1.250000 1.922000 1.719000 1.561000 1.267000 1.961000 1.608000 1.572000 1.651000 1.180000 1.446000 1.183000 1.782000 1.425000 1.742000 1.248000 1.475000 2.163000 1.977000 1.742000 1.729000 1.696000 0.733000 0.884000 0.883000 0.990000 0.890000 0.896000 0.840000 0.560000 1.370000 1.240000 1.130000 1.050000 35.000000 2299.000000 3.000000 3.000000 3.000000 3.000000 3.000000 5.600000 4.500000 5.625000 8.714286 5.833333 3.000000 5.857143 7.333333 2.600000 4.166667 5.833333 6.444444 6.353415 8.514563 74.000000 5.650000 6.512500 2.043000 1.737000 1.676000 2.525000 2.354000 0.459000 0.927000
max 7.0 2023.000000 2.0 909.000000 920.000000 9.090704e+08 9.090704e+08 2.023070e+07 202306.000000 202307.000000 23.580000 24.590000 300.000000 6.000000 909001.000000 909011.000000 7.920026e+06 90901.000000 909025.000000 8.000000 5.000000 5.000000 2.000000 1.004120e+09 156.890000 100.350000 9.791342e+07 9000.000000 3.000000 2.000000 2.000000 19.930071 2.237137 61.820012 9.092022e+06 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 5.000000 3.000000 5.000000 3.000000 5.000000 3.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 3.000000 3.000000 3.000000 3.000000 4.000000 5.000000 10.000000 10.000000 10.000000 4.000000 4.000000 4.000000 4.000000 4.000000 3.000000 2.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.00000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 10.000000 3.000000 3.000000 3.00000 2.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.00000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 1.000000 10.000000 10.000000 10.000000 10.000000 10.000000 3.000000 10.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 10.000000 5.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 2.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 2.000000 2.000000 2.000000 4.000000 4.000000 2.000000 2.000000 4.000000 4.000000 4.000000 2.000000 2.000000 2.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 2.000000 2.000000 2.000000 2.000000 4.000000 4.000000 7.000000 8.000000 4.000000 3.000000 2.000000 2.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 4.000000 4.000000 4.000000 4.000000 3.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 3.000000 4.000000 4.000000 909039.000000 909039.000000 909039.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 4.000000 5.000000 4.000000 4.000000 4.000000 4.000000 4.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 10.000000 4.000000 5.000000 4.000000 4.000000 4.000000 4.000000 4.000000 2.000000 2007.000000 103.000000 6.000000 3.000000 2.000000 2.000000 1.000000 2.000000 1.000000 9999.000000 9999.000000 9999.000000 2.000000 63.000000 4.000000 9900.000000 6.000000 24.000000 8.000000 909014.000000 3.000000 9.000000 860008.000000 3.000000 9.000000 860008.000000 3.000000 9.000000 860008.000000 3.000000 8.000000 9.000000 11.000000 11.000000 11.000000 3.000000 2.000000 4.000000 5.000000 10.000000 3.000000 9.000000 1.000000e+08 909017.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 5.000000 10.000000 4.000000 5.000000 5.000000 3.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.014000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 6.000000 3.000000 99.000000 7.000000 40.000000 6.000000 59.000000 10.000000 9.000000 10.000000 209.000000 5.000000 0.840000 87.000000 80.675100 7.000000 9.520000 9.950000 10.000000 10.000000 10.000000 10.000000 9.800000 9.640000 7.360000 9.120000 5.000000 7.000000 4.000000 1.637687e+07 129103.010000 123965.290000 53.900000 41.900000 1.135185e+09 1.262645e+09 1.397715e+09 84.930000 2.920000 100.000000 7.810746e+08 14.800000 30.400000 16.730000 18.560000 100.000000 100.000000 99.960000 9.893038e+06 15.540000 188.000000 4.990000 352.820000 17.060000 7.500000 48.400000 14.100000 0.946000 17.000000 0.547000 1.031000 53.080000 0.939000 1.000000 34.500000 0.995000 56.300000 1096.200000 95.900000 259.400000 22.800000 1.150000 40.000000 34.000000 0.873000 0.815000 0.703000 0.791000 0.777000 0.964000 0.933000 0.969000 0.982000 0.986000 0.969000 3.399000 3.038000 3.599000 3.115000 3.022000 2.588000 2.861000 2.144000 2.315000 2.936000 1.560000 2.872000 2.565000 3.167000 2.933000 3.021000 3.253000 2.892000 3.264000 3.341000 2.926000 2.905000 3.012000 0.907000 0.953000 0.954000 1.000000 0.988000 0.983000 1.540000 1.600000 2.210000 2.160000 1.880000 2.170000 82.000000 7760.000000 4.000000 4.000000 4.000000 3.000000 3.000000 7.818182 8.181818 8.916667 9.285714 7.700000 7.857143 7.750000 8.181818 6.888889 6.777778 8.000000 9.000000 8.081818 9.777251 83.705786 7.260000 9.402100 2.407000 1.737000 1.676000 2.525000 2.354000 0.624000 0.927000

Preprocessing¶

Chose relevant columns¶

The dataset contains a lot of information that is not relevant to the task at hand. For example, information about the participant's age or country. This data is removed because it could influence the clustering, which is only supposed to cluster the values and beliefs of the individual. There are also a lot of missing values that need to be addressed and finally the data needs to be scaled for clustering.

The selected subset of the dataset is expected to contain some redundancy, as some variables assess the same or very similar values. It is therefore expected that there will be some correlation between variables. For the purposes of this analysis, these redundant variables will not be manually removed, but are expected to be meaningfully combined during dimensionality reduction.

In [6]:
pd.set_option("display.max_columns", None)
columns_to_drop = (
    # metadata
    [
        "version",
        "doi",
        "A_WAVE",
        "A_STUDY",
        "D_INTERVIEW",
        "J_INTDATE",
        "FW_END",
        "FW_START",
        "K_TIME_START",
        "K_TIME_END",
        "K_DURATION",
        "Q_MODE",
        "S018",
        "S025",
        "Q290",
        "N_REG_NUTS1",
        "L_INTERVIEWER_NUMBER",
    ]
    # location information
    + [
        "B_COUNTRY",
        "B_COUNTRY_ALPHA",
        "C_COW_NUM",
        "C_COW_ALPHA",
        "N_REGION_ISO",
        "N_REGION_WVS",
        "N_REGION_NUTS2",
        "N_TOWN",
        "G_TOWNSIZE",
        "G_TOWNSIZE2",
        "H_SETTLEMENT",
        "H_URBRURAL",
        "I_PSU",
        "O1_LONGITUDE",
        "O2_LATITUDE",
        "S_INTLANGUAGE",
        "LNGE_ISO",
        "E_RESPINT",
        "E1_LITERACY",
        "F_INTPRIVACY",
        "W_WEIGHT",
    ]
    + list(raw.filter(regex="ISO"))
    + list(raw.filter(regex="Region"))

    + list(raw.filter(regex="Q223"))  # party voted for (specific for in each country)
    + list(raw.filter(regex="X003R"))  # further age records (redundant with age)
    # ALL questions
    + list(raw.filter(regex="Q[0-9]"))
    # information about heritage and living circumstances
    + [
        "V001",
        "V002",
        "X002_02B",
        "V002A_01",
        "V001A_01",
    ]
    # data about the country or region (not included to prevent clusters being based on country specific data)
    + [
        "fhregion",
        "polregfh",
        "freestfh",
        "prfhrat",
        "prfhscore",
        "clfhrat",
        "clfhscore",
        "democ",
        "autoc",
        "polity",
        "durable",
        "regtype",
        "ruleoflaw",
        "corrupttransp",
        "electintegr",
        "btiregion",
        "btistatus",
        "btidemstatus",
        "btistate",
        "btipolpart",
        "btiruleoflaw",
        "btistability",
        "btiintegration",
        "btimarket",
        "btigovindex",
        "btigoveperform",
        "btiregime",
        "regionWB",
        "incomeWB",
        "landWB",
        "GDPpercap1",
        "GDPpercap2",
        "giniWB",
        "incrichest10p",
        "popWB1990",
        "popWB2000",
        "popWB2019",
        "lifeexpect",
        "popgrowth",
        "urbanpop",
        "laborforce",
        "deathrate",
        "unemployfem",
        "unemploymale",
        "unemploytotal",
        "accesselectr",
        "renewelectr",
        "co2emis",
        "co2percap",
        "easeofbusiness",
        "militaryexp",
        "Trade",
        "healthexp",
        "medageun",
        "meanschooling",
        "educationHDI",
        "compulseduc",
        "GII",
        "DGI",
        "womenparl",
        "hdi",
        "incomeindexHDI",
        "humanineqiality",
        "lifeexpectHDI",
        "homiciderate",
        "Refugeesorigin",
        "internetusers",
        "mobphone",
        "migrationrate",
        "schoolgpi",
        "femchoutsch",
        "choutsch",
        "v2x_polyarchy",
        "v2x_libdem",
        "v2x_partipdem",
        "v2x_delibdem",
        "v2x_egaldem",
        "v2x_freexp_altinf",
        "v2x_frassoc_thick",
        "v2xel_frefair",
        "v2xcl_rol",
        "v2x_cspart",
        "v2xeg_eqdr",
        "v2excrptps",
        "v2exthftps",
        "v2juaccnt",
        "v2cltrnslw",
        "v2clacjust",
        "v2clsocgrp",
        "v2clacfree",
        "v2clrelig",
        "v2csrlgrep",
        "v2mecenefm",
        "v2mecenefi",
        "v2mebias",
        "v2pepwrses",
        "v2pepwrgen",
        "v2peedueq",
        "v2pehealth",
        "v2peapsecon",
        "v2peasjsoecon",
        "v2clgencl",
        "v2peasjgen",
        "v2peasbgen",
        "v2cafres",
        "v2cafexch",
        "v2x_corr",
        "v2x_gender",
        "v2x_gencl",
        "v2x_genpp",
        "v2x_rule",
        "v2xcl_acjst",
        "td_voiacc",
        "td_polstab",
        "td_goveff",
        "td_regqual",
        "td_rulelaw",
        "td_ctrlcorr",
        "accessclfuel",
        "educationexp",
        "RESEMAVALWGT",
        "SECVALWGT"
    ]  
    # scale of the party (a lot of missing values)
    + ["ID_GPS", "ID_PartyFacts", "Partyname", "Partyabb", "CPARTY", "CPARTYABB"]
    + list(raw.filter(regex="Type_"))
    + list(raw.filter(regex="GPS_"))
    # country specific politics
    + ["WVS_LR_MedianVoter", "WVS_LibCon_MedianVoter"]
    + list(raw.filter(regex="v2"))
    + ["A_YEAR", "PWGHT"]  # year and weight of the individual entry
)
data = raw.copy().drop(columns=columns_to_drop)

Set index¶

In [7]:
# make sure that the column is suitable to  be an index
assert data["S007"].is_unique
# set index
data.set_index("S007", inplace=True)

Deal with missing values¶

For clustering, it is important that the data set does not contain any NaN values. However, negative values in the dataset indicate a missing value, which can be for many different reasons. None of these provide valuable information about the respondent's position on the question, so they are all converted to NaN values.

NOTE: Dropping missing values introduces a bias into the data as, for example, characteristics on political orientation only include respondents who have voted in the last election. As many countries do not have a functioning democracy, these countries are excluded. This means that the dataset only includes people from democratic countries who are interested and motivated enough to vote (and have the right to do so).

In [8]:
# replace values smaller than 0 with NaN
data.replace([-5, -4, -3, -2, -1], np.nan, inplace=True)

# drop rows with missing values
data.dropna(inplace=True)
data.info()
<class 'pandas.core.frame.DataFrame'>
Index: 1945 entries, 32720007 to 50720920
Data columns (total 40 columns):
 #   Column                      Non-Null Count  Dtype  
---  ------                      --------------  -----  
 0   Y001                        1945 non-null   float64
 1   Y002                        1945 non-null   float64
 2   Y003                        1945 non-null   float64
 3   SACSECVAL                   1945 non-null   float64
 4   RESEMAVAL                   1945 non-null   float64
 5   I_AUTHORITY                 1945 non-null   float64
 6   I_NATIONALISM               1945 non-null   float64
 7   I_DEVOUT                    1945 non-null   float64
 8   DEFIANCE                    1945 non-null   float64
 9   I_RELIGIMP                  1945 non-null   float64
 10  I_RELIGBEL                  1945 non-null   float64
 11  I_RELIGPRAC                 1945 non-null   float64
 12  DISBELIEF                   1945 non-null   float64
 13  I_NORM1                     1945 non-null   float64
 14  I_NORM2                     1945 non-null   float64
 15  I_NORM3                     1945 non-null   float64
 16  RELATIVISM                  1945 non-null   float64
 17  I_TRUSTARMY                 1945 non-null   float64
 18  I_TRUSTPOLICE               1945 non-null   float64
 19  I_TRUSTCOURTS               1945 non-null   float64
 20  SCEPTICISM                  1945 non-null   float64
 21  I_INDEP                     1945 non-null   float64
 22  I_IMAGIN                    1945 non-null   float64
 23  I_NONOBED                   1945 non-null   float64
 24  AUTONOMY                    1945 non-null   float64
 25  I_WOMJOB                    1945 non-null   float64
 26  I_WOMPOL                    1945 non-null   float64
 27  I_WOMEDU                    1945 non-null   float64
 28  EQUALITY                    1945 non-null   float64
 29  I_HOMOLIB                   1945 non-null   float64
 30  I_ABORTLIB                  1945 non-null   float64
 31  I_DIVORLIB                  1945 non-null   float64
 32  CHOICE                      1945 non-null   float64
 33  I_VOICE1                    1945 non-null   float64
 34  I_VOICE2                    1945 non-null   float64
 35  I_VOI2_00                   1945 non-null   float64
 36  VOICE                       1945 non-null   float64
 37  WVS_LR_PartyVoter           1945 non-null   float64
 38  WVS_LibCon_PartyVoter       1945 non-null   float64
 39  WVS_Polmistrust_PartyVoter  1945 non-null   float64
dtypes: float64(40)
memory usage: 623.0 KB

Scale data¶

The data is scaled, which is very important for clustering to ensure that each feature is treated equally. Although many features are between 0 and 1 by default.

In [9]:
# standardize the data (for pca)
X_standard = StandardScaler().fit_transform(data.values)
# MinMaxScaler scales the data to a fixed range [0, 1]
X_minmax = MinMaxScaler().fit_transform(data.values)
# create dataframes with the scaled data
data_standard = pd.DataFrame(X_standard, columns=data.columns, index=data.index)
data_minmax = pd.DataFrame(X_minmax, columns=data.columns, index=data.index)
In [10]:
# show the first 5 rows of the standardized data
data_minmax.head()
Out[10]:
Y001 Y002 Y003 SACSECVAL RESEMAVAL I_AUTHORITY I_NATIONALISM I_DEVOUT DEFIANCE I_RELIGIMP I_RELIGBEL I_RELIGPRAC DISBELIEF I_NORM1 I_NORM2 I_NORM3 RELATIVISM I_TRUSTARMY I_TRUSTPOLICE I_TRUSTCOURTS SCEPTICISM I_INDEP I_IMAGIN I_NONOBED AUTONOMY I_WOMJOB I_WOMPOL I_WOMEDU EQUALITY I_HOMOLIB I_ABORTLIB I_DIVORLIB CHOICE I_VOICE1 I_VOICE2 I_VOI2_00 VOICE WVS_LR_PartyVoter WVS_LibCon_PartyVoter WVS_Polmistrust_PartyVoter
S007
32720007 0.4 0.5 0.5 0.393507 0.472526 0.0 0.33 0.33 0.220000 0.00 0.0 0.333333 0.111111 1.0 0.0 0.0 0.333333 1.00 1.00 0.33 0.776667 0.0 0.0 1.0 0.333333 0.75 0.66 0.66 0.69 1.000000 0.000000 1.000000 0.666667 0.33 0.5 0.415 0.415 0.417606 0.384031 0.768085
32720009 0.2 0.5 1.0 0.060376 0.356083 0.0 0.00 0.33 0.110000 0.00 0.0 0.333333 0.111111 0.0 0.0 0.0 0.000000 0.00 0.00 0.00 0.000000 1.0 0.0 1.0 0.666667 0.75 0.66 0.66 0.69 0.000000 0.000000 0.000000 0.000000 0.66 0.0 0.330 0.330 0.610001 0.395879 0.990471
32720010 0.2 0.5 1.0 0.453276 0.485412 0.0 0.00 0.33 0.110000 1.00 1.0 1.000000 1.000000 0.0 0.0 0.0 0.000000 0.33 0.66 0.66 0.550000 1.0 0.0 1.0 0.666667 0.75 0.66 0.66 0.69 1.000000 0.444444 0.444444 0.629630 0.33 0.0 0.165 0.165 0.641535 0.414188 0.858256
32720011 0.2 0.5 0.0 0.711468 0.424485 0.5 0.66 0.33 0.496667 1.00 1.0 0.666667 0.888889 0.0 1.0 0.0 0.333333 1.00 0.66 1.00 0.886667 0.0 1.0 1.0 0.666667 0.75 0.33 0.00 0.36 0.777778 0.666667 0.777778 0.740741 0.33 0.0 0.165 0.165 0.417606 0.384031 0.768085
32720012 0.8 0.5 0.5 0.802184 0.514690 0.5 1.00 0.33 0.610000 0.66 1.0 0.333333 0.664444 1.0 1.0 1.0 1.000000 1.00 0.66 0.33 0.663333 0.0 1.0 1.0 0.666667 0.75 0.33 0.00 0.36 0.777778 0.777778 0.888889 0.814815 0.33 0.5 0.415 0.415 0.417606 0.384031 0.768085

Exploratory Data Analysis (EDA)¶


In [11]:
data_minmax.agg(["min", "mean", "max", "unique"])
Out[11]:
Y001 Y002 Y003 SACSECVAL RESEMAVAL I_AUTHORITY I_NATIONALISM I_DEVOUT DEFIANCE I_RELIGIMP I_RELIGBEL I_RELIGPRAC DISBELIEF I_NORM1 I_NORM2 I_NORM3 RELATIVISM I_TRUSTARMY I_TRUSTPOLICE I_TRUSTCOURTS SCEPTICISM I_INDEP I_IMAGIN I_NONOBED AUTONOMY I_WOMJOB I_WOMPOL I_WOMEDU EQUALITY I_HOMOLIB I_ABORTLIB I_DIVORLIB CHOICE I_VOICE1 I_VOICE2 I_VOI2_00 VOICE WVS_LR_PartyVoter WVS_LibCon_PartyVoter WVS_Polmistrust_PartyVoter
min 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
mean 0.431362 0.46144 0.383548 0.408362 0.515318 0.220566 0.144355 0.287882 0.217601 0.513542 0.476607 0.707969 0.566039 0.40874 0.312596 0.192288 0.304542 0.33201 0.400627 0.489357 0.407332 0.560925 0.285347 0.906941 0.584404 0.664524 0.700817 0.802026 0.722456 0.571837 0.478492 0.621879 0.557403 0.436504 0.352442 0.394473 0.394473 0.449812 0.401342 0.63458
max 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
unique [0.4, 0.2, 0.8, 0.6000000000000001, 0.0, 1.0] [0.5, 0.0, 1.0] [0.5, 1.0, 0.0] [0.39350733324886733, 0.06037642700173446, 0.45327647899200046, 0.7114682225882414, 0.802183591173014, 0.8786398647379298, 0.7108609413296401, 0.2870146664977347, 0.4535801196213011, 0.13561923028192704, 0.39259641136096535, 0.7864073852391333, 0.5133492653644343, 0.5907153685847725, 0.606189026121832, 0.3622574697779273, 0.2421118970330597, 0.22572840984057774, 0.7427180860591815, 0.43841010271354236, 0.6962982056804826, 0.33191743596240975, 0.16535198283884328, 0.07524280328019259, 0.30097... [0.47252568618980395, 0.3560827391476683, 0.4854122037793326, 0.4244846061005536, 0.5146902292272544, 0.5396905632479281, 0.18448407166747574, 0.23907195696032282, 0.40917532522479594, 0.7907727902305635, 0.3644332559889907, 0.5039169490997031, 0.3969067458815252, 0.6309795267595096, 0.5824741579338818, 0.4819584300137617, 0.4561853948347043, 0.6155154829716262, 0.503453773765571, 0.4596391686002753, 0.34793820172176526, 0.619432432071329, 0.4024737571090734, 0.0913913965181685, 0.4272168952... [0.0, 0.5, 1.0] [0.33, 0.0, 0.66, 1.0] [0.33, 0.66, 0.0, 1.0] [0.22, 0.11, 0.496667, 0.61, 0.553333, 0.0, 0.166667, 0.386667, 0.333333, 0.5, 0.33, 0.663333, 0.276667, 0.443333, 0.773333, 0.666667, 0.776667, 0.606667, 0.44, 0.72, 0.886667, 1.0, 0.833333] [0.0, 1.0, 0.66, 0.33] [0.0, 1.0] [0.333333, 1.0, 0.666667, 0.833333, 0.5, 0.0, 0.166667] [0.111111, 1.0, 0.888889, 0.664444, 0.721111, 0.72, 0.497778, 0.221111, 0.11, 0.387778, 0.886667, 0.443333, 0.0, 0.166667, 0.165556, 0.222222, 0.055556, 0.331111, 0.553333, 0.333333, 0.666667, 0.386667, 0.442222, 0.776667, 0.276667, 0.944444, 0.831111, 0.22, 0.332222, 0.611111, 0.775556, 0.777778, 0.498889, 0.277778, 0.444444, 0.5, 0.275556, 0.555556, 0.833333, 0.388889, 0.61, 0.665556, 0.608889, 0.554444] [1.0, 0.0] [0.0, 1.0] [0.0, 1.0] [0.333333, 0.0, 1.0, 0.666667] [1.0, 0.0, 0.33, 0.66] [1.0, 0.0, 0.66, 0.33] [0.33, 0.0, 0.66, 1.0] [0.776667, 0.0, 0.55, 0.886667, 0.663333, 1.0, 0.22, 0.773333, 0.66, 0.553333, 0.44, 0.33, 0.11, 0.443333, 0.666667, 0.333333] [0.0, 1.0] [0.0, 1.0] [1.0, 0.0] [0.333333, 0.666667, 0.0, 1.0] [0.75, 0.5, 0.25, 0.0, 1.0] [0.66, 0.33, 1.0, 0.0] [0.66, 0.0, 0.33, 1.0] [0.69, 0.36, 0.72, 0.386667, 0.803333, 0.916667, 0.606667, 0.523333, 0.496667, 0.47, 0.58, 0.833333, 0.61, 0.25, 0.303333, 0.276667, 0.413333, 0.526667, 0.693333, 0.083333, 0.166667, 0.75, 0.5, 0.193333, 0.583333, 0.636667, 0.416667, 0.11, 0.776667, 0.44, 0.886667, 0.666667, 0.333333, 0.22, 0.553333, 0.33, 1.0, 0.443333, 0.663333, 0.0, 0.773333] [1.0, 0.0, 0.777778, 0.444444, 0.555556, 0.222222, 0.666667, 0.333333, 0.888889, 0.111111] [0.0, 0.444444, 0.666667, 0.777778, 0.555556, 1.0, 0.222222, 0.111111, 0.888889, 0.333333] [1.0, 0.0, 0.444444, 0.777778, 0.888889, 0.666667, 0.555556, 0.222222, 0.333333, 0.111111] [0.666667, 0.0, 0.62963, 0.740741, 0.814815, 0.185185, 0.296296, 1.0, 0.111111, 0.925926, 0.888889, 0.703704, 0.444444, 0.37037, 0.407407, 0.777778, 0.333333, 0.074074, 0.222222, 0.555556, 0.518519, 0.592593, 0.851852, 0.481481, 0.148148, 0.037037, 0.259259, 0.962963] [0.33, 0.66, 0.0, 1.0] [0.5, 0.0, 1.0] [0.415, 0.33, 0.165, 0.25, 0.0, 0.665, 0.58, 0.75, 0.5, 0.83, 1.0] [0.415, 0.33, 0.165, 0.25, 0.0, 0.665, 0.58, 0.75, 0.5, 0.83, 1.0] [0.41760620455258546, 0.6100014391831272, 0.6415354997018634, 0.5611584989166236, 0.614155227387466, 0.23244064577397916, 0.6550917816589275, 0.0, 0.5421149646684642, 0.24164579606440095, 0.2560364555744319, 0.266333874198311, 0.5227959193396361, 0.5820699034520167, 0.24172869688300125, 0.082441379595669, 0.6338200580714215, 0.6201653109371033, 0.39328177944200604, 0.2634950891601646, 0.8790264219705854, 0.787879125297702, 0.9071698837990985, 1.0, 0.9815384615384619] [0.3840314930924976, 0.3958793814548853, 0.4141875452040864, 0.463909069782379, 0.5696178361100384, 0.8032545752092404, 0.8421301896339115, 0.8417940528911818, 0.869110629543755, 0.8442673028608025, 0.6629495997436379, 0.8113001890123912, 0.3898713654318403, 0.2579066584974744, 0.2148394852844534, 0.0, 0.20579136885474036, 0.7602488746564844, 0.2478785930238977, 0.253120131089105, 0.9710772297104908, 0.9472971409712942, 1.0, 0.9880811675715455, 0.9308310517975005] [0.7680849260193652, 0.9904707960739563, 0.8582562276212908, 0.894334513675034, 0.6757071303727673, 0.7570868456366902, 0.5603459824927026, 0.8640503157600945, 0.7053770885535493, 0.7858388647645687, 0.8582931354867251, 0.9580125347588244, 0.7077666941815453, 0.6121599427324578, 0.6121976759705572, 0.7191665274025787, 1.0, 0.7464713655764259, 0.7464037657769578, 0.7065661269183894, 0.2308106820490179, 0.12422182953050331, 0.13769621654141928, 0.2386112064270267, 0.0]

3 Highlights:

  • High variance features
  • Low variance features
  • correlation matrix
In [12]:
# filter the non-binary features with the highest and lowest variance
data_minmax_non_binary = data_minmax[data_minmax.keys()[data_minmax.nunique() != 2]]
high_var_keys = data_minmax_non_binary.var().sort_values(ascending=False).head(5).keys()
low_variance_keys = data_minmax_non_binary.var().sort_values(ascending=True).head(5).keys()

fig, ax = plt.subplots(1, 2, figsize=(20, 5))

for i, features in enumerate([list(high_var_keys), list(low_variance_keys)]):
    # create violin plot as they can show the distribution of the data more detailed than a boxplot
    sns.violinplot(data=data_minmax[features], ax=ax[i], inner="point", palette='crest')
    # plot mean with mean value
    ax[i].scatter(x=range(len(features)), y=data_minmax[features].mean(), color="red", label='mean', s=50, zorder=10,)
    # set legend right to plot
    ax[i].legend(loc='center left', bbox_to_anchor=(1, 0.5))
    # rotate x-axis labels
    ax[i].set_xticks(range(len(features)))
    ax[i].set_xticklabels(features, rotation=20)
    # adjust y-axis to make it more readable
    ax[i].set_yticks(np.arange(0, 1.1, 0.1))

ax[0].set_title("High Variance Features")
ax[1].set_title("Low Variance Features")
plt.show()
No description has been provided for this image
In [13]:
# display the features with the highest variance
df_summary = data_minmax_non_binary.describe().T[["std", "mean"]]
df_summary = pd.merge(df_summary, df_translation, left_index=True, right_index=True, how="left")
df_summary[["std", "mean", "Explanation"]].sort_values("std", axis=0, ascending=False).head(5)
Out[13]:
std mean Explanation
I_HOMOLIB 0.409935 0.571837 Y023A
I_VOICE2 0.398461 0.352442 Y024B
I_RELIGIMP 0.390130 0.513542 Y012A
I_ABORTLIB 0.373235 0.478492 Y023B
I_DIVORLIB 0.365920 0.621879 Y023C
In [14]:
# display the features with the lowest variance
df_summary[["std", "mean", "Explanation"]].sort_values("std", axis=0).head(5)
Out[14]:
std mean Explanation
SACSECVAL 0.190640 0.408362 Y010
DEFIANCE 0.193697 0.217601 Y011
WVS_Polmistrust_PartyVoter 0.214812 0.634580 NaN
I_NATIONALISM 0.219075 0.144355 Y011B
RESEMAVAL 0.222604 0.515318 Y020

Characteristics with High Variance:. The characteristic with the highest variance is acceptance of homosexuality (I_HOMOLIB). This means that this question is the most ambiguous feature in the data and that people's opinions on this topic are the most diverse. The violin plot shows that although there are opinions in between, the extremes dominate the picture. Other features with high variance include views on religion (I_RELIGIMP), abortion (I_ABORTLIB), divorce (I_DIVORLIB) and freedom of expression (I_VOICE). It is not surprising that some of these issues are much debated in public discourse.

Low variance characteristics:. These include the two main scales constructed from a combination of different values (SACSECVAL and RESEMVAL). This may be because they capture a lot of nuance and information. Perhaps the most interesting observation is that nationalism has a rather low mean and variance, suggesting that many people are patriotic about their nationality and value their national interest highly (inverted scale). Another interesting observation is that political distrust (WVS_Polmistrust_PartyVoter) has high scores and low variance, indicating that most of the respondents are sceptical about their political leaders (although it is not clear from the documentation how this particular index was calculated).

NOTE: Binary values are excluded as they are expected to have high variance by default, as no values between 0 and 1 are allowed.

In [15]:
# plot the correlation matrix as a heatmap
plt.figure(figsize=(15, 15))
sns.heatmap(data.corr(), cmap="coolwarm",)
plt.show()
No description has been provided for this image

The correlation matrix shows that there is some correlation between the features. As mentioned earlier, this is not surprising as some features measure the same values. For example, "VOICE", "I_VOICE1", "I_VOICE2" and "I_VOI2_00" all measure values related to freedom of expression by assessing different sets of responses to questions. It is important to note that although they all measure freedom of expression, they are not fully correlated, which may indicate ambiguity even within the values.

Furthermore, political orientations such as liberal and conservative (WVS_LibCon_PartyVoter) are correlated (in this case they are anti-correlated because the scales are constructed differently) with their values such as women's rights (I_WOMJOB, I_WOMPOL, I_WOMEDU) or homosexual acceptance (I_HOMOLIB). The correlation between autonomy (Y002) and freedom of expression (I_VOICE1) is also interesting.

Clustering 1 -- Plain Data¶


In [16]:
from src.visualization import visualize_silhouette_scores, visualize_KElbow
from src.clustering import perform_kmeans

# perform k-means clustering with minmax scaled data
silhouette_scores_minmax, labels_minmax = perform_kmeans(X_minmax, 2, random_state)
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
In [17]:
# perform k-means clustering with standard scaled data
silhouette_scores_standard, labels_standard = perform_kmeans(X_standard, 2, random_state)
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
In [18]:
# KMeans with standardized data
_, _ = perform_kmeans(X_minmax, 11, random_state)
No description has been provided for this image
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/yellowbrick/utils/kneed.py:156: YellowbrickWarning: No 'knee' or 'elbow point' detected This could be due to bad clustering, no actual clusters being formed etc.
  warnings.warn(warning_message, YellowbrickWarning)
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/yellowbrick/cluster/elbow.py:374: YellowbrickWarning: No 'knee' or 'elbow' point detected, pass `locate_elbow=False` to remove the warning
  warnings.warn(warning_message, YellowbrickWarning)
No description has been provided for this image
No description has been provided for this image

The plots above evaluate the KMeans++ clustering for cluster sizes of 2 to 19. Any number of clusters attempted suggests no clustering structure or a clustering structure that is not properly detected by kmeans. According to Silhouette scores, the best number of clusters would be 2. According to KELbow, the best number of clusters would be 6. However, as KELbow does not take into account the cluster size of 2 because of the missing derivative, the best cluster size is most likely 2 because the Silhouette score is the highest. There is very little difference between the performance of the clustering between the standard and minmax scaled data.

In [19]:
# perform k-means test other hyperparameters
kmeans = KMeans(n_clusters=2, random_state=random_state, verbose=1, n_init=5, max_iter=1000, tol=1e-6)#.fit_predict(X_minmax)
visualizer = SilhouetteVisualizer(kmeans, colors="yellowbrick")
visualizer.fit(X_minmax)
visualizer.finalize()
Initialization complete
Iteration 0, inertia 12877.449359570966.
Iteration 1, inertia 7289.432740276388.
Iteration 2, inertia 6941.3964704948.
Iteration 3, inertia 6874.226801742749.
Iteration 4, inertia 6858.38594610504.
Iteration 5, inertia 6853.629415653015.
Iteration 6, inertia 6851.979830159411.
Iteration 7, inertia 6851.518230921836.
Iteration 8, inertia 6851.303553764679.
Iteration 9, inertia 6851.243972173218.
Iteration 10, inertia 6851.235637236842.
Converged at iteration 10: strict convergence.
Initialization complete
Iteration 0, inertia 17950.52413410925.
Iteration 1, inertia 7319.467068827951.
Iteration 2, inertia 6924.271283296326.
Iteration 3, inertia 6858.231150086325.
Iteration 4, inertia 6851.812600473422.
Iteration 5, inertia 6851.318574079467.
Iteration 6, inertia 6851.2601223171505.
Iteration 7, inertia 6851.251058487012.
Converged at iteration 7: strict convergence.
Initialization complete
Iteration 0, inertia 13548.594456589275.
Iteration 1, inertia 7022.301084939187.
Iteration 2, inertia 6863.85866448759.
Iteration 3, inertia 6854.570496147007.
Iteration 4, inertia 6852.102653281122.
Iteration 5, inertia 6851.518230921836.
Iteration 6, inertia 6851.303553764679.
Iteration 7, inertia 6851.243972173218.
Iteration 8, inertia 6851.235637236842.
Converged at iteration 8: strict convergence.
Initialization complete
Iteration 0, inertia 12759.104390107164.
Iteration 1, inertia 6993.332847397781.
Iteration 2, inertia 6905.909833586857.
Iteration 3, inertia 6872.784491800482.
Iteration 4, inertia 6859.385198794023.
Iteration 5, inertia 6854.036336680943.
Iteration 6, inertia 6852.085712140771.
Iteration 7, inertia 6851.518230921836.
Iteration 8, inertia 6851.303553764679.
Iteration 9, inertia 6851.243972173218.
Iteration 10, inertia 6851.235637236842.
Converged at iteration 10: strict convergence.
Initialization complete
Iteration 0, inertia 11884.695878180304.
Iteration 1, inertia 7093.05217744987.
Iteration 2, inertia 6882.784783957902.
Iteration 3, inertia 6857.619422304591.
Iteration 4, inertia 6852.915288584971.
Iteration 5, inertia 6851.662350316161.
Iteration 6, inertia 6851.377554602604.
Iteration 7, inertia 6851.280965868249.
Iteration 8, inertia 6851.235637236842.
Converged at iteration 8: strict convergence.
No description has been provided for this image

Choice of Hyperparameters

  • n_clusters: determined by experimenting with different cluster sizes as shown.
  • init: k-means++ because it is superior to random in most cases.
  • n_init: 5 because even at 5 their final inertia is almost the same, suggesting that they all converge to the same result.
  • max_iter: 1000 (although the algorithm converges after 7-10 iterations).
  • tol: $10^{-6}$ because with this tolerance the algorithm converges strictly, i.e. the centroids do not change between iterations.
  • Algorithm: "lloyd" because this is the algorithm presented in the lecture.

Dimensionality Reduction¶


In [20]:
# create and visualize PCA with 80% explained variance
model = pca(n_components=0.8)
results = model.fit_transform(X_standard)
fig, ax = model.plot()
fig, ax = model.biplot(n_feat=10, legend=False)
plt.show()
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed to capture [80.0%] explained variance using the [40] columns of the input data.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Number of components is [11] that covers the [80.00%] explained variance.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[11]
[scatterd] >INFO> Create scatterplot
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Plot PC1 vs PC2 with loadings.
[scatterd]> WARNING use the standardized verbose status. The status [1-6] will be deprecated in future versions.
No description has been provided for this image
No description has been provided for this image

The explained variance curve of the PCA reaches almost 100% after only 28 principal components. This indicates a high correlation in the dataset, which was to be expected as mentioned before. However, for an explained variance of 80%, 11 principal components are still needed.

In [21]:
# create and visualize PCA with 2 principal components
model = pca(n_components=2)
results = model.fit_transform(X_standard)
fig, ax = model.plot()
fig, ax = model.biplot(n_feat=10, legend=False)
plt.show()
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[2]
[scatterd] >INFO> Create scatterplot
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Plot PC1 vs PC2 with loadings.
[scatterd]> WARNING use the standardized verbose status. The status [1-6] will be deprecated in future versions.
No description has been provided for this image
No description has been provided for this image

Two components already explain 40% of the variance.

Clustering 2 -- PCA-transformed Data¶


In [22]:
# perform k-means clustering with PCA data
X_pca = results["PC"].values
silhouette_scores_pca, labels_pca = perform_kmeans(X_pca, 2, random_state)
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
In [23]:
# hyperparameters to be tested
hyperparameters = {
    "pca_components": range(2, 12),
    "kmeans_clusters": range(2, 10),
}

silhoutte_coefficients = []

# iterate over all hyperparameters and calculate silhouette coefficient
for pca_components in hyperparameters["pca_components"]:
    model = pca(n_components=pca_components, random_state=random_state)
    results_p = model.fit_transform(X_standard)
    X_p = results_p["PC"].values
    for kmeans_clusters in hyperparameters["kmeans_clusters"]:
        # calculate silhouette coefficient
        silhoutte_coefficient = silhouette_score(
            X_p, KMeans(n_clusters=kmeans_clusters, random_state=random_state).fit_predict(X_p)
        )
        silhoutte_coefficients.append((silhoutte_coefficient, kmeans_clusters, f"{str(pca_components)} components with {str(round(results_p['explained_var'][-1], 2))} explained variance"))
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[2]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[3]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[4]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[5]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[6]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[7]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[8]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[9]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[10]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
[pca] >Column labels are auto-completed.
[pca] >Row labels are auto-completed.
[pca] >The PCA reduction is performed on the [40] columns of the input dataframe.
[pca] >Fit using PCA.
[pca] >Compute loadings and PCs.
[pca] >Compute explained variance.
[pca] >Outlier detection using Hotelling T2 test with alpha=[0.05] and n_components=[11]
[pca] >Multiple test correction applied for Hotelling T2 test: [fdr_bh]
[pca] >Outlier detection using SPE/DmodX with n_std=[3]
In [24]:
silhoutte_coefficients.append((silhouette_scores_minmax[2], 2, "Without PCA"))
# plot relationship between silhouette coefficient, number of clusters and PCA accuracy
silhoutte_coefficients_df = pd.DataFrame(silhoutte_coefficients, columns=["Silhouette Coefficient", "Clusters", "PCA Components - Explained Variance"])

# plot results
plt.figure(figsize=(15, 10))
sns.lineplot(data=silhoutte_coefficients_df, x="Clusters", y="Silhouette Coefficient", hue="PCA Components - Explained Variance")
plt.show()
No description has been provided for this image

The plot above shows the results of k-means for different numbers of principal components and different cluster sizes. In general, the silhouette scores are higher with a smaller number of principal components. Another trend is that the silhouette scores tend to decrease as the number of clusters increases.

Again, the most appropriate number of clusters is two, as the silhouette scores are highest in this case.

In [25]:
# tune other hyperparameters
kmeans = KMeans(n_clusters=2, random_state=random_state, verbose=1, n_init=5, max_iter=1000, tol=1e-6)
visualizer = SilhouetteVisualizer(kmeans, colors="yellowbrick")
visualizer.fit(X_pca)
visualizer.finalize()
Initialization complete
Iteration 0, inertia 29218.28719139794.
Iteration 1, inertia 16491.125043251683.
Iteration 2, inertia 15576.58522302522.
Iteration 3, inertia 15344.585659991566.
Iteration 4, inertia 15254.445806689278.
Iteration 5, inertia 15212.57965275062.
Iteration 6, inertia 15196.668294139372.
Iteration 7, inertia 15192.674233586093.
Iteration 8, inertia 15190.332490846475.
Iteration 9, inertia 15189.611512045612.
Iteration 10, inertia 15189.453979354994.
Iteration 11, inertia 15189.296201424908.
Iteration 12, inertia 15189.22084579893.
Iteration 13, inertia 15189.188201417415.
Converged at iteration 13: strict convergence.
Initialization complete
Iteration 0, inertia 23249.85822914773.
Iteration 1, inertia 16590.83985782184.
Iteration 2, inertia 15945.954754478935.
Iteration 3, inertia 15624.221553855128.
Iteration 4, inertia 15457.303436060534.
Iteration 5, inertia 15334.815278013153.
Iteration 6, inertia 15265.548813816076.
Iteration 7, inertia 15222.05986554928.
Iteration 8, inertia 15199.07184782115.
Iteration 9, inertia 15193.614280955979.
Iteration 10, inertia 15191.213769361533.
Iteration 11, inertia 15189.920276454985.
Iteration 12, inertia 15189.264590553808.
Iteration 13, inertia 15189.231687045656.
Iteration 14, inertia 15189.208581536248.
Iteration 15, inertia 15189.188201417415.
Converged at iteration 15: strict convergence.
Initialization complete
Iteration 0, inertia 18147.618636031286.
Iteration 1, inertia 15412.17953368368.
Iteration 2, inertia 15231.036911125113.
Iteration 3, inertia 15200.653990834293.
Iteration 4, inertia 15193.598707773144.
Iteration 5, inertia 15190.74991717203.
Iteration 6, inertia 15189.737608831634.
Iteration 7, inertia 15189.264590553808.
Iteration 8, inertia 15189.231687045656.
Iteration 9, inertia 15189.208581536248.
Iteration 10, inertia 15189.188201417415.
Converged at iteration 10: strict convergence.
Initialization complete
Iteration 0, inertia 45258.66826422416.
Iteration 1, inertia 21650.305273197686.
Iteration 2, inertia 18483.85592975407.
Iteration 3, inertia 16987.001345588666.
Iteration 4, inertia 16249.436443482451.
Iteration 5, inertia 15768.747248102576.
Iteration 6, inertia 15533.230947994332.
Iteration 7, inertia 15384.61753828928.
Iteration 8, inertia 15298.00337278405.
Iteration 9, inertia 15250.043740103785.
Iteration 10, inertia 15215.395730195845.
Iteration 11, inertia 15195.898176531704.
Iteration 12, inertia 15192.265367756228.
Iteration 13, inertia 15190.153308793171.
Iteration 14, inertia 15189.284649215906.
Iteration 15, inertia 15189.26459055381.
Iteration 16, inertia 15189.231687045654.
Iteration 17, inertia 15189.208581536246.
Iteration 18, inertia 15189.188201417415.
Converged at iteration 18: strict convergence.
Initialization complete
Iteration 0, inertia 17387.984145497358.
Iteration 1, inertia 15554.365495812952.
Iteration 2, inertia 15338.50792956902.
Iteration 3, inertia 15251.782443896926.
Iteration 4, inertia 15211.713567205685.
Iteration 5, inertia 15196.668294139372.
Iteration 6, inertia 15192.674233586093.
Iteration 7, inertia 15190.332490846475.
Iteration 8, inertia 15189.611512045612.
Iteration 9, inertia 15189.453979354994.
Iteration 10, inertia 15189.29620142491.
Iteration 11, inertia 15189.220845798933.
Iteration 12, inertia 15189.188201417415.
Converged at iteration 12: strict convergence.
No description has been provided for this image

It is interesting to see that kmeans on the reduced data takes between 6 and 13 iterations, while kmeans on the original data takes 7-10 iterations. However, clustering on the pca reduced data results in much higher silhouette scores. The same hyperparameter setting as for the original data seems to be appropriate.

NOTE: The inertia between the original clustering and the PCA clustering cannot be meaningfully compared, as PCA changes the distances.

Clustering Comparison: Compare the two clusterings (on the plain data and on the PCA-transformed data) with respect to cluster memberships.

(Commented code + text/bullet points, add cells)

In [26]:
from src.visualization import plot_confusion_matrix

plot_confusion_matrix(labels_standard[2], labels_pca[2], "KMeans without PCA", "KMeans with PCA", 2)
No description has been provided for this image

Observation:

  • In terms of membership, the two clusterings find almost exactly the same clusters, despite the higher silhouette scores in the reduced data.
  • There are only about 1% (22/1945) percent of the samples that have a different membership than the other cluster.
  • For both clusterings, a cluster size of two gave the highest Silhouette scores.

This could indicate several things:

  1. The structure of the data is preserved during dimensionality reduction and the clusters become more separable and compact (due to higher Silhouette scores).
  2. There is a lot of redundancy in the data (which is very likely given the characteristics of the dataset).
  3. Clustering is reasonably robust despite low silhouette scores.

Interpretation¶


In [27]:
# create dataframe with cluster labels
results = pd.DataFrame(X_standard, columns=data.columns)
results["Cluster"] = labels_minmax[2]

# plot the mean of each cluster with regard to all features
results.groupby("Cluster").mean().T.plot(kind="bar",  figsize=(15, 10), color=["firebrick", "royalblue"])
plt.title("Mean of each cluster with regard to all features")
plt.show()
No description has been provided for this image

The standard scaled data shows quite clearly that the means of the clusters differ for all characteristics (although not in an extreme way for all). If they both had the same mean, this mean would necessarily be zero, as this is the way the data is scaled.

The size of the difference depends on the characteristic. A large difference in the mean indicates a high importance of the feature in identifying the cluster.

In [28]:
fig = plt.figure(figsize=(15,10))


# add errorbar to the plot for cluster 0
plt.errorbar(
    results.drop(columns='Cluster').columns,
    results.groupby("Cluster").mean().T[0],
    yerr= results.groupby("Cluster").std().T[0],
    capsize=10,
    color="firebrick",
    fmt="o",
    elinewidth=2,
    alpha=0.7,
    markersize=10,
    #elinestyle=':',
    label='Standard Deviation 0'
)

# add errorbar to the plot for cluster 0
plt.errorbar(
    results.drop(columns='Cluster').columns,
    results.groupby("Cluster").mean().T[1],
    yerr= results.groupby("Cluster").std().T[1],
    color="royalblue",
    fmt="o",
    elinewidth=2, 
    markersize=10,
    #elinestyle=':',
    alpha=0.7, 
    label = "Standard Deviation 1"
)

plt.xticks(rotation=90)
plt.legend()
plt.title("Standard Deviation for each Cluster and Feature")
plt.show()
No description has been provided for this image

However, if we look at the standard deviations between clusters and characteristics, a different picture emerges. For most of the characteristics, there is already quite a strong overlap in the first standard deviation. This suggests that the distance between clusters and the separability of clusters is not very clear. This is consistent with the rest of the results, such as the rather low slihouette scores.

In [29]:
plt.scatter(X_pca[:, 0], X_pca[:, 1], c=labels_pca[2], cmap="viridis")
plt.title("The two clusters in the PCA-reduced space")
Out[29]:
Text(0.5, 1.0, 'The two clusters in the PCA-reduced space')
No description has been provided for this image

The visualisation above reinforces the point that the data do not appear to be clearly separable when PCA is used as a dimension reduction.

In [30]:
from sklearn.manifold import TSNE

# create dimensionality reduction with t-SNE
tsne = TSNE(n_components=2, random_state=random_state)
X_tsne = tsne.fit_transform(X_minmax)

plt.scatter(X_tsne[:, 0], X_tsne[:, 1], c=labels_pca[2], cmap="viridis")
plt.title("PCA-clusters in the t-SNE-reduced space")
Out[30]:
Text(0.5, 1.0, 'PCA-clusters in the t-SNE-reduced space')
No description has been provided for this image

The use of t-distributed Stochastic Neighbor Embedding (t-SNE) as a form of dimensionality reduction suggests that the results obtained in this notebook could have been very different if other forms of dimensionality reduction had been used. It is quite obvious that the clustering on the pca data is not well reflected in the T-SNE reduced data. Perhaps the structure of the data would be better served by non-linear approaches such as t-SNE and Uniform Manifold Approximation and Projection (UMAP). It may, however, also be the case that t-SNE adds distortion to the data.

In [31]:
# get features with the biggest difference
diff = results.groupby("Cluster").mean().T
diff["Difference"] = abs(diff[0] - diff[1])
highest_difference = list(diff.sort_values("Difference", ascending=False)[1:].head(11).index)

# create violin plot for the features with the highest difference
subset = results[highest_difference + ['Cluster']].reset_index().melt(id_vars=['index', 'Cluster'], var_name='Feature', value_name='Value')
fig = plt.figure(figsize=(20, 10))
sns.violinplot(data=subset, x='Feature', y='Value', hue='Cluster', split=True, inner="point", palette='crest')

plt.scatter(x=range(len(highest_difference)), y=results[highest_difference + ['Cluster']].groupby('Cluster').mean().loc[0], color="red", label='Mean 0', s=50, zorder=10)
plt.scatter(x=range(len(highest_difference)), y=results[highest_difference + ['Cluster']].groupby('Cluster').mean().loc[1], color="blue", label='Mean 1', s=50, zorder=10)

# set legend right to plot
plt.legend(loc='center left', bbox_to_anchor=(1, 0.5))

plt.title("Clusters with the highest difference")
plt.show()
No description has been provided for this image

In the following, I will describe the overall tendency in the clusters, although of course this does not apply to every individual belonging to each cluster. Furthermore, each statement refers to the comparison with the other cluster.

Characteristics of Cluster 1:

  • High in emancipative values (RESEMVAL): value autonomy, freedom of choice (CHOICE), equality (EQUALITY) and political participation.
  • High in secular values (SACSECVAL): rather non-religious (I_RELIGMP) and modern in their personal beliefs and behaviours
  • High acceptance of LGBTQ+ people and support for their rights (I_HOMOLIB)
  • Supportive of women's right to abortion (I_APORTLIB)
  • Supportive of the freedom to divorce (I_DIVORLIB)
  • In favour of women working (I_WOMJOB)
  • Tend not to believe in a deity or supernatural forces (DISBELIEF)
  • More likely to vote for a liberal party (WVS_LibCon_PartyVoter)

Characteristics of Cluster 2:

  • Low on emancipative values (RESEMVAL): value obedience to authority, patriotism
  • Low on secular values (SACSECVAL): Rather religious (I_RELIGMP) and traditional in their value system
  • Low on acceptance of LGBTQ+ people (I_HOMOLIB)
  • More opposed to divorce, abortion and women working (I_DIVORLIB, I_APORTLIB, I_WOMJOB)
  • More likely to believe in a deity or supernatural forces (DISBELIEF)
  • More likely to vote for a conservative party (WVS_LibCon_PartyVoter)

Interestingly, these clusters correspond to some extent to different political parties. Especially in countries with two major parties, such as the US, these values and beliefs correspond quite well to the two major parties. There may be several reasons for this. The first is that this is an inherent feature of how people develop values, as these might be two stages in the development of values, and parties form around people's values. But there are also other possible reasons. Firstly, this survey was designed by people who may themselves be biased, because you only see what you measure and you only measure what you think is important. The political spectrums are well known and captured in the metrics. Indeed, sociological and psychological scales often fall between polar opposites such as 'left' and 'right' or 'liberal' and 'authoritarian'. In any case, what probably reinforces this observation is the fact that politics can be very polarising and can influence people's beliefs and values, not only because people influence people, but also because politics influences people's opinions.

NOTE: At this point it is important to note that although the data was collected from around the world, I chose to include characteristics that measure an individual's political orientation. This means that the pre-processed dataset only contains records of individuals who have voted in the past, which of course introduces a huge bias into the data, as many non-democratic countries as well as individuals who do not vote will not appear in this analysis. However, as one of the aims of this project is to improve political decision-making, I would argue that some degree of democratic structure is highly desirable for this to be effective.

Application with regards to the use case¶

Using the results to resolve political conflicts:. In order to resolve conflicts, it is important to understand the motives of the parties involved. Do they belong to different clusters? Or do they belong to the same cluster, but the content is different? An example of this is the current debate about abortion in the US. The reason for this conflict is a difference in values, and that's why it's so difficult to resolve. Therefore, individuals (especially those with extreme views) are likely to belong to different clusters. This means that arguing logically on the basis of facts probably won't help, because the cause is not about facts, but about a difference in values and beliefs. In this case, it might be more successful to argue for the values than to try to attack the line of reasoning logically. Presumably, both arguments can be logically sound based on the first assumption.

On the other hand, the current debate in Germany on military spending is an example of a more intra-cluster argument. Those who argue for an increase in military spending and those who argue against it have the same goal, which is peace. However, both sides have different ideas about how to achieve this in the current circumstances. Therefore, in this case, arguing on the basis of facts could be successful because there is a common ground.

In reality, and in the examples above, it is more complex than this, but any model is a simplification of reality and this might be a helpful distinction, because knowing the reasons for conflicts should change the approach to solving them. In any case, understanding the differences between people can help to bring them together.

In [32]:
results_pca = pd.DataFrame(X_pca, columns=[f"PC{i}" for i in range(len(X_pca[0]))])
results_pca["Cluster"] = labels_pca[2]

# pairplot for highest variance features
results["Cluster"] = labels_minmax[2]
sns.pairplot(results_pca, hue="Cluster")
Out[32]:
<seaborn.axisgrid.PairGrid at 0x3145dda50>
No description has been provided for this image

CONCLUSIONS¶


Achieved Results¶

This analysis showed that the distribution of people's values and beliefs does not follow a centred and clearly separable structure. The clusters still provide a valuable insight into the distribution of these values and beliefs and show that the average person in one cluster has very different values and beliefs from the average person in the other cluster. However, the boundaries between the clusters are smooth. There is no evidence in this analysis of clearly separable stages of value development.

Expectations vs. results¶

The data are not as clear as expected, meaning that the subgroups are not very clearly separable. In fact, the results suggest that the structure of the data is a continuous spectrum between the values rather than distinct and separate clusters.

Generated value¶

As described in the previous section, the generated value is that it provides insight into the nature of political conflict, giving individuals familiar with the structure the chance to choose the strategy wisely with which to resolve conflicts rather than exacerbate them. It is therefore necessary to understand whether the conflict is between clusters or within clusters. The key value of cluster analysis is that it can help the individual to understand the content of the clusters and therefore understand the nature of the conflict (between or within clusters).

Possible Course of Action¶

A possible course of action could be to go through all the current political debates and conflicts and analyse where the opposing individuals are. Do they belong to the same or different clusters according to the clusters described above? Based on this analysis, the argumentation strategy can be adapted.

Limitations¶

This analysis is very broad and does not look at a specific country, which makes it difficult to find an individual who can benefit from the results, as most conflicts take place within a country or between a few countries. It might therefore be more useful to repeat the clustering for a specific country.

The survey only covered a selected subset of values and questions, which means that it would have been useful to have additional questions on beliefs about climate change or sustainability, which are more relevant to policy making.

Furthermore, the analysis did not find a strong clustering structure, which means that other means of analysis may be more useful.

Discussion¶

Methodology¶

The analysis showed that k-means is not really suitable for clustering this data, either on the reduced data or on the unreduced data as it produced rather weak results. The question is whether there are other clustering and dimensionality reduction algorithms that would have been more suitable. As shown in the draft under "additional experiments", the optics with t-sne reduced data produced clearer results. It would also have been interesting to perform soft clustering, as the distribution might be quite ambiguous. And perhaps the subsets are better described by centres of gravity than by clear boundaries, and this might be better reflected by soft clustering.

The analysis used a relatively small number of principal components, which accounts for a relatively small amount of explained variance. This means that a lot of information is lost in the dimensionality reduction, which is not ideal as it may not all be noise. It might be useful to use other dimensionality reduction methods, such as T-SNE and UMAP, which might take better account of the presumed non-linear structure in the data. However, as the comparison showed, the actual cluster assignment was not much affected by further dimensionality reduction.

Original Goal of the Analysis¶

The pitch had two main objectives. The first was to gain insight into human psychology, which it did to some extent, but the insight is quite limited because there are too many limiting factors. For example, the data selection and dropping of rows with missing columns biases the final data as mentioned above. Furthermore, it is not clear whether the weak results are due to the choice of algorithms or to the lack of structure in the data, which makes it difficult to draw conclusions. However, the low silhouette scores of the K-means suggest that the data are not structured into clearly separable centroid clusters. However, it is difficult to translate this knowledge into psychological insights.

The second aim was guidance for political decision-making, which may have been a bit far-fetched, and given the results I would reformulate it as guidance for argumentation strategy. Part of democratic politics is arguing for one's proposed course of action. The basis of this argumentation is crucial to reach and convince the audience. Depending on the cluster structure of society, this strategy has a different starting point.

Future Work¶


  • Try T-SNP and UMAP because they are better at dealing with non-linear relationships in the data.
  • Try soft clustering as it may be better able to deal with the ambiguous and complex structure.
  • Create a subset containing only one country to deepen the analysis at a country-specific level.