## How to sync your Zotero library (and files) with WebDAV

In this post, I explain how to use an online file storing and sharing service like AARNet’s CloudStor (but any WebDAV service will do) to access and update your Zotero library from different computers.

Sunday, 10 March 2019

## recogeo: A new R package to reconcile changing geographic boundaries (and corresponding variables)

Demographics information is usually reported in relation to precise boundaries: administrative, electoral, statistical, etc. Comparing demographics information reported at different point in time is often problematic because boundaries keep changing. The recogeo package faciliates reconciling boundaries and their data by a spatial analysis of the boundaries of two different periods. In this post, I explain how to install the package, reconcile two spatial objects and check the results.

Friday, 1 February 2019

## Are you parallelizing your raster operations? You should!

If you plan to do anything with the raster package you should definitely consider parallelize all your processes, especially if you are working with very large image files. I couldn’t find any blog post describing how to parallelize with the raster package (it is well documented in the package documentation, though). So here my notes.
(more…)

Thursday, 17 January 2019

## How to (quickly) enrich a map with natural and anthropic details

In this post I show how to enrich a ggplot map with data obtained from the Open Street Map (OSM) API. After adding elevation details to the map, I add water bodies and elements identifying human activity. To highlight the areas more densely inhabitated, I propose to use a density-based clustering algorithm of OSM features.

Thursday, 9 August 2018

## The two alternatives to the monasterisation of the World wide web

Saint Michael’s Abbey, in the Susa Valley, Piedmont. Source: Wikipedia.

In Medieval Europe, information was physically concentrated in very few secluded libraries and archives. Powerful institutions managed them and regulated who could access what. The library of the fictional abbey that is described in Umberto Eco’s The Name of the Rose is located in a fortified tower and only the librarian knows how to navigate its mysteries. Monasteries played an essential role in preserving written information and creating new intelligence from that knowledge. But being written information a scarce resource, with the keys to libraries came also authority and power. Similarly, Internet companies are amassing information within their fortified walls. In so doing, they provide services that we now see as essential but they also contravene the two core principles of the Internet: openness and decentralisation.

Monday, 7 May 2018

## Local participation and not unemployment explains the M5S result in the South

The abundance of economic data and the scarcity of social data with a comparable level of granularity is a problem for the quantitative analysis of social phenomena. I argue that this fundamental problem has misguided the analysis of the electoral results of the Five Star Movement (M5S) and its interpretation. In this article, I provide statistical evidence suggesting that — in the South — unemployment is not associated with the exceptional increase in the M5S support and that local participation is a stronger predictor of support than most of the demographics.

## What happened

The 2018 Italian general elections (elections, since both the Chamber of Deputies and the Senate, were renewed) saw

1. a significant increase in the number of votes for two parties, the Five Start Movement (M5S) and the League (formerly Northern League),

and

1. an increase in the importance geography as an explanatory dimension for the distribution of votes.

The following two maps show where the M5S and the League have increased electoral support from 2013 to 2018. (Electoral data are always data for the election of the Chamber of Deputies).

Vote difference: 2018-2013 (a few communes have not reported all the results, notably Rome)

The geographic pattern is quite simple. The M5S has increased its support in the South and maintained its votes in the North, the League has significantly strengthened its support in the North but has also collected votes in the South, where it had virtually no support. The third and the fourth most voted parties, the Democratic Party (PD) and Berlusconi’s Forza Italia (FI), have lost votes almost everywhere. If we map the results of the four parties side-by-side with the same scale, the PD and FI almost faded into the background.

Votes in the 2018 General elections

Yet, major metropolitan areas do not always follow the national trend. If Naples unambiguously voted M5S, Turin, Milan and Rome did saw the Democratic Party as the most voted party in the wealthiest districts.

Votes in the 2018 General elections (Clock-wise from top-left: Turin, Milan, Naples, Rome)

The density of the distribution of results at the commune and sub-commune level in the macro regions indicates that if the M5S electorally dominates in the South and in the two major islands, the League is the most popular party in the North.

Distribution of votes at commune or sub-commune level

The territoriality of the results, especially along the North-South dimension, makes the analysis especially complicated. This because the strong result of the League in the North and of the M5S in the South might simplistically suggest that immigration (which is much stronger in the North) explains the League’s result in the North and unemployment and poverty (stronger in the South) explain the M5S’s result in the South. This reading is especially attractive since immigration and the M5S proposal to introduce a guaranteed minim income have dominated the campaign.

Tuesday, 20 March 2018

## 2018 Italian general election: Details on my simulation

This article describes the simulation behind the app that you find here

This simulation of the results for the 2018 general election is based on the results from the last two national elections (the Italian parliament election in 2013 and the European Parliament election 2014) and national polls conducted until 16 February 2018. The simulation is based on one assumption, which is reasonable but not necessarily realistic: the relative territorial strength of parties is stable. From this assumption derives that if the national support for a party (as measured by national voting intention polls) varies, it varies consistently and proportionally everywhere. A rising tide lifts all boats and vice versa. The assumption has some empirical justification. If we compare the difference from the national support (in percentage) for each district in 2013 and 2014 we see a significant correlation, especially in the major parties.

Votes to party in the 2018 Chamber districts

Tuesday, 27 February 2018

## Quick analysis of the Italian referendum results

The 2016 Italian referendum torpedoed the constitutional reform presented by the government presided by Matteo Renzi (41). According to the final count, which includes 1.2 million votes cast overseas, the reform was rejected by almost 60% of the voters.

Three parties played a predominant role during the electoral campaign: the ruling Democraric Party (PD), leaded by the chief of government Renzi, the Five Star Movement (M5S), founded and leaded by Beppe Grillo (68), and the Lega Nord (LN), leaded by Matteo Salvini (43). The fourth Italian party, Forza Italia, for different reasons – including the health of Silvio Berlusconi (80) – played a minor role.

