{'fraction_non_alphanumeric': 0.01060070671378092, 'fraction_numerical': 0.0, 'mean_word_length': 4.902777777777778, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Bayesian cluster analysis of election results

A Bayesian cluster analysis for the results of an election based on multinomial mixture models is proposed. The number of clusters is chosen based on the careful comparison of the results with predictive simulations from the models, and by checking whether models capture most of the spatial dependence in the results. By implementing the analysis on five recent elections in Barcelona, the reader is walked through the choice of the best statistics and graphical displays to help chose a model and present the results. Even though the models do not use any information about the location of the areas in which the results are broken into, in the example they uncover a four-cluster structure with a strong spatial dependence, that is very stable over time and relates to the demographic composition.