Out now! A Global Dataset of COVID-19 Restrictions on Human Movement

I’m very happy to announce a new publication describing a new, global dataset of COVID-19 restrictions on human movement. In the research note, we introduce the Citizenship, Migration and Mobility in a Pandemic (CMMP): A dataset which features systematic information on border closures and domestic lockdowns in response to the Covid-19 outbreak in 211 countries and territories worldwide. We document the evolution of the types and scope of international travel bans and exceptions to them, as well as internal measures including limitations of non-essential movement and curfews in 27 countries.

Now it’s your turn! Can we explain variation in restriction on human movement? Did these restrictions affect the pandemic?

Piccoli, Lorenzo, Jelena Dzankic, and Didier Ruedin. 2021. ‘Citizenship, Migration and Mobility in a Pandemic (CMMP): A Global Dataset of COVID-19 Restrictions on Human Movement’. PLoS ONE. 16(3): e0248066.  Open Access

Mac *.txt.rtfd to *.txt

In a recent project, an assistant used TextEdit to supposedly save documents as pure (UTF-8) text files. We managed to fix the workflow, but I was left with a bunch of Zip files full of *.rtf from TextEdit. On a Windows or GNU/Linux machine, these files show up as what they are: folders that contain a rich text document (and potentially other stuff). I needed text documents.

After a bit of searching and tweaking, I got the following shell script to convert all the rich text documents in these folders/containers into text documents:

find . -name '*.rtf' -exec unoconv -f txt {} \;

There was a problem, though. The files all had a name containing important meta data. So I had the folder with the name of the file, and inside this folder the file but it was called TXT.txt (converted from TXT.rtf). I’m sure there’s a quick way in a shell script (if you know one, please share it in the comments), but I got stuck with the shell.

Enter LiveCode. Here’s a script that does just that. I guess I could have called the above shell script, but I already had this.

on mouseup
-- INPUT: select a folder with the *.txt.rtfd folders
answer folder "Input: Choose folder:"
put it into infoldername
set the defaultFolder to infoldername
put the folders into listoffolders
-- filter . and .. can cause problems
filter listoffolders without "."
filter listoffolders without ".."
-- OUTPUT: select a destination folder
answer folder "Output: Choose folder:"
put it into outfoldername
repeat with i = 1 to the number of lines of listoffolders
put line i of listoffolders into currentfolder
revCopyFile infoldername & slash & currentfolder &
slash & "TXT.txt", outfoldername & slash & textname
end repeat
end mouseup

Full LiveCode stack here on OSF (it’s nothing more than a button and a text field with a basic log).

“Why Don’t Immigrants Vote More?” — Participation in Local Elections Published

paMy paper on the electoral participation of immigrants in local elections is now available online (Parliamentary Affairs). As part of this research, I spoke to a politician who exclaimed: ‘Why don’t they [immigrants] vote now that we have given them the opportunity?’. It’s the expectation that all ‘we’ have to do is enfranchise immigrants, and they’ll flock to the ballot boxes. But, they don’t.

In the paper I present a new representative survey of participation in the 2015 municipal elections in the Canton of Geneva. The cleaned data (and replication material) are available at IQSS Dataverse; the raw data at FORS.

In Geneva, foreign citizens who have lived in Switzerland for at least 8 years have the right to vote in local elections. In 2015, the chancellor wrote a personal letter to each of them to invite them to vote, yet most immigrant groups vote less than the majority population. In the paper I test four common explanations for this difference in electoral turnout: social origin (resources), political engagement, civic integration and networks, as well as socialisation. Individually, all these explanations are associated with differences in electoral participation, but contrary to some recent studies, substantive differences between nationalities remain in the local elections in Geneva.

Overcoming Warnings when Importing SPSS Files to R

R can import SPSS files quite easily, using the package foreign and the read.spss command. It usually works quite well out of the box, so well that I usually choose the SPSS file when downloading secondary data (hint: look at the argument use.value.labels depending on how you want your data).

Sometimes R isn’t so happy, throwing warnings like “Unrecognized record type 7, subtype 18 encountered in system file”. Generally warnings in R are there for a reason. Usually these seem to be variable and data attributes in SPSS, but to be sure, simply convert the SPSS file into SPSS Portable (*.por rather than *.sav). Don’t have SPSS? Enter PSPP , a free (open source) program that can help you out! (for Windows, check directly on this site).

pspp-saveas-por PSPP can open SPSS files faster than SPSS, and under File > Save as... there’s the option to save as a Portable file (rather than the default System File) at the bottom left of the dialog. If you import this (portable) SPSS file to R, there should be no errors or warnings.

Need Data from the SOM Project? You Can!

From time to time I get asked when the data from the SOM Project on the politicization of immigration will be available. It’s already there!

The principal data have been available from the project Dataverse for a while now. Many more details and coding instructions are available from the Data section of the project website.

To catch up on the main findings of the SOM project, get a copy of The Politicisation of Migration (Routledge, 2015). Other publications are listed on the project website.