Monday, 5 December 2016

## Cosa possiamo imparare dal M5S

Leggo e rispondo al post di Massimo Mantellini (Il M5S, il wifi e il principio di precauzione) in cui si evidenzia con preoccupazione come il Movimento abbia portato in Parlamento, dunque in qualche modo legittimandole, posizioni anti-scientifiche; un “pensiero tossico, banale e a suo modo inattaccabile, che nuoce al Paese intero”.

Il Movimento Cinque Stelle con un bacino elettorale che si aggira tra il 25 e il 30% (8.5-10 milioni di persone) è necessariamente complesso in termini di rappresentanza demografica e di diversità di opinione. Considerando un astensionismo del 25%, se vi trovate in fila al supermercato delle 10 persone che vi precedono circa due votano M5S. Purtroppo questa complessità raramente traspare nelle narrazioni giornalistiche, e chi fa informazione tende (troppo) spesso a preferire i tratti caricaturali (da cappello di carta stagnola o da gita in Corea del Nord, per intenderci). Ma questo tipo di informazione è sbagliata: primo perché distorce nella semplificazione, secondo perché incoraggia comportamenti macchiettistici, grotteschi e sbracati da parte di chi sedendo in istituzioni affollate cerca visibilità.

Friday, 22 July 2016

## Road to Rome: The organisational and political success of the M5S

The Five Star Movement (M5S) obtained two major victories in the second round of municipal elections on 19 June 2016 in Rome and Turin. Rome attracted the most international attention but it is M5S’ victory in Turin that is likely the most consequential for them and other European anti-establishment parties.

In Rome, a municipality with 2.8 million people and an annual budget of €5 billon, Virginia Raggi (age 37) gained doubled the votes of her contender Roberto Giachetti (age 55). In Turin, a city with a population of 900,000 and an annual budget of €1.69 billion, Chiara Appendino (age 31) outstripped Piero Fassino (age 66) by about 10 percentage points.

Continue reading on Pop Politics Aus

Friday, 8 July 2016

### blogroll

#### r-bloggers.com

• Data Science Job in 90 days – Book Review
Are you an R-programmer or Datascience enthusiast looking for a break in the datascience field? If so, my latest book “Data Science Jobs – land a lucrative job in 90 days” will help you find one quickly. [Author’s note – The ebook is FREE ONLY until midnight this Sunday (May 26th). So hurry and grab […]
• R Companion to Linear Algebra Step by Step, part 1
Linear Algebra: Step by Step, by Kuldeep Singh, is a tremendous resource for improving your skills in the fundamental mathematics behind machine learning. I’m authoring an R companion series to ensure that this can be translated to make sense to R programmers, and reduce the legwork for translating core principles back and forth. This series […]
• How to interactively examine any R code – 4 ways to not just read the code, but delve into it step-by-step
Introduction As pointed out by a recent read the R source post on the R hub’s website, reading the actual code, not just the documentation is a great way to learn more about programming and implementation details. But there is one more activity to get even more hands-on experience and understanding of the code in […]
• How do we combine errors, in biology? The delta method
In a recent post I have shown that we can build linear combinations of model parameters (see here ). For example, if we have two parameter estimates, say Q and W, with standard errors respectively equal to $$\sigma_Q$$ and $$\sigma_W$$, we can build a linear combination as follows: $Z = AQ + BW + C$ […]
• Create Animation in R : Learn by Examples
This tutorial covers various ways you can create animated charts or plots using R. Animation is a very important element of data visualization. Animated charts are visually appealing and it fetches attention of audience. There are many online data visualization tools available in market which can generate animated charts but most of them are paid […]

#### Simply Statistics

• I co-founded a company! Meet Problem Forward Data Science
I have some exciting news about something I’ve been working on for the last year or so. I started a company! It’s called Problem Forward data science. I’m pumped about this new startup for a lot of reasons. My co-founder is one of my families closest friends, Jamie McGovern, who has more than 2 decades […]
• Generative and Analytical Models for Data Analysis
Describing how a data analysis is created is a topic of keen interest to me and there are a few different ways to think about it. Two different ways of thinking about data analysis are what I call the “generative” approach and the “analytical” approach. Another, more informal, way that I like to think about […]
• Tukey, Design Thinking, and Better Questions
Roughly once a year, I read John Tukey’s paper “The Future of Data Analysis”, originally published in 1962 in the Annals of Mathematical Statistics. I’ve been doing this for the past 17 years, each time hoping to really understand what it was he was talking about. Thankfully, each time I read it I seem to […]

#### Statistical Modeling, Causal Inference, and Social Science

• Crystallography Corner: The result is difficult to reproduce, but the result is still valid.
Joel Bernstein writes: I just finished reading your oped article on reproducibility in science. As an experimental scientist – more precisely a chemical crystallographer – I have had to deal with this kind of situation a number of times, and at least two examples may serve as the possible exceptions to your rules. One of […]
• Donald J. Trump and Robert E. Lee
The other day the president made some news by praising Civil War general Robert E. Lee, and it struck me that Trump and Lee had a certain amount in common. Not in their personalities, but in their situations. Lee could’ve fought on the Union side in the Civil War. Or he could’ve saved a couple […]
• Against Arianism 3: Consider the cognitive models of the field
“You took my sadness out of context at the Mariners Apartment Complex” – Lana Del Rey It’s sunny, I’m in England, and I’m having a very tasty beer, and Lauren, Andrew, and I just finished a paper called The experiment is just as important as the likelihood in understanding the prior: A cautionary note on robust […]