
The Brexit votes example
In June 2016, a referendum was held in the United Kingdom (UK) to decide whether or not to remain part of the European Union (EU). 72% of registered voters took part, and of those, 51.2% voted to leave the EU. In February 2017, Martin Rosenbaum, freedom of information specialist at BBC News, published the article, Local Voting Figures Shed New Light on EU Referendum (http://www.bbc.co.uk/news/uk-politics-38762034). He obtained data from 1,070 electoral wards (the smallest administrative pision for electoral purposes in the UK), with numbers for Leave and Remain votes in each ward.
Martin Rosenbaum calculated some statistical associations between the proportion of Leave votes in a ward and some of its social, economic, and demographic characteristics by making use of the most recent UK census, which was conducted in 2011. He used his data for a university class, and that's the data we will use in this example, with some variables removed. The data is provided in a CSV file (data_brexit_referendum.csv) which can be found in the accompanying code repository for this book (https://github.com/PacktPublishing/R-Programming-By-Example). The table shows the variables included in the data:
Data variable descriptions