<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="http://www.r-bloggers.com/which-countries-have-regrexit/"></div></div><div><a data-url="http://www.r-bloggers.com/which-countries-have-regrexit/" data-counturl="http://www.r-bloggers.com/which-countries-have-regrexit/" data-count="horizontal" data-text="Which countries have Regrexit?" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://realizationsinbiostatistics.blogspot.com/2016/06/which-countries-have-regrexit.html"> Realizations in Biostatistics</a></strong>, and kindly contributed to <a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>This doesn’t have a lot to do with bio part of biostatistics, but is an interesting data analysis that I just started. In the wake of the Brexit vote, there is a <a target="_blank" href="https://petition.parliament.uk/petitions/131215">petition for a redo</a>. The data for the petition is <a target="_blank" href="https://petition.parliament.uk/petitions/131215.json">here</a>, in JSON format.</p>
<p>Fortunately, in R, working with JSON data is pretty easy. You can easily download the data from the link and put it into a data frame. I start on that <a target="_blank" href="https://github.com/randomjohn/regrexit">here</a>, with the RJSONIO package, ggplot2, and a version of the petition I downloaded on 6/26/16.</p>
<p>One question I had was whether all the signers are British. Fortunately, the petition collects the place of residence of the signer, assuming no fraud. I came up with the following top 9 non-UK countries of origin of signers.</p>
<div><a target="_blank" href="http://i1.wp.com/3.bp.blogspot.com/-b9PfHCEMZ2E/V3AcPujrkyI/AAAAAAAAbbY/EA9WSJlq_zYr-8fpD1l230Jp7WP2dlTmgCLcB/s1600/regrexit.png?ssl=1"><img src="http://i1.wp.com/3.bp.blogspot.com/-b9PfHCEMZ2E/V3AcPujrkyI/AAAAAAAAbbY/EA9WSJlq_zYr-8fpD1l230Jp7WP2dlTmgCLcB/s320/regrexit.png?resize=320%2C195&ssl=1" border="0" data-recalc-dims="1"></a></div>
<div>There are a couple of things to remember when interpreting this graph:</div>
<div></div>
<ol>
<li>I left off the UK. The number of signatures is over 3 million, and contains by far the largest percentage of signatories.</li>
<li>5 of the 9 top countries are neighbors, including the top 2. The other 4 are Australia, the US, Canada, and New Zealand, who are all countries that have strong ties to the UK.</li>
<li>This assumes no petition fraud, which I can’t guarantee. I saw at least one Twitter posting telling people to use her (if the profile pic is to be believed) residence code. There is a section of the petition data showing constituency, so I’m wondering if it would be possible to analyze the petition for fraud. I’m not as familiar with British census data as I am with US, but I imagine a mashup of the two would be useful.</li>
</ol>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="http://www.r-bloggers.com/which-countries-have-regrexit/"></div></div><div><a data-url="http://www.r-bloggers.com/which-countries-have-regrexit/" data-counturl="http://www.r-bloggers.com/which-countries-have-regrexit/" data-count="vertical" data-text="Which countries have Regrexit?" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://realizationsinbiostatistics.blogspot.com/2016/06/which-countries-have-regrexit.html"> Realizations in Biostatistics</a></strong>.</div>
<hr>
<a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="http://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="http://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="http://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="http://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/cEcdDLJVdUg"></a></div>