<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/estimating-the-size-of-a-demonstration/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://staff.math.su.se/hoehle/blog/2017/05/04/crowdsize.html"> Theory meets practice...</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h2>Abstract</h2>
<p>Inspired by the recent <strong>March For Science</strong> we look into methods for the statistical estimation of the number of people participating in a demonstration organized as a march. In particular, we provide R code to reproduce the <strong>two on-the-spot counting method</strong> analysis of <span data-cites="yip_etal2010">Yip et al. (2010)</span> for the data of the July 1 March in Hong Kong 2006.</p>
<p><center><br>
<img src="https://i2.wp.com/upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Hong_Kong_July_1_Marches.jpg/640px-Hong_Kong_July_1_Marches.jpg?w=456&ssl=1" data-recalc-dims="1"><br>
</center></p>
<p> <a target="_blank" rel="nofollow" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" src="https://i1.wp.com/i.creativecommons.org/l/by-sa/4.0/88x31.png?w=456&ssl=1" data-recalc-dims="1"></a> This work is licensed under a <a target="_blank" rel="nofollow" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>. The markdown+Rknitr source code of this blog is available under a <a target="_blank" rel="nofollow" href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License (GPL v3)</a> license from <a target="_blank" rel="nofollow" href="https://github.com/hoehleatsu/hoehleatsu.github.io"><img alt="github" src="https://i2.wp.com/staff.math.su.se/hoehle/blog/images/GitHub-Mark-32px.png?w=456" data-recalc-dims="1"></a>.</p>
<h2>Introduction</h2>
<p>Exercising your democratic right to express support for a cause by demonstration has found anew usage. The <a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/March_for_Science">March for Science</a> is a recent examples of such a demonstration inspired by recent political developments. The number of persons participating in such marches is <em>the</em> indicator by which the support of the cause is measured. Crowd size estimates have therefore always been subject to political interpretation and, hence, possible politically motivated bias. In this work we focus on what statistics has to offer with respect to finding the <strong>true number</strong> of participants. A good overview of this task’s challenges is given in <span data-cites="watson_yip2011">Watson and Yip (2011)</span>. A particular difficulty is the size estimation of moving crowds as seen in marches.</p>
<p>As case study we replicate the analysis of <span data-cites="yip_etal2010">Yip et al. (2010)</span> on estimating the number of participants in the <a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Hong_Kong_1_July_marches#2006">1st of July Marches</a> in Hong Kong. Since the handover to China in 1997 these marches have been conducted yearly to demonstrate for democracy and freedom of speech in Hong Kong. Below is shown the 3.6 km long demonstration route from <a target="_blank" rel="nofollow" href="https://de.wikipedia.org/wiki/Victoria_Park_(Hongkong)">Victoria Park</a> to Government Headquarters for the 2006 demonstration as described by <span data-cites="yip_etal2010">Yip et al. (2010)</span>. A <a target="_blank" rel="nofollow" href="https://www.youtube.com/watch?v=8WQ2TAEquxM">youtube video</a> of the 2006 demonstration illustrates this better than words.</p>
<p><center><br>
<img alt="Route of the 1st of July 2006 demonstration in Hong Kong. The two points A and B indicate the location of the two counting points. Courtesy goes to Open Street Map." src="https://i0.wp.com/staff.math.su.se/hoehle/blog/figure/source/2017-05-04-crowdsize/Route.png?w=456" data-recalc-dims="1"><br>
</center><br>
Map Source: <a target="_blank" rel="nofollow" href="http://www.openstreetmap.org/#map=10/22.3810/114.1370">Open Street Map</a></p>
<p><p>In order to estimate the number of participants a <strong>two on-the-spot counting method</strong> was devised by <span data-cites="yip_etal2010">Yip et al. (2010)</span>: Two points along the march were selected as shown in the above map: Point A denotes the location after which an individual is counted as being part of the march. In order to take into account that people join the march at a later point than A, a second point B is selected to adjust the count at A for such late entries. Three to four persons were stationed at each of the two counting locations. Once the demonstration passed the respective point each of them started to count the number of people passing in a one-minute intervals. They counted for one minute every 5 minutes until the last person of the march had passed the counting point.</p>
<h3>Loading the Data</h3>
<p>We store the resulting counting data displayed in Table 2 and Table 3 of <span data-cites="yip_etal2010">Yip et al. (2010)</span> as two Excel-files. In a data pre-processing step these are then read and combined into one data.frame containing the columns <code>Y1</code>–<code>Y4</code>. Furthermore, we re-format the table’s time specification to proper POSIX formatted date-times. The exact data dancing steps can be found in the accompanying <a target="_blank" rel="nofollow" href="https://github.com/hoehleatsu/hoehleatsu.github.io/blob/master/_source/2017-05-04-crowdsize.Rmd">Rmd code of this post</a>. Altogether, this yields a <code>tbl</code> with the first couple of lines looking as follows:</p>
<pre><code>## # A tibble: 6 × 7
##      Y1    Y2    Y3    Y4     Mean Point          Time_POSIX
##   </code></pre>