<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Diego Valle-Jones's Blog</title><link href="https://blog.diegovalle.net/" rel="alternate"></link><link href="https://blog.diegovalle.net/feeds/blogger.atom.xml" rel="self"></link><id>https://blog.diegovalle.net/</id><updated>2015-03-26T00:00:00+01:00</updated><entry><title>Municipios with missing persons anomalies</title><link href="https://blog.diegovalle.net/2015/03/municipios-with-missing-persons.html" rel="alternate"></link><updated>2015-03-26T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2015-03-26:2015/03/municipios-with-missing-persons.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-WSrm4l94k3E_VRQanTnSNfI_AAAAAAAAJIU_0xKru0c_ofc_s1600_map.png" imageanchor="1" &gt;&lt;img border="0" height="258" src="/images/blogger_images/2.bp.blogspot.com_-WSrm4l94k3E_VRQanTnSNfI_AAAAAAAAJIU_0xKru0c_ofc_s1600_map.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
The &lt;i&gt;Secretaría de Gobernación&lt;/i&gt; just updated the missing persons database (&lt;a href="https://rnped.segob.gob.mx/"&gt;&lt;span class="caps"&gt;RNPED&lt;/span&gt;&lt;/a&gt;) to include data up to January 2015. The database now contains information on 25,293 missing persons from the *fuero común* (local government) and 443 from the *fuero federal* (federal government).&lt;br/&gt;
&lt;a name="more"&gt;&lt;/a&gt;&lt;br/&gt;
To make it easier to understand the data and make it actionable, I plotted all the municipios containing outliers during the period from August 2014 (just before the mass kidnapping in Ayotzinapa) to January 2015 (the last date available). The chart includes data from both the fuero federal and común.&lt;br/&gt;
&lt;br/&gt;
I used the &lt;a href="https://github.com/twitter/AnomalyDetection"&gt;AnomalyDetection&lt;/a&gt; R package to detect the anomalies.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-yKB1MYCcrIQ_VRN3g1cD29I_AAAAAAAAJIA_7EMwZPrbD7k_s1600_sm.png" imageanchor="1" &gt;&lt;img border="0" height="263" src="/images/blogger_images/2.bp.blogspot.com_-yKB1MYCcrIQ_VRN3g1cD29I_AAAAAAAAJIA_7EMwZPrbD7k_s1600_sm.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
Not surprisingly, Iguala, which saw the disappearance of 43 students on September 26, 2014 appears first on the list. The Mexican government should pay particular attention to these &lt;i&gt;municipios&lt;/i&gt; if it wants to solve the missing persons problem in Mexico.&lt;br/&gt;
&lt;br/&gt;
This is a cartogram of the rates of disappearances at the state level. Obviously, some states like Guerrero and Nayarit (zero disappearances in 2014) under report disappearances.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-PDHFngmq6Ys_VRNyI0oFiVI_AAAAAAAAJHo_ZPkwbjoXWXI_s1600_cartogram.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/1.bp.blogspot.com_-PDHFngmq6Ys_VRNyI0oFiVI_AAAAAAAAJHo_ZPkwbjoXWXI_s1600_cartogram.png" width="330"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; Code is available &lt;a href="https://github.com/diegovalle/rnped"&gt;here&lt;/a&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="drug-war"></category></entry><entry><title>The most partisan first names</title><link href="https://blog.diegovalle.net/2015/02/the-most-partisan-first-names.html" rel="alternate"></link><updated>2015-02-09T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2015-02-09:2015/02/the-most-partisan-first-names.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-MTAL3sWStDs_VNqwgWrIUWI_AAAAAAAAI7U_BK05TWfxwSI_s1600_prd_names.svg.png" imageanchor="1" &gt;&lt;img border="0" height="640" src="/images/blogger_images/1.bp.blogspot.com_-MTAL3sWStDs_VNqwgWrIUWI_AAAAAAAAI7U_BK05TWfxwSI_s1600_prd_names.svg.png" width="496"/&gt;&lt;/a&gt;&lt;/div&gt;
I downloaded data from the &lt;a href="http://www.ine.mx/archivos3/portal/historico/contenido/I_El_padron_afiliados_militantes_partidos_politicos_nacionales/"&gt;Instituto Nacional Electoral&lt;/a&gt; to find out which names are the most overrepresented among the three main political parties in Mexico (&lt;span class="caps"&gt;PRI&lt;/span&gt;, &lt;span class="caps"&gt;PAN&lt;/span&gt;, and &lt;span class="caps"&gt;PRD&lt;/span&gt;). As was to be expected &lt;span style="background-color: white; color: #545454; font-family: arial, sans-serif; font-size: x-small; line-height: 18.2000007629395px;"&gt;—&lt;/span&gt;names are markers of class, income, religion, and geographical regions&lt;span style="background-color: white; color: #545454; font-family: arial, sans-serif; font-size: x-small; line-height: 18.2000007629395px;"&gt;—&lt;/span&gt; there are some major differences in which names the members of each political party bear.&lt;br/&gt;
&lt;a name="more"&gt;&lt;/a&gt;&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-xIr7_lAqQck_VNf9p2Nk3gI_AAAAAAAAI6k_eWUVEGEsefc_s1600_parties.svg.png" imageanchor="1" &gt;&lt;img border="0" height="290" src="/images/blogger_images/1.bp.blogspot.com_-xIr7_lAqQck_VNf9p2Nk3gI_AAAAAAAAI6k_eWUVEGEsefc_s1600_parties.svg.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
The parties differ not only in their politics, but also in their internal structures and regions where they have support. The right wing &lt;span class="caps"&gt;PAN&lt;/span&gt; likes to keep its enrollment small and has 220,568 members or 3% of the total membership of the three major parties, the left wing &lt;span class="caps"&gt;PRD&lt;/span&gt; has 2,590,972 members or 33% of the total, and the &lt;span class="caps"&gt;PRI&lt;/span&gt; has 5,044,528 members or 64% of the total. And obviously, the political support of the parties varies by region, with &lt;a href="https://www.diegovalle.net/maps/mordor/mordor.html"&gt;not that much overlap&lt;/a&gt; between the &lt;span class="caps"&gt;PAN&lt;/span&gt; and &lt;span class="caps"&gt;PRD&lt;/span&gt;.&lt;br/&gt;
&lt;br/&gt;
In the following charts I&amp;#8217;m showing first names with at least a total count (for all parties) of a hundred and a party memebership of at least 30 (for the party displayed in the chart).&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-n5PRKxFODQk_VNqxQNCL6-I_AAAAAAAAI7c_0JnNo1VnJhw_s1600_pan_names.svg.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/4.bp.blogspot.com_-n5PRKxFODQk_VNqxQNCL6-I_AAAAAAAAI7c_0JnNo1VnJhw_s1600_pan_names.svg.png" width="310"/&gt;&lt;/a&gt;&lt;/div&gt;
Notice how having more than one name is popular among members of the &lt;span class="caps"&gt;PAN&lt;/span&gt;, also that very few female names are overrepresented. The data you can download from the &lt;span class="caps"&gt;INE&lt;/span&gt; doesn&amp;#8217;t include sex, but using an older dataset the membership of the &lt;span class="caps"&gt;PAN&lt;/span&gt; was 52% female a couple of years ago.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-ood5psTdJn8_VNqxYjitKYI_AAAAAAAAI7k_uCXklmbVtJ4_s1600_prd_names.svg.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/4.bp.blogspot.com_-ood5psTdJn8_VNqxYjitKYI_AAAAAAAAI7k_uCXklmbVtJ4_s1600_prd_names.svg.png" width="310"/&gt;&lt;/a&gt;&lt;/div&gt;
Note all the alternate spellings of Anayeli, Isabel, etc and how, unlike the &lt;span class="caps"&gt;PAN&lt;/span&gt;, people with two names are rare among the popular names.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-jEo2FA437og_VNqxe88MNfI_AAAAAAAAI7s_OZvXTPxgC8g_s1600_pri_names.svg.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/4.bp.blogspot.com_-jEo2FA437og_VNqxe88MNfI_AAAAAAAAI7s_OZvXTPxgC8g_s1600_pri_names.svg.png" width="310"/&gt;&lt;/a&gt;&lt;/div&gt;
I&amp;#8217;ll just use this picture of the Guerrero Chimalli to illustrate the &lt;span class="caps"&gt;PRI&lt;/span&gt;:&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-1jP23F_hmLU_VNgWVn5N6KI_AAAAAAAAI7E_zic5jBJDwkM_s1600_Guerrero_chimalli.jpg" imageanchor="1" &gt;&lt;img border="0" height="216" src="/images/blogger_images/4.bp.blogspot.com_-1jP23F_hmLU_VNgWVn5N6KI_AAAAAAAAI7E_zic5jBJDwkM_s1600_Guerrero_chimalli.jpg" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
In the previous charts I used the full first name as a single name (Luis Miguel is different from Miguel Luis) but we can also analyse the names as single entities:&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-sLuWzvN6NR8_VNqxlNyG2sI_AAAAAAAAI70_GrhLhx8V_so_s1600_pan_names_single.svg.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/2.bp.blogspot.com_-sLuWzvN6NR8_VNqxlNyG2sI_AAAAAAAAI70_GrhLhx8V_so_s1600_pan_names_single.svg.png" width="310"/&gt;&lt;/a&gt;&lt;/div&gt;
Female names are more common among PANistas when analyzing each name as a separate entity&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-gYJWwOEoaFs_VNqxqvMd4TI_AAAAAAAAI78_YVftNCKlAdo_s1600_prd_names_single.svg.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/4.bp.blogspot.com_-gYJWwOEoaFs_VNqxqvMd4TI_AAAAAAAAI78_YVftNCKlAdo_s1600_prd_names_single.svg.png" width="310"/&gt;&lt;/a&gt;&lt;/div&gt;
Again notice all the alternate spellings (Brayan/Bryan, Jocelyn/Jocelin, etc)&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-2d17BOufJpo_VNqxvy3tiWI_AAAAAAAAI8E_3XWmIifd428_s1600_pri_names_single.svg.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/2.bp.blogspot.com_-2d17BOufJpo_VNqxvy3tiWI_AAAAAAAAI8E_3XWmIifd428_s1600_pri_names_single.svg.png" width="310"/&gt;&lt;/a&gt;&lt;/div&gt;
I also created a &lt;a href="https://en.wikipedia.org/wiki/Ternary_plot#Reading_values_on_the_ternary_plot"&gt;ternary plot&lt;/a&gt; so you can view how common the names are in each political party at the same time (remember the &lt;span class="caps"&gt;PAN&lt;/span&gt; has a very small membership)&lt;br/&gt;
&lt;div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-NVkXH8ar-oM_VNfx2fTc1JI_AAAAAAAAI5w_MDOLdz3O5vA_s1600_triforce.svg.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/2.bp.blogspot.com_-NVkXH8ar-oM_VNfx2fTc1JI_AAAAAAAAI5w_MDOLdz3O5vA_s1600_triforce.svg.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
I was curious about all the alternate spellings of Anayeli, though in the table below I&amp;#8217;m only showing the most common ones &lt;span style="background-color: white; color: #545454; font-family: arial, sans-serif; font-size: x-small; line-height: 18.2000007629395px;"&gt;—&lt;/span&gt;there literally are dozens and dozens of variations&lt;span style="background-color: white; color: #545454; font-family: arial, sans-serif; font-size: x-small; line-height: 18.2000007629395px;"&gt;—&lt;/span&gt; and, well, &lt;span class="caps"&gt;PAN&lt;/span&gt; members just don&amp;#8217;t like that name.&lt;br/&gt;
&lt;br/&gt;
&lt;table style="border-collapse: collapse; border-spacing: 0px; color: black; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; max-width: 100%; vertical-align: middle;"&gt;&lt;thead&gt;
&lt;tr&gt;&lt;th align="left" style="background-color: #dddddd; border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;Name&lt;/th&gt;&lt;th align="right" style="background-color: #dddddd; border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;Count for All Parties&lt;/th&gt;&lt;th align="left" style="background-color: #dddddd; border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;Party&lt;/th&gt;&lt;th align="right" style="background-color: #dddddd; border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;Count for Party&lt;/th&gt;&lt;th align="right" style="background-color: #dddddd; border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;Expected Percentage&lt;/th&gt;&lt;th align="right" style="background-color: #dddddd; border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;Percent Named Belonging to Party&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NAYELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;1730&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PAN&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;39&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.03&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.02&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ANALLELY&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;387&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;278&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.72&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ANAYELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;1449&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;1015&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.70&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ANALLELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;110&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;74&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.67&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ANA&lt;/span&gt; &lt;span class="caps"&gt;YELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;138&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;92&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.67&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NAYELLI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;134&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;88&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.66&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;MAYELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;115&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;74&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NAYELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;1730&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;1084&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.63&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NALLELY&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;837&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;501&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.60&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;YANELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;301&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;176&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.58&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NAYELY&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;217&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;124&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.33&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.57&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NAYELY&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;217&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;92&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.42&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;YANELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;301&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;121&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.40&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NALLELY&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;837&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;319&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.38&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NAYELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;1730&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;607&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.35&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;MAYELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;115&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;39&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.34&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ANA&lt;/span&gt; &lt;span class="caps"&gt;YELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;138&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;44&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.32&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ANALLELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;110&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;35&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.32&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NAYELLI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;134&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;42&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.31&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ANAYELI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;1449&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;426&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.29&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ANALLELY&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;387&lt;/td&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;104&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.64&lt;/td&gt;&lt;td align="right" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;0.27&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br/&gt;
I figured it would be a good idea to count the percentage of first names that are only present in one party, and to my surprise the &lt;span class="caps"&gt;PAN&lt;/span&gt; has the highest percentage of unique names by far. I also measured the complexity of the names using Levenshtein and Soundex distances, and again the &lt;span class="caps"&gt;PAN&lt;/span&gt; had the most similarly spelled/sounding names.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-CqQQcyjaAhU_VNqx_skYuCI_AAAAAAAAI8M_lt50QTC9Gvc_s1600_unique_name.svg.png" imageanchor="1" &gt;&lt;img border="0" height="210" src="/images/blogger_images/1.bp.blogspot.com_-CqQQcyjaAhU_VNqx_skYuCI_AAAAAAAAI8M_lt50QTC9Gvc_s1600_unique_name.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
Here are random samples of some unique by party names:&lt;/div&gt;
&lt;div&gt;
&lt;br/&gt;
&lt;table style="border-collapse: collapse; border-spacing: 0px; color: black; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; max-width: 100%; vertical-align: middle;"&gt;&lt;thead&gt;
&lt;tr&gt;&lt;th align="left" style="background-color: #dddddd; border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;Names that are only present in the &lt;span class="caps"&gt;PAN&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ADALGOT&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;BLERIATH&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;EDONE&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;EMIDGIO&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;EROILIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;GIBSON&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;HABANA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;JAUDEL&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;JOLANI&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;GLORESBINDA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;LIUVITZA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;MYLTHON&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NUYHIAVI&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ORSIRIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;RICCO&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;VEUDY&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;YAMICLET&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;YECIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;YURINTZI&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ZAADIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table style="border-collapse: collapse; border-spacing: 0px; color: black; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; max-width: 100%; vertical-align: middle;"&gt;&lt;thead&gt;
&lt;tr&gt;&lt;th align="left" style="background-color: #dddddd; border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;Names that are only present in the &lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;BASELIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;MUYKEY&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ERAMIS&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;GUILSONI&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;HAIRA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;HEREDINDA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;HORANA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;IGILVIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ISBELI&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;JASSINA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PAARIS&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;LLARIDEY&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;MAFAIDA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;MARVITA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PRYTSCILIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;SARIDH&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;YARHELI&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;YESSMIT&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;YSAYCHU&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ZIRIACO&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table style="border-collapse: collapse; border-spacing: 0px; color: black; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; max-width: 100%; vertical-align: middle;"&gt;&lt;thead&gt;
&lt;tr&gt;&lt;th align="left" style="background-color: #dddddd; border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;Names that are only present in the &lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;AAGAR&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ADIRAI&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;BEGAIN&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;BERENIZA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ELIOTZEL&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ELISAMARIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;ENIZAEL&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;GLENIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;JARASED&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;MOSAISELA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NARCIDELIA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;NAZDRY&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;POLEN&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;PONPOM&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;RUTHYALITH&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;SELENICO&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;SHADIRA&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;SICLALI&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;WUDRUM&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="left" style="border: 1px solid rgb(238, 238, 238); padding: 5px 10px;"&gt;&lt;span class="caps"&gt;YENIZEN&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Hopefully your parents never gave you the misspelled name of a famous Mexican stripper!&lt;br/&gt;
&lt;br/&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/tZXmBbLoEIU" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;
&lt;br/&gt;
Where people have unique first names they, unsurprisingly, also have unique last names&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-f2qa9at07d0_VNqyN62NiAI_AAAAAAAAI8U_YrjzMtDt6s4_s1600_unique_name_map.svg.png" imageanchor="1" &gt;&lt;img border="0" height="310" src="/images/blogger_images/2.bp.blogspot.com_-f2qa9at07d0_VNqyN62NiAI_AAAAAAAAI8U_YrjzMtDt6s4_s1600_unique_name_map.svg.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-VUh0HY8x8IU_VNqySZcgGjI_AAAAAAAAI8c_iM96W24JwuA_s1600_unique_lastnames_map.svg.png" imageanchor="1" &gt;&lt;img border="0" height="310" src="/images/blogger_images/3.bp.blogspot.com_-VUh0HY8x8IU_VNqySZcgGjI_AAAAAAAAI8c_iM96W24JwuA_s1600_unique_lastnames_map.svg.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
As you probably noticed the names play into some deep seated stereotypes in Mexican culture (some worse than others). Simply perform a search in Google Images for &amp;#8220;Brayan&amp;#8221; or visit &lt;a href="http://eldeforma.com/2012/05/24/3-adolescentes-de-apellido-compuesto-posan-para-la-seccion-gente-del-periodico-reforma/"&gt;El Deforma&lt;/a&gt; to see how they routinely use long names to make fun of the mirreyes. Brayan is in fact more common among members of &lt;span class="caps"&gt;PRD&lt;/span&gt; (even if unique names are more common in the &lt;span class="caps"&gt;PAN&lt;/span&gt;) and long names do seem to be more common among PANistas:&lt;br/&gt;
&lt;div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-cTxD4suu0J0_VNfyN7FU-CI_AAAAAAAAI6I_NH9arP3W6wc_s1600_length_distribution_parties.svg.png" imageanchor="1" &gt;&lt;img border="0" height="291" src="/images/blogger_images/1.bp.blogspot.com_-cTxD4suu0J0_VNfyN7FU-CI_AAAAAAAAI6I_NH9arP3W6wc_s1600_length_distribution_parties.svg.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
The longest name in the database belongs to &lt;span class="caps"&gt;GUADALUPE&lt;/span&gt; &lt;span class="caps"&gt;DEL&lt;/span&gt; &lt;span class="caps"&gt;SAGRADO&lt;/span&gt; &lt;span class="caps"&gt;CORAZON&lt;/span&gt; &lt;span class="caps"&gt;ESPINOSA&lt;/span&gt; &lt;span class="caps"&gt;DE&lt;/span&gt; &lt;span class="caps"&gt;LOS&lt;/span&gt; &lt;span class="caps"&gt;MONTEROS&lt;/span&gt; Y &lt;span class="caps"&gt;GOLZARRI&lt;/span&gt;, and I bet I don&amp;#8217;t even have to tell you what party she belong to (&lt;span class="caps"&gt;PAN&lt;/span&gt;). Well, actually, it seems the name field at the time of entering the data in the &lt;span class="caps"&gt;INE&lt;/span&gt; database had a length limit and some names got clipped off, or abbreviated. I tried to somewhat clean up the data when possible.&lt;br/&gt;
&lt;br/&gt;
Using a logistic regression to predict left wing or right wing party membership (I excluded the &lt;span class="caps"&gt;PRI&lt;/span&gt; since they only care about power and are corrupt, yay stereotypes!) gives exactly the results you would expect:&lt;br/&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-y34kS4ijBZg_VNfyUtgFCoI_AAAAAAAAI6Q_UTknGUUZFZY_s1600_length_reg.svg.png" imageanchor="1" &gt;&lt;img border="0" height="291" src="/images/blogger_images/4.bp.blogspot.com_-y34kS4ijBZg_VNfyUtgFCoI_AAAAAAAAI6Q_UTknGUUZFZY_s1600_length_reg.svg.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; Code is available from &lt;a href="https://github.com/diegovalle/caste-war"&gt;GitHub&lt;/a&gt;&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-vnzgFLAoZuE_VNgQ4jE_JnI_AAAAAAAAI60_YOjJurv4NMk_s1600_prd.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/2.bp.blogspot.com_-vnzgFLAoZuE_VNgQ4jE_JnI_AAAAAAAAI60_YOjJurv4NMk_s1600_prd.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div style="clear: both;"&gt;&lt;/div&gt;

&lt;/div&gt;</summary><category term="elections"></category><category term="politics"></category><category term="mirrreynato"></category></entry><entry><title>The 74 most violent cities in Mexico (2013)</title><link href="https://blog.diegovalle.net/2015/01/the-74-most-violent-cities-in-mexico.html" rel="alternate"></link><updated>2015-01-14T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2015-01-14:2015/01/the-74-most-violent-cities-in-mexico.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-MRLIYf2Wako_VLXlXyLqPKI_AAAAAAAAIzc_5GbtAkFZ1Uc_s1600_change2012-2013.png" imageanchor="1" &gt;&lt;img border="0" height="640" src="/images/blogger_images/1.bp.blogspot.com_-MRLIYf2Wako_VLXlXyLqPKI_AAAAAAAAIzc_5GbtAkFZ1Uc_s1600_change2012-2013.png" width="481"/&gt;&lt;/a&gt;&lt;/div&gt;
I’ve updated the &lt;a href="https://github.com/diegovalle/mxmortalitydb"&gt;mxmortalitydb&lt;/a&gt; package to include 2013 data. This data only package includes all injury intent deaths (accidents, homicides, suicides, and unspcified intent) that were registered in Mexico from 2004 to 2013. You can use the package to calculate changes and trends in homicide rates in the most violent metro areas (or large municipios) or at the national level.&lt;br/&gt;
&lt;a name="more"&gt;&lt;/a&gt;&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-k5Slsj78fPU_VLXopC_wBxI_AAAAAAAAI0I_EPG9M3y3wfk_s1600_unnamed-chunk-4-1.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/1.bp.blogspot.com_-k5Slsj78fPU_VLXopC_wBxI_AAAAAAAAI0I_EPG9M3y3wfk_s1600_unnamed-chunk-4-1.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
You can also use the package to explore the deaths whose intent was left unspecified (note the large increase in firearm deaths in 2011, the year Mexico had the highest homicide rate in recent history)&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-G-1Ee56oeZ4_VLXlhvwiIjI_AAAAAAAAIzs_EpcDIGLcbO8_s1600_unnamed-chunk-4-2.png" imageanchor="1" &gt;&lt;img border="0" height="266" src="/images/blogger_images/4.bp.blogspot.com_-G-1Ee56oeZ4_VLXlhvwiIjI_AAAAAAAAIzs_EpcDIGLcbO8_s1600_unnamed-chunk-4-2.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
And make pretty plots of the most violent metro areas or large municipios which are not part of a metro area (in Mexico by definition a metro area has to consist of more than one municipio, so it is worthwhile to include single municipios with large populations). I should also note that the database only includes deaths where a death certificate was issued, so if there are clandestine mass graves that haven&amp;#8217;t been found (as was the case recently in Iguala) or where the deaths somehow were not registered (as was the case with the Taxco mass grave) then the deaths are not included in the counts.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-MRLIYf2Wako_VLXlXyLqPKI_AAAAAAAAIzc_5GbtAkFZ1Uc_s1600_change2012-2013.png" imageanchor="1" &gt;&lt;img border="0" height="640" src="/images/blogger_images/1.bp.blogspot.com_-MRLIYf2Wako_VLXlXyLqPKI_AAAAAAAAIzc_5GbtAkFZ1Uc_s1600_change2012-2013.png" width="481"/&gt;&lt;/a&gt;&lt;/div&gt;
While violence has decreased in recent years it still has a long way to drop before it reaches the levels seen in 2006.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-RW4kPfwWfYU_VLXlxuE9brI_AAAAAAAAIz8_4iLCGw84fs4_s1600_change2006-2013.png" imageanchor="1" &gt;&lt;img border="0" height="640" src="/images/blogger_images/4.bp.blogspot.com_-RW4kPfwWfYU_VLXlxuE9brI_AAAAAAAAIz8_4iLCGw84fs4_s1600_change2006-2013.png" width="482"/&gt;&lt;/a&gt;&lt;/div&gt;
Note the mixed trend in Michoacán.&lt;br/&gt;
&lt;br/&gt;
Do note that the charts of homicides from 2006 were made with the 2010 population according to the &lt;span class="caps"&gt;CONAPO&lt;/span&gt;, so the homicide rate was underestimated by a little bit. Also, rather than using the raw homicide numbers I adjusted them by classifying deaths of unknown intent as described in the &lt;a href="https://github.com/diegovalle/mxmortalitydb"&gt;mxmortalitydb package&lt;/a&gt; and this &lt;a href="http://blog.diegovalle.net/2012/12/mexicos-drug-war-63000-extra-deaths-in.html"&gt;post&lt;/a&gt;.&lt;br/&gt;
&lt;div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;
The code for generating the charts is available from &lt;a href="https://gist.github.com/diegovalle/f6275ac1aa83e0a7d9e3"&gt;GitHub&lt;/a&gt;&lt;/div&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="drug-war"></category><category term="r"></category></entry><entry><title>Nobody lives here</title><link href="https://blog.diegovalle.net/2014/12/nobody-lives-here.html" rel="alternate"></link><updated>2014-12-10T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2014-12-10:2014/12/nobody-lives-here.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://www.diegovalle.net/maps/nobody-lives-here" imageanchor="1" &gt;&lt;img border="0" height="257" src="/images/blogger_images/3.bp.blogspot.com_-HKCUjsSGE_M_VIdhlcIf1dI_AAAAAAAAIjk_FYJpv6vsEUY_s1600_a1.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
This is an interactive &lt;a href="https://www.diegovalle.net/maps/nobody-lives-here"&gt;map&lt;/a&gt; of all rural AGEBs that contain no localities and thus are empty of permanent residents. If you compare it to the &lt;a href="http://mapsbynik.tumblr.com/post/82791188950/nobody-lives-here-the-nearly-5-million-census"&gt;&lt;span class="caps"&gt;US&lt;/span&gt; version&lt;/a&gt;, the total area with no people living inside it is much smaller since the data in Mexico is only available at the &lt;span class="caps"&gt;AGEB&lt;/span&gt; level (kind of like Census Tracts), whereas the data in the &lt;span class="caps"&gt;US&lt;/span&gt; is available at the Census Block level which are much smaller. Since there are no polygons available for rural localities, only points, I counted all rural AGEBs that contained a locality as being inhabited.&lt;br/&gt;
&lt;br/&gt;
&lt;a name="more"&gt;&lt;/a&gt;With a relief map&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-Sfgfs_YCc1c_VIiSaFp5-kI_AAAAAAAAIj0_8acZ4pjdpio_s1600_sdfg.jpg" imageanchor="1" &gt;&lt;img border="0" height="226" src="/images/blogger_images/4.bp.blogspot.com_-Sfgfs_YCc1c_VIiSaFp5-kI_AAAAAAAAIj0_8acZ4pjdpio_s1600_sdfg.jpg" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
With dense vegetation&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-kRJD3HtMMU4_VIiSglPizhI_AAAAAAAAIj8_JnFkZ-_beYI_s1600_vegetacion_densa.png" imageanchor="1" &gt;&lt;img border="0" height="226" src="/images/blogger_images/2.bp.blogspot.com_-kRJD3HtMMU4_VIiSglPizhI_AAAAAAAAIj8_JnFkZ-_beYI_s1600_vegetacion_densa.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
By type of climate&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-1sNj6yJKxN4_VIiSnYM3cII_AAAAAAAAIkE_QTYI-vbkVzk_s1600_a.png" imageanchor="1" &gt;&lt;img border="0" height="226" src="/images/blogger_images/2.bp.blogspot.com_-1sNj6yJKxN4_VIiSnYM3cII_AAAAAAAAIkE_QTYI-vbkVzk_s1600_a.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
With protected areas (Área Nacional Protegida)&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-6AUDjuxHrUU_VIiSzPSDUGI_AAAAAAAAIkM_G7MlYtVUPfg_s1600_anp.png" imageanchor="1" &gt;&lt;img border="0" height="226" src="/images/blogger_images/2.bp.blogspot.com_-6AUDjuxHrUU_VIiSzPSDUGI_AAAAAAAAIkM_G7MlYtVUPfg_s1600_anp.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;br/&gt;
The code is available from &lt;a href="https://gist.github.com/diegovalle/2d997631d08f894d64e6"&gt;GitHub&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="gis"></category><category term="javascript"></category></entry><entry><title>HoyodeCrimen.com - Crime information for the Distrito Federal</title><link href="https://blog.diegovalle.net/2014/11/hoyodecrimencom-crime-information-for.html" rel="alternate"></link><updated>2014-11-10T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2014-11-10:2014/11/hoyodecrimencom-crime-information-for.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
Crime information for the Federal District now has its own website with updated data&lt;br/&gt;
&lt;br/&gt;
&lt;a href="https://hoyodecrimen.com/en"&gt;https://hoyodecrimen.com/en&lt;/a&gt;/ - English version&lt;br/&gt;
&lt;a href="https://hoyodecrimen.com/"&gt;https://hoyodecrimen.com/&lt;/a&gt; - Spanish version&lt;br/&gt;
&lt;br/&gt;
I&amp;#8217;ve also added a &lt;a href="https://hoyodecrimen.com/en/trends"&gt;trends&lt;/a&gt; section where you can look up which cuadrantes experienced a rise in crime&lt;br/&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="/images/blogger_images/3.bp.blogspot.com_-_wyTP_VtNUY_VGC4js4s5sI_AAAAAAAAIW0_IbXYaZdg2Hk_s1600_https%2B%2B%2Bhoyodecrimen.com%2Ben%2Btrends.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="236" src="/images/blogger_images/3.bp.blogspot.com_-_wyTP_VtNUY_VGC4js4s5sI_AAAAAAAAIW0_IbXYaZdg2Hk_s1600_https%2B%2B%2Bhoyodecrimen.com%2Ben%2Btrends.png" width="400"/&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;There seems to a be big problem with car robberies near where the new airport will be built&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br/&gt;
&lt;br/&gt;
Since the crime data comes from &lt;span class="caps"&gt;FOIA&lt;/span&gt; requests to the &lt;span class="caps"&gt;SSPDF&lt;/span&gt; (Mexico City Police), I&amp;#8217;ve added free email announcements to keep you informed of when new data is available:&lt;br/&gt;
&lt;br/&gt;
&lt;a href="http://eepurl.com/71l2n"&gt;Notifications in English&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://eepurl.com/7XKNT"&gt;Notifications in Spanish&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
There&amp;#8217;s even an &lt;a href="https://hoyodecrimen.com/api/"&gt;&lt;span class="caps"&gt;API&lt;/span&gt;&lt;/a&gt; with lots of cools stuff:&lt;br/&gt;
&lt;a name="more"&gt;&lt;/a&gt;&lt;br/&gt;
&lt;table border="1" class="docutils" style="background-color: white; border-collapse: collapse; border: 0px; color: #3e4349; font-family: Arial, sans-serif; font-size: 14px;"&gt;&lt;thead valign="bottom"&gt;
&lt;tr class="row-odd"&gt;&lt;th class="head" style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Service&lt;/th&gt;&lt;th class="head" style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Action&lt;/th&gt;&lt;th class="head" style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;&lt;span class="caps"&gt;URI&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody valign="top"&gt;
&lt;tr class="row-even"&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Point in Polygon&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Given a longitude and latitude return the corresponding cuadrante and sector&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;&lt;div class="first last line-block" style="margin-bottom: 1em; margin-top: 1em;"&gt;
&lt;div class="line"&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="row-odd"&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Time Series&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Crime counts ordered by month of occurrence for a cuadrante or sector&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;&lt;div class="first last line-block" style="margin-bottom: 1em; margin-top: 1em;"&gt;
&lt;div class="line"&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="row-even"&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;List Cuadrantes or Sectores&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Sum of crimes that occurred in a cuadrante or sector for a specified period of time&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;&lt;div class="first last line-block" style="margin-bottom: 1em; margin-top: 1em;"&gt;
&lt;div class="line"&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="row-odd"&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Top Most Violent&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;A list of the cuadrantes and sectors with the highest rates (sectores), crime counts (cuadrantes) or change in crime counts (cuadrantes)&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;&lt;div class="first last line-block" style="margin-bottom: 1em; margin-top: 1em;"&gt;
&lt;div class="line"&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="row-even"&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;&lt;span class="caps"&gt;DF&lt;/span&gt; data&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;A time series of the sum of all crimes that occurred in the Federal District&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;&lt;div class="first last line-block" style="margin-bottom: 1em; margin-top: 1em;"&gt;
&lt;div class="line"&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr class="row-odd"&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Enumerate&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;Get a list of the names of all cuadrantes, sectores or crimes&lt;/td&gt;&lt;td style="border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-width: 0px 0px 1px; padding: 1px 8px 1px 5px;"&gt;&lt;div class="first last line-block" style="margin-bottom: 1em; margin-top: 1em;"&gt;
&lt;div class="line"&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br/&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; Yes, I know the Spanish translation is not complete, but I&amp;#8217;ll finish it someday&lt;br/&gt;
&lt;span class="caps"&gt;P.P.S.&lt;/span&gt; The code is available at &lt;a href="https://github.com/diegovalle/hoyodecrimen.api"&gt;GitHub&lt;/a&gt;. It was built with Python + Flask + PostgreSQL + PotsGIS + Redis + D3 and an unholy combination of jQuery and AngularJS
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="crime"></category><category term="javascript"></category><category term="python"></category></entry><entry><title>Important notice regarding crimenmexico</title><link href="https://blog.diegovalle.net/2014/09/important-notice-regarding-crimenmexico.html" rel="alternate"></link><updated>2014-09-25T00:00:00+02:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2014-09-25:2014/09/important-notice-regarding-crimenmexico.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
The website from which &lt;a href="https://elcri.men/"&gt;crimenmexico&lt;/a&gt; downloads crime information hasn&amp;#8217;t been responding for quite a while now. The &lt;span class="caps"&gt;SESNSP&lt;/span&gt; server&amp;#8217;s uptime has never been good but it has never stayed down for so long.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-REBmOYTs0Rg_VCN02fOOonI_AAAAAAAAHVE_z4atf3nxccI_s1600_uptime.png" imageanchor="1" &gt;&lt;img border="0" height="221" src="/images/blogger_images/2.bp.blogspot.com_-REBmOYTs0Rg_VCN02fOOonI_AAAAAAAAHVE_z4atf3nxccI_s1600_uptime.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
which I guess means that &lt;i&gt;Secretariado Ejecutivo del Sistema Nacional de Seguridad Pública&lt;/i&gt; has suspended its open data policy of providing crime information. Apparently crime info is now only downloadable from a couple of &lt;a href="http://www.secretariadoejecutivo.gob.mx/es/SecretariadoEjecutivo/09121420"&gt;zip files&lt;/a&gt;, but &lt;span class="caps"&gt;SESNSP&lt;/span&gt; made sure to:&lt;span id="goog_1246066625"&gt;&lt;/span&gt;&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;Change the names of the crimes to include whitespace at the end (e.g &amp;#8220;&lt;span class="caps"&gt;ROBOS&lt;/span&gt;&amp;#8221; to &amp;#8220;&lt;span class="caps"&gt;ROBOS&lt;/span&gt;&amp;nbsp;&amp;#8221;)&lt;/li&gt;
&lt;li&gt;Not include the &lt;span class="caps"&gt;INEGI&lt;/span&gt; code for each state and municipality, thus making it really difficult to merge with other&amp;nbsp;data&lt;/li&gt;
&lt;li&gt;Spell state names both with and without accents (YUCATÁN and &lt;span class="caps"&gt;YUCATAN&lt;/span&gt;)&lt;/li&gt;
&lt;li&gt;Include subtotals (e.g. total crimes with violence) at the municipality level but not at the state&amp;nbsp;level&lt;/li&gt;
&lt;li&gt;Change the file format from csv to xlsx&amp;nbsp;(Excel)&lt;/li&gt;
&lt;/ul&gt;
It&amp;#8217;s almost as if they didn&amp;#8217;t want anyone analyzing the data. It used to be that &lt;a href="https://elcri.men/es/"&gt;crimenmexico&lt;/a&gt; processed all the information in an automatic manner and made new data available immediately, but with these changes that has become impossible (I&amp;#8217;m betting next month there will be more changes). There will now be a delay of a few weeks or so while I figure how to process the data.&lt;br/&gt;
&lt;br/&gt;
At the &lt;a href="http://secretariadoejecutivo.gob.mx/incidencia-delictiva/incidencia-delictiva-fuero-comun.php"&gt;webpage for downloading the crime information&lt;/a&gt; the &lt;span class="caps"&gt;SESNSP&lt;/span&gt; claims that [emphasis added]:&lt;br/&gt;
&lt;div&gt;
&lt;blockquote class="tr_bq"&gt;
La presentación de los datos sobre incidencia delictiva en este portal electrónico obedece a los principios de acceso a la información y transparencia y a la&lt;b&gt; adopción de las mejores prácticas internacionales en gobierno abierto&lt;/b&gt;.&lt;/blockquote&gt;
If you disagree you can contact the &lt;span class="caps"&gt;SESNSP&lt;/span&gt; at: &lt;a href="mailto:cni@secretariadoejecutivo.gob.mx"&gt;cni@secretariadoejecutivo.gob.mx&lt;/a&gt;&lt;/div&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="drug-war"></category></entry><entry><title>Crime in Mexico City at the cuadrante delictivo level</title><link href="https://blog.diegovalle.net/2014/05/crime-in-mexico-city-at-cuadrante.html" rel="alternate"></link><updated>2014-05-27T00:00:00+02:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2014-05-27:2014/05/crime-in-mexico-city-at-cuadrante.html</id><summary type="html">&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; This post has been superceded by &lt;a href="https://hoyodecrimen.com"&gt;hoyodecrimen.com&lt;/a&gt;
&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://hoyodecrimen.com/en/" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img alt="" border="0" height="266" src="/images/blogger_images/3.bp.blogspot.com_-FRABFGdX-AY_U4PeuMWvMtI_AAAAAAAAGqM_kIYdCPl8NVI_s1600_Screenshot+-+05262014+-+07-37-58+PM.png" width="400"/&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Click on the image to visit the &lt;a href="https://hoyodecrimen.com/en/"&gt;interactive visualization&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
I recently made a &lt;a href="http://www.infomexdf.org.mx/InfomexDF/Default.aspx"&gt;&lt;span class="caps"&gt;FOIA&lt;/span&gt; request&lt;/a&gt; to the &lt;a href="http://www.ssp.df.gob.mx/Pages/Ini.aspx"&gt;&lt;span class="caps"&gt;SSPDF&lt;/span&gt;&lt;/a&gt; requesting information on crime at the &lt;i&gt;cuadrante delictivo&lt;/i&gt; level (in-between size a municipio and a &lt;a href="http://blog.diegovalle.net/2013/06/shapefiles-of-mexico-agebs-manzanas-etc.html"&gt;manzana&lt;/a&gt;), and to my surprise they actually answered with a &lt;a href="https://github.com/diegovalle/crimeDF/tree/9f96d6ed41ae3e3a025c8f78d771cba11735e49c/sspdf-data"&gt;&lt;span class="caps"&gt;PDF&lt;/span&gt; file&lt;/a&gt; containing homicides, robbery to businesses with violence, and car robbery with and without violence, from Jan 2013 to April 2014. I also asked for data on extortion, kidnapping, etc but the &lt;span class="caps"&gt;SSPDF&lt;/span&gt; claimed not to have any records on those crimes.&lt;br/&gt;
&lt;br/&gt;
To be able to display the data on a map I scraped the polygon coordinates of each &lt;i&gt;cuadrante&lt;/i&gt; from the &lt;a href="http://201.144.220.174/pid/gps/cuadrantesWeb.php"&gt;find the cop assigned to your quadrant &lt;/a&gt;website. The data was supplemented with population figures obtained by using a point-in-polygon algorithm from the 2010 Census at the manzana level.&lt;br/&gt;
&lt;br/&gt;
The data for April 2014 was clearly incomplete and I excluded it from the visualizations. The numbers provided by the &lt;span class="caps"&gt;SSPDF&lt;/span&gt; compare favorably to those provided by the &lt;span class="caps"&gt;SNSP&lt;/span&gt;, though you have to remember these are&lt;i&gt; averiguaciones previas&lt;/i&gt; (reports) and that they undercount the number of victims, especially for the crime of homicide.&lt;br/&gt;
&lt;br/&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;a href="http://www.secretariadoejecutivo.gob.mx/work/models/SecretariadoEjecutivo/Resource/131/1/images/2013Act_052014.pdf#11"&gt;Crime  (2013) &lt;/a&gt;&lt;/th&gt;
&lt;th&gt;&lt;span class="caps"&gt;SNSP&lt;/span&gt;&lt;/th&gt;
&lt;th&gt;&lt;span class="caps"&gt;SSPDF&lt;/span&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Homicidio doloso&lt;/td&gt;
&lt;td&gt;749&lt;/td&gt;
&lt;td&gt;899&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Robo a negocio C/V&lt;/td&gt;
&lt;td&gt;4,239&lt;/td&gt;
&lt;td&gt;4290&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Robo de vehiculo automotor C/V&lt;/td&gt;
&lt;td&gt;5,223&lt;/td&gt;
&lt;td&gt;5,211&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Robo de vehiculo automotor S/V&lt;/td&gt;
&lt;td&gt;12,056&lt;/td&gt;
&lt;td&gt;12,014&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br/&gt;
The data at the cuadrante level is visualized as counts because the daytime population of a cuadrante is probably different from the number of people who actually live there.&lt;br/&gt;
&lt;br/&gt;
&lt;a href="https://hoyodecrimen.com/en/counts"&gt;Quadrants&lt;/a&gt;&lt;br/&gt;
&lt;a href="https://hoyodecrimen.com/en/rates"&gt;Sectors&lt;/a&gt; (Each sector contains many quadrants)&lt;br/&gt;
&lt;a href="https://hoyodecrimen.com/en/"&gt;Website&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; The code and data are on &lt;a href="https://github.com/diegovalle/crimeDF"&gt;GitHub&lt;/a&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;</summary><category term="d3js"></category><category term="gis"></category></entry><entry><title>Analysis of the UNAM’s entrance exam</title><link href="https://blog.diegovalle.net/2014/04/analisis-exam-de-admision-unam.html" rel="alternate"></link><updated>2014-04-07T00:00:00+02:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2014-04-07:2014/04/analisis-exam-de-admision-unam.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-W024CTuRmSA_UzOZeyqzFpI_AAAAAAAAGlY_sHWd5TcNwow_s1600_Physical+Sciences%252C+Mathematics+and+Engineering-majors.svg.png" imageanchor="1" &gt;&lt;img border="0" height="300" src="/images/blogger_images/1.bp.blogspot.com_-W024CTuRmSA_UzOZeyqzFpI_AAAAAAAAGlY_sHWd5TcNwow_s1600_Physical+Sciences%252C+Mathematics+and+Engineering-majors.svg.png" width="540"/&gt;&lt;/a&gt;&lt;/div&gt;
The &lt;span class="caps"&gt;UNAM&lt;/span&gt; is Mexico&amp;#8217;s biggest and most important university. To enter it students must either take an exam or graduate from a high school run by the &lt;span class="caps"&gt;UNAM&lt;/span&gt; in less than 4 years with a grade point average of at least 70% (although some majors like medicine require 90% for &lt;i&gt;pase directo&lt;/i&gt;). The admission exam is given twice a year, in February and June, and any student from any high school with at least a grade point average of 70% can take it. If the student meets the requirements for entering the &lt;span class="caps"&gt;UNAM&lt;/span&gt;, passing the exam guarantees him admission. The exam has 120 questions.&lt;br/&gt;
&lt;a name="more"&gt;&lt;/a&gt;&lt;br/&gt;
Depending on the student&amp;#8217;s choice of major, the admission exam emphasizes one of four basic areas of study. Let&amp;#8217;s say you want to study math: in addition to being tested on the topics every high school student is supposed to know, you&amp;#8217;ll get a couple of extra questions about integration by parts; if you want to study biology the extra questions will be about the the Krebs cycle; if you want to study philosophy the exam will probably include extra references to the great works of literature; and if you want to study a social science you&amp;#8217;ll be asked about the differences between a &lt;a href="http://eldeforma.com/2014/03/22/unam-ofrecera-la-carrera-de-licenciatura-en-filantropia/"&gt;grand macchiato and a caffè latte&lt;/a&gt;.&lt;br/&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://www.diegovalle.net/charts/unam/all-unam.html"&gt;&lt;img border="0" height="640" src="/images/blogger_images/1.bp.blogspot.com_-qb0xz0yZ8A8_UzORAIretuI_AAAAAAAAGk4_cP_dRh5EHxA_s1600_SankeyID612f45f26c41.png" style="margin-left: auto; margin-right: auto;" width="392"/&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Click on the chart to visit the interactive version&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.diegovalle.net/charts/unam/all-unam.html" imageanchor="1" &gt;&lt;/a&gt;&lt;br class="Apple-interchange-newline"/&gt;&lt;/div&gt;
&lt;a href="http://www.diegovalle.net/charts/unam/all-unam.html" imageanchor="1" &gt;&lt;/a&gt;&lt;br/&gt;
Apart from &lt;span class="caps"&gt;UNAM&lt;/span&gt;&amp;#8217;s main (and most prestigious) campus of Ciudad Universitaria (&lt;span class="caps"&gt;CU&lt;/span&gt;), the university has several satellite campuses in the Mexico City metro area as well as many others across Mexico. In this post I will only analyse those located in Mexico City, and only for the scholarized system (&lt;i&gt;sistema escolarizado&lt;/i&gt;) where the students have to actually sit in a classroom (the &lt;span class="caps"&gt;UNAM&lt;/span&gt; also offers remote &lt;span class="caps"&gt;TV&lt;/span&gt;/Internet classes and under an open system).&lt;span style="background-color: white; color: #252525; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px;"&gt; &lt;/span&gt;The admission exam to the &lt;span class="caps"&gt;UNAM&lt;/span&gt; is quite competitive and only a small percentage of those who apply actually get in.&lt;br/&gt;
&lt;br/&gt;
&lt;table&gt;&lt;thead&gt;
&lt;tr&gt; &lt;th&gt;Date&lt;/th&gt; &lt;th&gt;Location&lt;/th&gt; &lt;th&gt;Percentage &lt;br/&gt;
admitted&lt;/th&gt; &lt;th&gt;Applied&lt;/th&gt; &lt;th&gt;Completed&lt;br/&gt;
Test &lt;/th&gt; &lt;th&gt;Admitted&lt;/th&gt; &lt;/tr&gt;
&lt;/thead&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;2011-06 &lt;/td&gt; &lt;td&gt;&lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;8.6&lt;/td&gt; &lt;td&gt;30,615 &lt;/td&gt; &lt;td&gt;27,515 &lt;/td&gt; &lt;td&gt;2,626 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2011-06 &lt;/td&gt; &lt;td&gt;Not &lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;9.1&lt;/td&gt; &lt;td&gt;32,215 &lt;/td&gt; &lt;td&gt;29,667 &lt;/td&gt; &lt;td&gt;2,916 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2012-02 &lt;/td&gt; &lt;td&gt;&lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;5.2&lt;/td&gt; &lt;td&gt;61,262 &lt;/td&gt; &lt;td&gt;55,793 &lt;/td&gt; &lt;td&gt;3,192 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2012-02 &lt;/td&gt; &lt;td&gt;Not &lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;6.4&lt;/td&gt; &lt;td&gt;56,012 &lt;/td&gt; &lt;td&gt;52,287 &lt;/td&gt; &lt;td&gt;3,597 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2012-06 &lt;/td&gt; &lt;td&gt;&lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;5.1 &lt;/td&gt; &lt;td&gt;30,944 &lt;/td&gt; &lt;td&gt;28,084 &lt;/td&gt; &lt;td&gt;1,573 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2012-06 &lt;/td&gt; &lt;td&gt;Not &lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;10.1&lt;/td&gt; &lt;td&gt;32,741 &lt;/td&gt; &lt;td&gt;30,354 &lt;/td&gt; &lt;td&gt;3,299 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2013-02 &lt;/td&gt; &lt;td&gt;&lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;5.4&lt;/td&gt; &lt;td&gt;63,562 &lt;/td&gt; &lt;td&gt;59,425 &lt;/td&gt; &lt;td&gt;3,424 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2013-02 &lt;/td&gt; &lt;td&gt;Not &lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;6.7&lt;/td&gt; &lt;td&gt;56,348 &lt;/td&gt; &lt;td&gt;53,547 &lt;/td&gt; &lt;td&gt;3,800 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2013-06 &lt;/td&gt; &lt;td&gt;&lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;6.3 &lt;/td&gt; &lt;td&gt;29,872 &lt;/td&gt; &lt;td&gt;26,052 &lt;/td&gt; &lt;td&gt;1,868 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2013-06 &lt;/td&gt; &lt;td&gt;Not &lt;span class="caps"&gt;CU&lt;/span&gt; &lt;/td&gt; &lt;td&gt;13.8 &lt;/td&gt; &lt;td&gt;33,744 &lt;/td&gt; &lt;td&gt;30,403 &lt;/td&gt; &lt;td&gt;4,656 &lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;
&lt;br/&gt;
This year Harvard sent out 2,023 offers out of 34,295 applications for an admission rate of 5.9%, which is exactly the same overall admission rate as the &lt;span class="caps"&gt;UNAM&lt;/span&gt; (&lt;span class="caps"&gt;CU&lt;/span&gt;) from June 2011 to June 2013 (though, of course, Harvard has much much &lt;a href="http://www.eluniversal.com.mx/notas/860687.html"&gt;lower standards&lt;/a&gt; in who it &lt;a href="http://www.hks.harvard.edu/news-events/news/press-releases/felipe-calderon-appointment"&gt;admits&lt;/a&gt;).&lt;br/&gt;
&lt;br/&gt;
Admissions by major&lt;br/&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://www.diegovalle.net/charts/unam/major-major.html" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;img border="0" height="640" src="/images/blogger_images/1.bp.blogspot.com_-gpIWyXhnrwY_UzOhxbR4AyI_AAAAAAAAGl0_CZPGRcMl4Y0_s1600_MEDICO+CIRUJANO+CU+31+219+persons.png" width="544"/&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Click on the chart to visit the interactive version&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br/&gt;
Admissions by area&lt;br/&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://www.diegovalle.net/charts/unam/area-area.html"&gt;&lt;img border="0" height="279" src="/images/blogger_images/2.bp.blogspot.com_-bwjiCvN-jC4_UzOm2SNv8YI_AAAAAAAAGmE_T-sS6YTeDPw_s1600_Sankeyarea.png" style="margin-left: auto; margin-right: auto;" width="320"/&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Click on the chart to visit the interactive version&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-bwjiCvN-jC4_UzOm2SNv8YI_AAAAAAAAGmE_T-sS6YTeDPw_s1600_Sankeyarea.png" imageanchor="1" &gt;&lt;/a&gt;&lt;br class="Apple-interchange-newline"/&gt;&lt;/div&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-bwjiCvN-jC4_UzOm2SNv8YI_AAAAAAAAGmE_T-sS6YTeDPw_s1600_Sankeyarea.png" imageanchor="1" &gt;&lt;/a&gt;&lt;br/&gt;
&lt;div&gt;
I scrapped all admission results from the &lt;a href="https://www.dgae.unam.mx/noticias/primingr/primingr.html"&gt;&lt;span class="caps"&gt;UNAM&lt;/span&gt;&amp;#8217;s website&lt;/a&gt; from June 2011 to June 2013. There were some problems with the data at the &lt;span class="caps"&gt;UNAM&lt;/span&gt;&amp;#8217;s end since the listings didn&amp;#8217;t always match the summary statistics included in the web pages. If you visit the results for &lt;a href="https://servicios.dgae.unam.mx/Junio2012/resultados/4/4337005.html"&gt;Historia del Arte&lt;/a&gt; you&amp;#8217;ll see that the summary statistics claim that zero students applied to take the test, but the listing includes 3 students (given the &lt;a href="http://www.diegovalle.net/charts/unam/scores.html"&gt;test scores of infomatics students&lt;/a&gt; I&amp;#8217;m not surprised by the mistakes). Anyways, this kind of mismatch was rare and didn&amp;#8217;t involve that many students. I took the actual listing to be definitive. In addition the results sometimes include data from students whose result is &lt;i&gt;Cita para aclarar situación escolar&lt;/i&gt;, I simply interpreted this as being a &lt;a href="http://www.statmethods.net/input/missingdata.html"&gt;missing value&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;
Physical Sciences, Mathematics and Engineering&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-OR_nW6bpjw4_U0HS18xq6pI_AAAAAAAAGmc_pnGpJw045Mc_s1600_Physical+Sciences,+Mathematics+and+Engineering-majors.svg.png" imageanchor="1" &gt;&lt;img border="0" height="182" src="/images/blogger_images/3.bp.blogspot.com_-OR_nW6bpjw4_U0HS18xq6pI_AAAAAAAAGmc_pnGpJw045Mc_s1600_Physical+Sciences,+Mathematics+and+Engineering-majors.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-HS67EjH3MBw_U0HS16RWYhI_AAAAAAAAGmg_fJTIy2vhs64_s1600_Physical+Sciences%252C+Mathematics+and+Engineering-faculty.svg.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/3.bp.blogspot.com_-HS67EjH3MBw_U0HS16RWYhI_AAAAAAAAGmg_fJTIy2vhs64_s1600_Physical+Sciences%252C+Mathematics+and+Engineering-faculty.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
Biological Sciences and Health&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-6a24UiCR57k_U0HS-DFMkRI_AAAAAAAAGnA_ZtZWTLa7N8Y_s1600_Biological+Sciences+and+Health-majors.svg.png" imageanchor="1" &gt;&lt;img border="0" height="182" src="/images/blogger_images/4.bp.blogspot.com_-6a24UiCR57k_U0HS-DFMkRI_AAAAAAAAGnA_ZtZWTLa7N8Y_s1600_Biological+Sciences+and+Health-majors.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-UQP1ST7BeKM_U0HS-Pa9OmI_AAAAAAAAGm8_2WykQkhbB4Q_s1600_Biological+Sciences+and+Health-faculty.svg.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/4.bp.blogspot.com_-UQP1ST7BeKM_U0HS-Pa9OmI_AAAAAAAAGm8_2WykQkhbB4Q_s1600_Biological+Sciences+and+Health-faculty.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
Social Sciences&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-zCkSPBDiIVA_U0HS-178WzI_AAAAAAAAGnQ_73Fnf2TrHV0_s1600_Social+Sciences-majors.svg.png" imageanchor="1" &gt;&lt;img border="0" height="182" src="/images/blogger_images/4.bp.blogspot.com_-zCkSPBDiIVA_U0HS-178WzI_AAAAAAAAGnQ_73Fnf2TrHV0_s1600_Social+Sciences-majors.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-XqDGiuVZi_Y_U0HS-pvUn5I_AAAAAAAAGnI_pdnibLdci9w_s1600_Social+Sciences-faculty.svg.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/4.bp.blogspot.com_-XqDGiuVZi_Y_U0HS-pvUn5I_AAAAAAAAGnI_pdnibLdci9w_s1600_Social+Sciences-faculty.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;br/&gt;
Humanities and Arts&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-NocvMsnOvPw_U0HS-vaJRkI_AAAAAAAAGnU_5M0TARxL9no_s1600_Humanities+and+Arts-majors.svg.png" imageanchor="1" &gt;&lt;img border="0" height="182" src="/images/blogger_images/1.bp.blogspot.com_-NocvMsnOvPw_U0HS-vaJRkI_AAAAAAAAGnU_5M0TARxL9no_s1600_Humanities+and+Arts-majors.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-RqKYkhbGyI8_U0HS95_XDaI_AAAAAAAAGm0_LdRWvFsCyls_s1600_Humanities+and+Arts-faculty.svg.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/4.bp.blogspot.com_-RqKYkhbGyI8_U0HS95_XDaI_AAAAAAAAGm0_LdRWvFsCyls_s1600_Humanities+and+Arts-faculty.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
Highest scoring majors in each area&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-jK_laWGXNCs_U0HdbjuBuQI_AAAAAAAAGoQ__u6vrA_ajyU_s1600_top-majors.svg.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/3.bp.blogspot.com_-jK_laWGXNCs_U0HdbjuBuQI_AAAAAAAAGoQ__u6vrA_ajyU_s1600_top-majors.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-svPjq-rOAxU_U0HjnyO4kwI_AAAAAAAAGog_UqVXyPj6z3w_s1600_percent-admitted-top.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/3.bp.blogspot.com_-svPjq-rOAxU_U0HjnyO4kwI_AAAAAAAAGog_UqVXyPj6z3w_s1600_percent-admitted-top.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
Changes in median admission scores from exam to exam (first differences)&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-7z8jZsCxVmQ_U0HUF0a-UqI_AAAAAAAAGnc_uRsbct3d56U_s1600_change-in-trend.svg.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/1.bp.blogspot.com_-7z8jZsCxVmQ_U0HUF0a-UqI_AAAAAAAAGnc_uRsbct3d56U_s1600_change-in-trend.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
Median scores each year&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-3YgR1uu5X2Q_U0HU4hV2hLI_AAAAAAAAGnk_6RYzSWUSrfQ_s1600_median-admit.svg.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/1.bp.blogspot.com_-3YgR1uu5X2Q_U0HU4hV2hLI_AAAAAAAAGnk_6RYzSWUSrfQ_s1600_median-admit.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
(a standard deviation is 17 points)&lt;br/&gt;
&lt;br/&gt;
One big problem with the admission process at the &lt;span class="caps"&gt;UNAM&lt;/span&gt; is that it doesn&amp;#8217;t use &lt;a href="http://en.wikipedia.org/wiki/Stable_marriage_problem"&gt;Gale-Shapley&lt;/a&gt; and thus students have an incentive to not reveal their true preferences:&lt;br/&gt;
&lt;br/&gt;
Imagine a student who is deciding between studying &lt;i&gt;ingeniería mecatrónica&lt;/i&gt; and&lt;i&gt; ingeniería mecánica&lt;/i&gt;, because mechatronics is very hard to get into, and students only get to apply to one major at each exam, he decides to list mechanical engineering as his choice even when there was a chance (albeit not as big) that he would have been admitted to mechatronics.&lt;br/&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://www.diegovalle.net/charts/unam/wasted.html" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="213" src="/images/blogger_images/1.bp.blogspot.com_-nzYPzDdZQGQ_U0HdAmOf-zI_AAAAAAAAGoI_ikXUBkJOo6s_s1600_mecatronica.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Click on the chart to visit the interactive version&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br/&gt;
Another consequence of not using Gale-Shapley is that &lt;b&gt;some students who do list their true preference are rejected in favor of lower scoring students&lt;/b&gt; (this is probably a really big deal).&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href="http://www.diegovalle.net/charts/unam/wasted.html" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="213" src="/images/blogger_images/3.bp.blogspot.com_-eh_wRlVfro0_U0Hc19TdSuI_AAAAAAAAGoA_gC8C0dI6sD4_s1600_rejected-area.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="font-size: 13px;"&gt;Click on the chart to visit the interactive version&lt;br/&gt;
&lt;div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Imagine a student who lists his or her true preference but who would be willing to entertain studying at an alternative campus with a lower admission score (international relations at &lt;span class="caps"&gt;CU&lt;/span&gt; vs international relations at &lt;span class="caps"&gt;FES&lt;/span&gt; Aragón) or a similar major with lower admittance requirements (international relations vs political science for example) who is rejected from his first choice but obtains a test score higher than the minimum requirement for his alternative.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-AzHg0DKTJZM_U0HaOjR06NI_AAAAAAAAGn0_tU1ZxSjTqo4_s1600_percent-admit.svg.png" imageanchor="1" &gt;&lt;img border="0" height="200" src="/images/blogger_images/3.bp.blogspot.com_-AzHg0DKTJZM_U0HaOjR06NI_AAAAAAAAGn0_tU1ZxSjTqo4_s1600_percent-admit.svg.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
We can see in the above chart how the percentage of students admitted increases at the lower requirement campuses during the June exam, but there is no such increase at the main &lt;span class="caps"&gt;CU&lt;/span&gt; campus. This is probably a consequence of students who had been rejected after the February exam having another go at being admitted at the lower requirement satellite campuses.&lt;br/&gt;
&lt;br/&gt;
The easiest way to remedy this would be to copy the &lt;a href="http://blog.diegovalle.net/2013/07/the-best-high-schools-in-mexico-city.html"&gt;&lt;span class="caps"&gt;COMIPEMS&lt;/span&gt;&lt;/a&gt; exam —which the &lt;span class="caps"&gt;UNAM&lt;/span&gt; helped design— and allow students to list more than one major/campus when applying. Obviously there are a lot of variations and complications the &lt;span class="caps"&gt;UNAM&lt;/span&gt; could use to make its admission process better, for example they could start admitting students from different areas than their first choice major if they had really high test scores. I&amp;#8217;m sure the &lt;strike&gt;applied math and computing&lt;/strike&gt; international relations students are up to the task of designing an admittance mechanism that satisfies Gale-Shapley.&lt;br/&gt;
&lt;br/&gt;
There&amp;#8217;s also a positive correlation between average test scores and the starting salaries of university graduates (of any university in Mexico City, not just the &lt;span class="caps"&gt;UNAM&lt;/span&gt;) in a poll conducted by Reforma in Mexico City.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-gSA--D5fK5g_U0H_MmUgySI_AAAAAAAAGo4_SUCFV_z7LEs_s1600_score_vs_salary.png" imageanchor="1" &gt;&lt;img border="0" height="213" src="/images/blogger_images/2.bp.blogspot.com_-gSA--D5fK5g_U0H_MmUgySI_AAAAAAAAGo4_SUCFV_z7LEs_s1600_score_vs_salary.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br/&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; I bet the &lt;a href="http://www.diegovalle.net/charts/unam/treemap-unam.html"&gt;Escuela Nacional de Artes Plásticas&lt;/a&gt; is full of &lt;a href="http://www.npr.org/blogs/money/2014/03/18/289013884/who-had-richer-parents-doctors-or-arists"&gt;rich kids&lt;/a&gt;&lt;br/&gt;
&lt;span class="caps"&gt;P.P.S.&lt;/span&gt; Visit the &lt;a href="http://www.diegovalle.net/charts/unam/scores.html"&gt;companion website&lt;/a&gt; full of interactive charts&lt;br/&gt;
&lt;span class="caps"&gt;P.P.P.S.&lt;/span&gt; &lt;a href="https://github.com/diegovalle/unam"&gt;Source code&lt;/a&gt;&lt;br/&gt;
&lt;div&gt;
&lt;span style="color: #333333; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"&gt;&lt;span style="background-color: whitesmoke; font-size: 14px; line-height: 20px;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #333333; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;"&gt;&lt;span style="background-color: whitesmoke; font-size: 14px; line-height: 20px;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="d3js"></category><category term="education"></category><category term="javascript"></category><category term="python"></category></entry><entry><title>Interactive map of the drug war in Mexico - 2012</title><link href="https://blog.diegovalle.net/2014/01/interactive-map-of-drug-war-in-mexico-2014.html" rel="alternate"></link><updated>2014-01-07T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2014-01-07:2014/01/interactive-map-of-drug-war-in-mexico-2014.html</id><summary type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.diegovalle.net/narcomap" imageanchor="1"&gt;&lt;img border="0" src="/images/blogger_images/2.bp.blogspot.com_-y5RwP2K6PoQ_UstuYtWXYOI_AAAAAAAAGjs_qXHtaJTjALI_s1600_Map+of+the+Drug+War+in+Mexico+(18).png" height="251" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;It&amp;#8217;s that time of the year again when I update the &lt;a href="http://www.diegovalle.net/narcomap"&gt;interactive map of the drug war in Mexico&lt;/a&gt;. The map now uses 30 day months to calculate homicide rates and the new &lt;span class="caps"&gt;CONAPO&lt;/span&gt; population estimates. As usual there is also a &lt;a href="http://www.diegovalle.net/narcomapa"&gt;Spanish version&lt;/a&gt;. All deaths registered without a date of occurrence were assumed to have occurred in the same month they were registered and all deaths without a municipio of occurrence were assumed to have taken place where they were registered. Various events are worth checking out:
&lt;!--more--&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/narcomap#city=Polygon&amp;amp;start=2012-01-15&amp;amp;end=2012-12-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=5&amp;amp;homtype=INEGI&amp;amp;clat=23.61796278994952&amp;amp;clong=-95.02734375&amp;amp;statadj=true&amp;amp;names=false&amp;amp;polygon=-102.9638671875+23.725011735951796%2C-103.5791015625+22.350075806124867%2C-102.65625+21.69826549685252%2C-101.6015625+22.998851594142923%2C-102.9638671875+23.725011735951796"&gt;Zacatecas/Fresnillo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/narcomap#city=Nuevo+Laredo&amp;amp;start=2012-01-15&amp;amp;end=2012-12-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=5&amp;amp;homtype=INEGI&amp;amp;clat=23.61796278994952&amp;amp;clong=-95.02734375&amp;amp;statadj=true&amp;amp;names=false"&gt;The increase in violence in Nuevo Laredo&lt;/a&gt;, which proved to be much &lt;a href="http://www.lmtonline.com/articles/2012/09/17/front/news/doc5057dd74c282f329288134.txt"&gt;worse than&amp;nbsp;thought &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/narcomap#city=San+Fernando%2C+Tamps&amp;amp;start=2012-01-15&amp;amp;end=2012-12-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=5&amp;amp;homtype=INEGI&amp;amp;clat=23.61796278994952&amp;amp;clong=-95.02734375&amp;amp;statadj=true&amp;amp;names=false"&gt;San&amp;nbsp;Fernando&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/narcomap#city=Polygon&amp;amp;start=2012-01-15&amp;amp;end=2012-12-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=7&amp;amp;homtype=INEGI&amp;amp;clat=20.74954939679734&amp;amp;clong=-100.5479736328125&amp;amp;statadj=true&amp;amp;names=true&amp;amp;polygon=-103.20556640625+20.117839630491634%2C-102.908935546875+19.818390093844958%2C-102.052001953125+20.29311344754411%2C-102.1728515625+20.68418377935239%2C-103.20556640625+20.117839630491634"&gt;The Michoacán/Jalisco border&lt;/a&gt;&amp;nbsp;(where a mass grave with over 60 bodies was recently&amp;nbsp;found)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/narcomap#city=Polygon&amp;amp;start=2012-01-15&amp;amp;end=2012-12-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=5&amp;amp;homtype=INEGI&amp;amp;clat=23.61796278994952&amp;amp;clong=-95.02734375&amp;amp;statadj=true&amp;amp;names=false&amp;amp;polygon=-118.0810546875+33.7243396617476%2C-119.1796875+31.541089879585808%2C-107.2705078125+29.764377375163125%2C-103.7548828125+28.69058765425071%2C-103.359375+32.99023555965106%2C-118.0810546875+33.7243396617476"&gt;Western border&lt;/a&gt; vs &lt;a href="http://www.diegovalle.net/narcomap#city=Polygon&amp;amp;start=2012-01-15&amp;amp;end=2012-12-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=5&amp;amp;homtype=INEGI&amp;amp;clat=23.61796278994952&amp;amp;clong=-95.02734375&amp;amp;statadj=true&amp;amp;names=false&amp;amp;polygon=-101.4697265625+30.14512718337613%2C-102.392578125+28.536274512989912%2C-98.5693359375+24.44714958973082%2C-96.416015625+24.287026865376447%2C-95.9765625+26.58852714730864%2C-101.4697265625+30.14512718337613"&gt;Eastern&amp;nbsp;border&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;More bodies from the &lt;a href="http://www.diegovalle.net/narcomap#city=Durango%2C+Dgo&amp;amp;start=2012-01-15&amp;amp;end=2012-12-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=5&amp;amp;homtype=INEGI&amp;amp;clat=23.61796278994952&amp;amp;clong=-95.02734375&amp;amp;statadj=true&amp;amp;names=false"&gt;Durango mass grave&lt;/a&gt;s that apparently were not&amp;nbsp;reported&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/narcomap#city=All+of+M%C3%A9xico&amp;amp;start=2006-12-15&amp;amp;end=2012-11-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=5&amp;amp;homtype=INEGI&amp;amp;clat=23.61796278994952&amp;amp;clong=-95.02734375&amp;amp;statadj=false&amp;amp;names=false"&gt;Homicides for the whole&amp;nbsp;sexenio&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
For the adjusted homicide data I did the&amp;nbsp;following:&lt;/p&gt;
&lt;p&gt;I again classified all deaths of unknown intent into accidents, suicides and homicides based on the age, sex of the victim and injury mechanism by which the death occurred. The method I used is similar to the one I used in my &lt;a href="http://blog.diegovalle.net/2012/07/machine-learning-for-better-homicide.html"&gt;Juarez post&lt;/a&gt; (with a penalized regression for Sinaloa and knn for the rest of Mexico).  For example, if someone told you to guess the intent of the death of a 70 year old woman who died in Merida by motor vehicle, you&amp;#8217;d probably guess it was an accident. If you had to guess the intent of the death of a young male in Acapulco who died by firearm, you&amp;#8217;d probably think it was an homicide.
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-U_plDPotY5Y_UrYzp_RrKXI_AAAAAAAAGjY_yNEk_zOIpRE_s1600_sen-spe.png" imageanchor="1" &gt;&lt;br class="Apple-interchange-newline" /&gt;&lt;img border="0" src="/images/blogger_images/4.bp.blogspot.com_-U_plDPotY5Y_UrYzp_RrKXI_AAAAAAAAGjY_yNEk_zOIpRE_s1600_sen-spe.png" height="346" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;
&lt;div&gt;
&lt;/div&gt;

&lt;p&gt;I also recoded all deaths by legal intervention as homicides in the adjusted version since it seems legal intervention deaths are not always classified correctly (the&amp;nbsp;&lt;a href="http://mexico.cnn.com/nacional/2010/09/16/al-menos-19-personas-mueren-en-enfrentamientos-en-nl-y-tamaulipas"&gt;19 deaths from the shootout&lt;/a&gt;&amp;nbsp;between the army and the narcos in&amp;nbsp;&lt;a href="http://www.diegovalle.net/mapa-guerra-narco.html#city=Polygon&amp;amp;start=2010-01-15&amp;amp;end=2010-12-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=9&amp;amp;homtype=INEGI&amp;amp;clat=26.050476281176586&amp;amp;clong=-98.817626953125&amp;amp;statadj=false&amp;amp;names=true&amp;amp;polygon=-99.5965576171875+26.256472923285344%2C-99.4427490234375+26.148041726002866%2C-99.06097412109375+26.44844313751643%2C-99.13787841796875+26.539394329017032%2C-99.5965576171875+26.256472923285344"&gt;General Treviño and Mier were recorded as homicides&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The problems with the data in the &lt;a href="http://blog.diegovalle.net/2012/09/more-errors-in-mexican-mortality.html"&gt;Federal District&lt;/a&gt; and &lt;a href="http://blog.diegovalle.net/2012/12/how-mexican-state-ended-up-with-more.html"&gt;Sinaloa&lt;/a&gt; were also&amp;nbsp;corrected.&lt;/p&gt;
&lt;p&gt;Since firearm accidents in&amp;nbsp;Baja&amp;nbsp;California went from 6 in 2006 to a 100 in 2007 and again to 6 in 2008 I reclassified all firearm accidents as if their intent were unknown&amp;nbsp;in&amp;nbsp;2007.&lt;/p&gt;
&lt;p&gt;I also added the mass grave in Taxco and the one in San Fernando since they either don&amp;#8217;t appear or are incomplete in the dataset from the &lt;span class="caps"&gt;INEGI&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;span class="caps"&gt;P.S.&lt;/span&gt; You can download a csv with the data from the &lt;a href="http://www.diegovalle.net/projects.html#url=%23datasets"&gt;projects&amp;nbsp;page&lt;/a&gt; &lt;/p&gt;</summary><category term="drug-war"></category><category term="javascript"></category><category term="protovis"></category></entry><entry><title>Changes in homicide rates</title><link href="https://blog.diegovalle.net/2013/12/changes-in-homicide-rates.html" rel="alternate"></link><updated>2013-12-18T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-12-18:2013/12/changes-in-homicide-rates.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-Ss28AOrxjlM_UrEPajK4ieI_AAAAAAAAGfo_Y7-ccrj1tFk_s1600_change2011-2012.png" imageanchor="1" &gt;&lt;img border="0" height="640" src="/images/blogger_images/1.bp.blogspot.com_-Ss28AOrxjlM_UrEPajK4ieI_AAAAAAAAGfo_Y7-ccrj1tFk_s640_change2011-2012.png" width="532"/&gt;&lt;/a&gt;&lt;/div&gt;
More examples of using the &lt;a href="https://github.com/diegovalle/mxmortalitydb"&gt;mxmortalitydb&lt;/a&gt; package! Changes and trends in homicide rates in the most violent metro areas or big municipios. There was a big increase in violence in Nuevo Laredo. For comparison the homicide rate in Chicago (metro area) was 8.2.&lt;br/&gt;
&lt;style&gt;
pre {overflow-x:hidden;padding:0;}
&lt;/style&gt;&lt;br/&gt;
&lt;div class="markdown-here-wrapper" data-md-original="%3Cp%3ELook%2C%20another%20example%20of%20using%20the%20%5Bmxmortalitydb%5D(https%3A%2F%2Fgithub.com%2Fdiegovalle%2Fmxmortalitydb)%20package!%20Changes%20and%20trend%20in%20homicide%20rates%20in%20the%20most%20violent%20metro%20areas%20or%20big%20municipios%20(note%20the%20log%20scales).%20For%20comparison%20the%20homicide%20rate%20in%20Chicago%20(metro%20area)%20was%208.2%3Cbr%3E%3Cbr%3E%3Cbr%3E%60%60%60r%3Cbr%3Elibrary(mxmortalitydb)%3Cbr%3Elibrary(stringr)%3Cbr%3Elibrary(plyr)%3Cbr%3Elibrary(ggplot2)%3Cbr%3Elibrary(grid)%26nbsp%3B%20%23%23%20needed%20for%20arrow%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E%3Cbr%3E%3Cbr%3E%60%60%60r%3Cbr%3EplotMetro%20%26lt%3B-%20function(metro.name%2C%20metro.areas)%20%7B%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Plot%20the%20homicide%20counts%20in%20a%20metro%20area%20or%20municipio%20metro.name%20-%20name%20of%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20the%20metro%20area%20to%20plot%20metro.areas%20-%20data%20frame%20containing%20a%20list%20of%20metro%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20areas%20in%20the%20same%20format%20as%20the%20metro.area%20dataframe%20from%20mxmortalitydb%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20data.frame%20metro.areas%20contains%20the%202010%20CONAPO%20metro%20areas%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20df%20%26lt%3B-%20merge(injury.intent%2C%20metro.areas%2C%20by.x%20%3D%20c(%22state_reg%22%2C%20%22mun_reg%22)%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20by.y%20%3D%20c(%22state_code%22%2C%20%22mun_code%22))%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Yearly%20homicides%20in%20Mexico%20City%2C%20by%20state%20of%20registration%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20df2%20%26lt%3B-%20ddply(subset(df%2C%20metro_area%20%3D%3D%20metro.name%20%26amp%3B%20intent.imputed%20%3D%3D%20%22Homicide%22)%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20.(year_reg)%2C%20summarise%2C%20count%20%3D%20length(state_reg))%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ggplot(df2%2C%20aes(year_reg%2C%20count))%20%2B%20geom_line()%20%2B%20labs(title%20%3D%20str_c(%22Homicides%20(plus%20deaths%20of%20unknown%20intent%20classified%20as%20homicide)%20in%5Cn%22%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20metro.name))%20%2B%20ylim(0%2C%20max(df2%24count))%20%2B%20ylab(%22homicide%20count%22)%20%2B%20xlab(%22year%20of%20registration%22)%20%2B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20theme_bw()%3Cbr%3E%7D%3Cbr%3E%3Cbr%3EplotChanges%20%26lt%3B-%20function(df%2C%20metro.areas%2C%20country.rate%2C%20years)%20%7B%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Plot%20of%20rates%20and%20trends%20df%20-%20injury.intent%20dataframr%20metro.areas%20-%20data%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20frame%20containing%20a%20list%20of%20metro%20areas%20in%20the%20same%20format%20as%20the%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20metro.area%20dataframe%20from%20mxmortalitydb%20country.rate%20-%20rate%20to%20show%20as%20a%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20gray%20dotted%20line%20years%20-%20start%20and%20end%20year%20to%20compare%20changes%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Where%20the%20municipio%20where%20the%20death%20occurred%20is%20unknown%20use%20the%20municipio%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20where%20it%20was%20registered%20as%20place%20of%20occurrance%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20df%5Bdf%24mun_occur_death%20%3D%3D%20999%2C%20%5D%24mun_occur_death%20%26lt%3B-%20df%5Bdf%24mun_occur_death%20%3D%3D%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20999%2C%20%5D%24mun_reg%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Counts%20of%20homicide%20by%20state%20and%20municipio%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20df%20%26lt%3B-%20ddply(subset(df%2C%20year_reg%20%25in%25%20years%20%26amp%3B%20intent.imputed%20%3D%3D%20%22Homicide%22)%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20.(state_occur_death%2C%20mun_occur_death%2C%20year_reg)%2C%20summarise%2C%20count%20%3D%20length(state_reg))%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Merge%20the%20counts%20with%20our%20fake%20metro%20areas%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20df%20%26lt%3B-%20merge(df%2C%20metro.areas%2C%20by.x%20%3D%20c(%22state_occur_death%22%2C%20%22mun_occur_death%22)%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20by.y%20%3D%20c(%22state_code%22%2C%20%22mun_code%22))%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Now%20get%20the%20counts%20by%20metro%20area%20(which%20may%20contain%20more%20than%20one%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20municipio)%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20df%20%26lt%3B-%20ddply(df%2C%20.(metro_area%2C%20year_reg)%2C%20summarise%2C%20count%20%3D%20sum(count)%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20population%20%3D%20sum(mun_population_2010)%2C%20rate%20%3D%20count%2Fpopulation%20*%2010%5E5)%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20We%20are%20only%20interesed%20if%20the%20metro%20area%20at%20some%20time%20had%20a%20homicide%20rate%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20of%20at%20least%2015%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20df%20%26lt%3B-%20subset(df%2C%20metro_area%20%25in%25%20subset(df%2C%20rate%20%26gt%3B%2015)%24metro_area)%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Make%20sure%20the%20dataframe%20is%20ordered%20by%20metro%20and%20year%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20df%20%26lt%3B-%20df%5Border(df%24metro_area%2C%20df%24year_reg)%2C%20%5D%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Order%20the%20chart%20by%20homicide%20rate%20in%202012%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20df%24metro_area%20%26lt%3B-%20reorder(df%24metro_area%2C%20df%24rate%2C%20function(x)%20x%5B%5B2%5D%5D)%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%23%23%20Data%20frame%20for%20the%20arrow%20structure%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20arrows%20%26lt%3B-%20ddply(df%2C%20.(metro_area)%2C%20summarise%2C%20start%20%3D%20rate%5B1%5D%2C%20end%20%3D%20rate%5B2%5D%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20metro_area%20%3D%20metro_area%5B1%5D%2C%20change%20%3D%20ifelse(rate%5B1%5D%20%26gt%3B%3D%20rate%5B2%5D%2C%20%22decrease%22%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22increase%22))%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ggplot(df%2C%20aes(rate%2C%20metro_area%2C%20group%20%3D%20as.factor(year_reg)%2C%20color%20%3D%20as.factor(year_reg)))%20%2B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20geom_point(aes(size%20%3D%20log(count)))%20%2B%20labs(title%20%3D%20%22Homicide%20(plus%20deaths%20of%20unknown%20intent%20classified%20as%20homicide)%20rates%20and%20trends%22)%20%2B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20scale_size(%22number%5Cnof%5Cnhomicides%22%2C%20breaks%20%3D%20c(log(50)%2C%20log(500)%2C%20log(3000))%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20labels%20%3D%20c(50%2C%20500%2C%203000))%20%2B%20geom_segment(data%20%3D%20arrows%2C%20aes(x%20%3D%20start%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20y%20%3D%20metro_area%2C%20xend%20%3D%20end%2C%20yend%20%3D%20metro_area%2C%20group%20%3D%20change%2C%20color%20%3D%20change)%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20arrow%20%3D%20arrow(length%20%3D%20unit(0.3%2C%20%22cm%22))%2C%20alpha%20%3D%200.8)%20%2B%20scale_color_manual(%22year%5Cnand%5Cntrend%22%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20values%20%3D%20c(%22gray%22%2C%20%22black%22%2C%20%22blue%22%2C%20%22red%22))%20%2B%20ylab(%22metro%20area%20or%20municipio%22)%20%2B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20xlab(%22homicide%20rate%22)%20%2B%20%23%20scale_x_log10()%2B%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20geom_vline(xintercept%20%3D%20country.rate%2C%20linetype%20%3D%202%2C%20color%20%3D%20%22%23666666%22)%20%2B%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20annotate(%22text%22%2C%20y%20%3D%20%22Tapachula%22%2C%20x%20%3D%2025%2C%20label%20%3D%20%22country%5Cnaverage%5Cn2012%22%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20hjust%20%3D%20-0.1%2C%20size%20%3D%204%2C%20color%20%3D%20%22%23666666%22)%20%2B%20theme_bw()%3Cbr%3E%7D%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E%3Cbr%3E%3Cbr%3E%60%60%60r%3Cbr%3E%23%23%20Let's%20treat%20the%20big%20municipalities%20which%20are%20not%20part%20of%20a%20metro%20area%20as%3Cbr%3E%23%23%20if%20they%20were%20one%20rename%20big.municipios%20to%20merge%20with%20metro.areas%3Cbr%3Ebig.municipios2%20%26lt%3B-%20big.municipios%3Cbr%3Enames(big.municipios2)%20%26lt%3B-%20c(%22state_code%22%2C%20%22mun_code%22%2C%20%22mun_population_2010%22%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22metro_area%22)%3Cbr%3Emetro.areas.fake%20%26lt%3B-%20rbind.fill(metro.areas%2C%20big.municipios2)%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E%3Cbr%3EAnd%20changes%20from%202006%20to%202012%3A%3Cbr%3E%3Cbr%3E%3Cbr%3E%60%60%60r%3Cbr%3EplotChanges(injury.intent%2C%20metro.areas.fake%2C%2024.5%2C%20c(2011%2C%202012))%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-4%5D(figure%2Funnamed-chunk-41.png)%20%3Cbr%3E%3Cbr%3E%60%60%60r%3Cbr%3Eggsave(%22change2011-2012.svg%22%2C%20dpi%20%3D%20100%2C%20width%20%3D%208%2C%20height%20%3D%209.6)%3Cbr%3EplotChanges(injury.intent%2C%20metro.areas.fake%2C%2024.5%2C%20c(2006%2C%202012))%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-4%5D(figure%2Funnamed-chunk-42.png)%20%3Cbr%3E%3Cbr%3E%60%60%60r%3Cbr%3Eggsave(%22change2006-2012.svg%22%2C%20dpi%20%3D%20100%2C%20width%20%3D%208%2C%20height%20%3D%209.6)%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E%3Cbr%3EInteresting%20that%20Tijuana%20had%20about%20the%20same%20homicide%20rate%20in%202012%20as%20in%202006.%20The%20rest%20of%20the%20violent%20metro%20areas%2Fbig%20municipios%20which%20saw%20decreases%20are%20in%20Michoac%C3%A1n.%20Sadly%2C%20it%20doesn%E2%80%99t%20look%20like%20pattern%20will%20hold%20in%202013%20(according%20to%20%5Bcrimenmexico%5D(http%3A%2F%2Fcrimenmexico.diegovalle.net%2F)%20Michoac%C3%A1n%20is%20experiencing%20a%20surge%20of%20violence%3Cbr%3E%3Cbr%3EDo%20note%20that%20the%20charts%20were%20made%20using%20the%202010%20population%20according%20to%20the%20CONAPO%20that%20comes%20with%20mxmortalitydb%2C%20so%20homicides%20in%202012%20were%20overestimated%20by%20a%20little%20bit%20and%20underestimated%20by%20a%20little%20bit%20in%202006.%20Also%20rather%20%3Cbr%3E%3Cbr%3E%3Cbr%3E%3Cbr%3E%60%60%60r%3Cbr%3Ell%20%26lt%3B-%20list(%22Acapulco%22%2C%20%22Nuevo%20Laredo%22%2C%20%22La%20Laguna%22%2C%20%22Chihuahua%22%2C%20%22Tecom%C3%A1n%22%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22Ju%C3%A1rez%22%2C%20%22Culiac%C3%A1n%22%2C%20%22Victoria%22%2C%20%22Hidalgo%20del%20Parral%22%2C%20%22Zihuatanejo%20de%20Azueta%22%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22El%20Mante%22%2C%20%22Ciudad%20Valles%22%2C%20%22Ciudad%20Valles%22%2C%20%22Durango%22%2C%20%22Cuernavaca%22%2C%20%22Zacatecas-Guadalupe%22%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22Monterrey%22%2C%20%22Piedras%20Negras%22%2C%20%22Mazatl%C3%A1n%22%2C%20%22Veracruz%22%2C%20%22Tijuana%22%2C%20%22Guadalajara%22%2C%20%3Cbr%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22Tepic%22%2C%20%22Coatzacoalcos%22)%3Cbr%3Enames(ll)%20%26lt%3B-%20ll%26nbsp%3B%20%23%20make%20lapply%20print%20the%20names%20of%20the%20metro%20areas%3Cbr%3Elapply(ll%2C%20plotMetro%2C%20metro.areas.fake)%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%24Acapulco%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-51.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24%60Nuevo%20Laredo%60%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-52.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24%60La%20Laguna%60%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-53.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Chihuahua%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-54.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Tecom%C3%A1n%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-55.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Ju%C3%A1rez%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-56.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Culiac%C3%A1n%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-57.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Victoria%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-58.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24%60Hidalgo%20del%20Parral%60%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-59.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24%60Zihuatanejo%20de%20Azueta%60%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-510.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24%60El%20Mante%60%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-511.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24%60Ciudad%20Valles%60%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-512.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24%60Ciudad%20Valles%60%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-513.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Durango%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-514.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Cuernavaca%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-515.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24%60Zacatecas-Guadalupe%60%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-516.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Monterrey%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-517.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24%60Piedras%20Negras%60%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-518.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Mazatl%C3%A1n%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-519.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Veracruz%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-520.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Tijuana%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-521.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Guadalajara%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-522.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Tepic%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-523.png)%20%3Cbr%3E%3Cbr%3E%60%60%60%3Cbr%3E%23%23%20%3Cbr%3E%23%23%20%24Coatzacoalcos%3Cbr%3E%60%60%60%3Cbr%3E%3Cbr%3E!%5Bplot%20of%20chunk%20unnamed-chunk-5%5D(figure%2Funnamed-chunk-524.png)%20%3Cbr%3E%3Cbr%3E%3Cbr%3ECheck%20out%20the%20%5Bsource%20code%5D(https%3A%2F%2Fgist.github.com%2Fdiegovalle%2F7998868)%20as%20an%20R%20markdown%20file.%3Cbr%3E%3C%2Fp%3E" data-md-url="http://www.blogger.com/blogger.g?blogID=3280550716273637581#editor/target=post;postID=7831142791700560024" id="markdown-here-wrapper-626200"&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;a name="more"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code class="language-r" style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;&lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;library&lt;/span&gt;(mxmortalitydb)
&lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;library&lt;/span&gt;(stringr)
&lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;library&lt;/span&gt;(plyr)
&lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;library&lt;/span&gt;(ggplot2)
&lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;library&lt;/span&gt;(grid)  &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## needed for arrow&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code class="language-r" style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;plotMetro &amp;lt;- &lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;function&lt;/span&gt;(metro.name, metro.areas) {
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Plot the homicide counts in a metro area or municipio metro.name - name of&lt;/span&gt;
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## the metro area to plot metro.areas - data frame containing a list of metro&lt;/span&gt;
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## areas in the same format as the metro.area dataframe from mxmortalitydb&lt;/span&gt;

    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## data.frame metro.areas contains the 2010 CONAPO metro areas&lt;/span&gt;
    df &amp;lt;- merge(injury.intent, metro.areas, by.x = c(&lt;span class="string" style="color: #dd1144;"&gt;"state_reg"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"mun_reg"&lt;/span&gt;), 
        by.y = c(&lt;span class="string" style="color: #dd1144;"&gt;"state_code"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"mun_code"&lt;/span&gt;))
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Yearly homicides in Mexico City, by state of registration&lt;/span&gt;
    df2 &amp;lt;- ddply(subset(df, metro_area == metro.name &amp;amp; intent.imputed == &lt;span class="string" style="color: #dd1144;"&gt;"Homicide"&lt;/span&gt;), 
        .(year_reg), summarise, count = length(state_reg))

    ggplot(df2, aes(year_reg, count)) + geom_line() + labs(title = str_c(&lt;span class="string" style="color: #dd1144;"&gt;"Homicides (plus deaths of unknown intent classified as homicide) in\n"&lt;/span&gt;, 
        metro.name)) + ylim(&lt;span class="number" style="color: #009999;"&gt;0&lt;/span&gt;, max(df2$count)) + ylab(&lt;span class="string" style="color: #dd1144;"&gt;"homicide count"&lt;/span&gt;) + xlab(&lt;span class="string" style="color: #dd1144;"&gt;"year of registration"&lt;/span&gt;) + 
        theme_bw()
}

plotChanges &amp;lt;- &lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;function&lt;/span&gt;(df, metro.areas, country.rate, years) {
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Plot of rates and trends df - injury.intent dataframr metro.areas - data&lt;/span&gt;
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## frame containing a list of metro areas in the same format as the&lt;/span&gt;
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## metro.area dataframe from mxmortalitydb country.rate - rate to show as a&lt;/span&gt;
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## gray dotted line years - start and end year to compare changes&lt;/span&gt;

    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Where the municipio where the death occurred is unknown use the municipio&lt;/span&gt;
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## where it was registered as place of occurrance&lt;/span&gt; &lt;/code&gt;&lt;code class="language-r" style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt; df[df$mun_occur_death == &lt;span class="number" style="color: #009999;"&gt;999&lt;/span&gt;, ]$mun_occur_death &amp;lt;- df[df$mun_occur_death == 
        &lt;span class="number" style="color: #009999;"&gt;999&lt;/span&gt;, ]$mun_reg

    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Counts of homicide by state and municipio&lt;/span&gt;
    df &amp;lt;- ddply(subset(df, year_reg %&lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;in&lt;/span&gt;% years &amp;amp; intent.imputed == &lt;span class="string" style="color: #dd1144;"&gt;"Homicide"&lt;/span&gt;), 
        .(state_occur_death, mun_occur_death, year_reg), summarise, count = length(state_reg))
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Merge the counts with our fake metro areas&lt;/span&gt;
    df &amp;lt;- merge(df, metro.areas, by.x = c(&lt;span class="string" style="color: #dd1144;"&gt;"state_occur_death"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"mun_occur_death"&lt;/span&gt;), 
        by.y = c(&lt;span class="string" style="color: #dd1144;"&gt;"state_code"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"mun_code"&lt;/span&gt;))
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Now get the counts by metro area (which may contain more than one&lt;/span&gt;
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## municipio)&lt;/span&gt;
    df &amp;lt;- ddply(df, .(metro_area, year_reg), summarise, count = sum(count), 
        population = sum(mun_population_2010), rate = count/population * &lt;span class="number" style="color: #009999;"&gt;10&lt;/span&gt;^&lt;span class="number" style="color: #009999;"&gt;5&lt;/span&gt;)
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## We are only interesed if the metro area at some time had a homicide rate&lt;/span&gt;
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## of at least 15&lt;/span&gt;
    df &amp;lt;- subset(df, metro_area %&lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;in&lt;/span&gt;% subset(df, rate &amp;gt; &lt;span class="number" style="color: #009999;"&gt;15&lt;/span&gt;)$metro_area)
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Make sure the dataframe is ordered by metro and year&lt;/span&gt;
    df &amp;lt;- df[order(df$metro_area, df$year_reg), ]
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Order the chart by homicide rate in 2012&lt;/span&gt;
    df$metro_area &amp;lt;- reorder(df$metro_area, df$rate, &lt;span class="keyword" style="color: #333333; font-weight: bold;"&gt;function&lt;/span&gt;(x) x[[&lt;span class="number" style="color: #009999;"&gt;2&lt;/span&gt;]])
    &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Data frame for the arrow structure&lt;/span&gt;
    arrows &amp;lt;- ddply(df, .(metro_area), summarise, start = rate[&lt;span class="number" style="color: #009999;"&gt;1&lt;/span&gt;], end = rate[&lt;span class="number" style="color: #009999;"&gt;2&lt;/span&gt;], 
        metro_area = metro_area[&lt;span class="number" style="color: #009999;"&gt;1&lt;/span&gt;], change = ifelse(rate[&lt;span class="number" style="color: #009999;"&gt;1&lt;/span&gt;] &amp;gt;= rate[&lt;span class="number" style="color: #009999;"&gt;2&lt;/span&gt;], &lt;span class="string" style="color: #dd1144;"&gt;"decrease"&lt;/span&gt;, 
            &lt;span class="string" style="color: #dd1144;"&gt;"increase"&lt;/span&gt;))

    ggplot(df, aes(rate, metro_area, group = as.factor(year_reg), color = as.factor(year_reg))) + 
        geom_point(aes(size = log(count))) + labs(title = &lt;span class="string" style="color: #dd1144;"&gt;"Homicide (plus deaths of unknown intent classified as homicide) rates and trends"&lt;/span&gt;) + 
        scale_size(&lt;span class="string" style="color: #dd1144;"&gt;"number\nof\nhomicides"&lt;/span&gt;, breaks = c(log(&lt;span class="number" style="color: #009999;"&gt;50&lt;/span&gt;), log(&lt;span class="number" style="color: #009999;"&gt;500&lt;/span&gt;), log(&lt;span class="number" style="color: #009999;"&gt;3000&lt;/span&gt;)), 
            labels = c(&lt;span class="number" style="color: #009999;"&gt;50&lt;/span&gt;, &lt;span class="number" style="color: #009999;"&gt;500&lt;/span&gt;, &lt;span class="number" style="color: #009999;"&gt;3000&lt;/span&gt;)) + geom_segment(data = arrows, aes(x = start, 
        y = metro_area, xend = end, yend = metro_area, group = change, color = change), 
        arrow = arrow(length = unit(&lt;span class="number" style="color: #009999;"&gt;0.3&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"cm"&lt;/span&gt;)), alpha = &lt;span class="number" style="color: #009999;"&gt;0.8&lt;/span&gt;) + scale_color_manual(&lt;span class="string" style="color: #dd1144;"&gt;"year\nand\ntrend"&lt;/span&gt;, 
        values = c(&lt;span class="string" style="color: #dd1144;"&gt;"gray"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"black"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"blue"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"red"&lt;/span&gt;)) + ylab(&lt;span class="string" style="color: #dd1144;"&gt;"metro area or municipio"&lt;/span&gt;) + 
        xlab(&lt;span class="string" style="color: #dd1144;"&gt;"homicide rate"&lt;/span&gt;) + &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;# scale_x_log10()+&lt;/span&gt;
    geom_vline(xintercept = country.rate, linetype = &lt;span class="number" style="color: #009999;"&gt;2&lt;/span&gt;, color = &lt;span class="string" style="color: #dd1144;"&gt;"#666666"&lt;/span&gt;) + 
        annotate(&lt;span class="string" style="color: #dd1144;"&gt;"text"&lt;/span&gt;, y = &lt;span class="string" style="color: #dd1144;"&gt;"Tapachula"&lt;/span&gt;, x = &lt;span class="number" style="color: #009999;"&gt;25&lt;/span&gt;, label = &lt;span class="string" style="color: #dd1144;"&gt;"country\naverage\n2012"&lt;/span&gt;, 
            hjust = -&lt;span class="number" style="color: #009999;"&gt;0.1&lt;/span&gt;, size = &lt;span class="number" style="color: #009999;"&gt;4&lt;/span&gt;, color = &lt;span class="string" style="color: #dd1144;"&gt;"#666666"&lt;/span&gt;) + theme_bw()
}&lt;/code&gt;&lt;/pre&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code class="language-r" style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;&lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## Let's treat the big municipalities which are not part of a metro area as&lt;/span&gt;
&lt;span class="comment" style="color: #999988; font-style: italic;"&gt;## if they were one rename big.municipios to merge with metro.areas&lt;/span&gt;
big.municipios2 &amp;lt;- big.municipios
names(big.municipios2) &amp;lt;- c(&lt;span class="string" style="color: #dd1144;"&gt;"state_code"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"mun_code"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"mun_population_2010"&lt;/span&gt;, 
    &lt;span class="string" style="color: #dd1144;"&gt;"metro_area"&lt;/span&gt;)
metro.areas.fake &amp;lt;- rbind.fill(metro.areas, big.municipios2)&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
Changes from 2011 to 2012 and from the year before the drug war was declared to 2012:&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code class="language-r" style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;plotChanges(injury.intent, metro.areas.fake, &lt;span class="number" style="color: #009999;"&gt;24.5&lt;/span&gt;, c(&lt;span class="number" style="color: #009999;"&gt;2011&lt;/span&gt;, &lt;span class="number" style="color: #009999;"&gt;2012&lt;/span&gt;))&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-Ss28AOrxjlM_UrEPajK4ieI_AAAAAAAAGfo_Y7-ccrj1tFk_s1600_change2011-2012.png" imageanchor="1" &gt;&lt;img border="0" height="640" src="/images/blogger_images/1.bp.blogspot.com_-Ss28AOrxjlM_UrEPajK4ieI_AAAAAAAAGfo_Y7-ccrj1tFk_s640_change2011-2012.png" width="532"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;code class="language-r" style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;plotChanges(injury.intent, metro.areas.fake, &lt;span class="number" style="color: #009999;"&gt;24.5&lt;/span&gt;, c(&lt;span class="number" style="color: #009999;"&gt;2006&lt;/span&gt;, &lt;span class="number" style="color: #009999;"&gt;2012&lt;/span&gt;))&lt;/code&gt; &lt;br/&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-Mz9Tm4MI25w_UrEPn32KnZI_AAAAAAAAGfs_JO39hf5Yt94_s1600_change2006-2012.png" imageanchor="1" &gt;&lt;img border="0" height="640" src="/images/blogger_images/3.bp.blogspot.com_-Mz9Tm4MI25w_UrEPn32KnZI_AAAAAAAAGfs_JO39hf5Yt94_s640_change2006-2012.png" width="532"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
Interesting that Tijuana had about the same homicide rate in 2012 as in 2006. The rest of the violent metro areas/large municipios which saw decreases are in Michoacán. Sadly, it doesn’t look like pattern will hold in 2013 (according to &lt;a href="https://elcri.men/"&gt;crimenmexico&lt;/a&gt; Michoacán is experiencing a surge of violence and is at a maximum)&lt;br/&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
Do note that the charts were made using the 2010 population according to the &lt;span class="caps"&gt;CONAPO&lt;/span&gt; that comes with mxmortalitydb, so homicides in 2012 were overestimated by a little bit and underestimated by a little bit in 2006. Also rather than using the raw homicide numbers I adjusted them by classifying deaths of unknown intent.&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code class="language-r" style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;ll &amp;lt;- list(&lt;span class="string" style="color: #dd1144;"&gt;"Acapulco"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Nuevo Laredo"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"La Laguna"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Chihuahua"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Tecomán"&lt;/span&gt;, 
    &lt;span class="string" style="color: #dd1144;"&gt;"Juárez"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Culiacán"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Victoria"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Hidalgo del Parral"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Zihuatanejo de Azueta"&lt;/span&gt;, 
    &lt;span class="string" style="color: #dd1144;"&gt;"El Mante"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Ciudad Valles"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Ciudad Valles"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Durango"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Cuernavaca"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Zacatecas-Guadalupe"&lt;/span&gt;, 
    &lt;span class="string" style="color: #dd1144;"&gt;"Monterrey"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Piedras Negras"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Mazatlán"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Veracruz"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Tijuana"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Guadalajara"&lt;/span&gt;, 
    &lt;span class="string" style="color: #dd1144;"&gt;"Tepic"&lt;/span&gt;, &lt;span class="string" style="color: #dd1144;"&gt;"Coatzacoalcos"&lt;/span&gt;)
names(ll) &amp;lt;- ll  &lt;span class="comment" style="color: #999988; font-style: italic;"&gt;# make lapply print the names of the metro areas&lt;/span&gt;
lapply(ll, plotMetro, metro.areas.fake)&lt;/code&gt;&lt;/pre&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## $Acapulco&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-ORDmlTmq2DA_UrEP6ZzOGtI_AAAAAAAAGf0_Ti1vlfehsHc_s1600_unnamed-chunk-51.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/4.bp.blogspot.com_-ORDmlTmq2DA_UrEP6ZzOGtI_AAAAAAAAGf0_Ti1vlfehsHc_s320_unnamed-chunk-51.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $`Nuevo Laredo`&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-FmTVpSWBlhU_UrEQIoEoSMI_AAAAAAAAGf8_FmzSwJhbwB8_s1600_unnamed-chunk-52.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/1.bp.blogspot.com_-FmTVpSWBlhU_UrEQIoEoSMI_AAAAAAAAGf8_FmzSwJhbwB8_s320_unnamed-chunk-52.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $`La Laguna`&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-iQkmyWyY_YM_UrEQN4irbMI_AAAAAAAAGgE_TiE9VySgQs8_s1600_unnamed-chunk-53.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/3.bp.blogspot.com_-iQkmyWyY_YM_UrEQN4irbMI_AAAAAAAAGgE_TiE9VySgQs8_s320_unnamed-chunk-53.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Chihuahua&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-cEQxPQmT0j8_UrEQZexn8XI_AAAAAAAAGgU_JxTNa-HXx5E_s1600_unnamed-chunk-54.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/1.bp.blogspot.com_-cEQxPQmT0j8_UrEQZexn8XI_AAAAAAAAGgU_JxTNa-HXx5E_s320_unnamed-chunk-54.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Tecomán&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-i1JLpESwryM_UrEQft3L8wI_AAAAAAAAGgc_EtOlw09cITk_s1600_unnamed-chunk-55.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/3.bp.blogspot.com_-i1JLpESwryM_UrEQft3L8wI_AAAAAAAAGgc_EtOlw09cITk_s320_unnamed-chunk-55.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Juárez&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-HnhZbgMrNEQ_UrEQmwVfq0I_AAAAAAAAGgk_K5ZUk1x5YTg_s1600_unnamed-chunk-56.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/4.bp.blogspot.com_-HnhZbgMrNEQ_UrEQmwVfq0I_AAAAAAAAGgk_K5ZUk1x5YTg_s320_unnamed-chunk-56.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Culiacán&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-DS8jzxkJzZo_UrEQvYsMw_I_AAAAAAAAGgs_5HVJnjR2jSY_s1600_unnamed-chunk-57.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/2.bp.blogspot.com_-DS8jzxkJzZo_UrEQvYsMw_I_AAAAAAAAGgs_5HVJnjR2jSY_s320_unnamed-chunk-57.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Victoria&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-0K1l1w8bcqg_UrEQ0Ryt1NI_AAAAAAAAGg0_wgVzYuZmpJE_s1600_unnamed-chunk-58.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/3.bp.blogspot.com_-0K1l1w8bcqg_UrEQ0Ryt1NI_AAAAAAAAGg0_wgVzYuZmpJE_s320_unnamed-chunk-58.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $`Hidalgo del Parral`&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-pAQpdWykc5M_UrEQ6nWprWI_AAAAAAAAGg8_d6U9aQrRqec_s1600_unnamed-chunk-59.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/1.bp.blogspot.com_-pAQpdWykc5M_UrEQ6nWprWI_AAAAAAAAGg8_d6U9aQrRqec_s320_unnamed-chunk-59.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $`Zihuatanejo de Azueta`&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-ZpMr2Blfn28_UrERBIOUK1I_AAAAAAAAGhE__bi4Cl056VU_s1600_unnamed-chunk-510.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/1.bp.blogspot.com_-ZpMr2Blfn28_UrERBIOUK1I_AAAAAAAAGhE__bi4Cl056VU_s320_unnamed-chunk-510.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $`El Mante`&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-2KdXpex_xPs_UrERHAuSMaI_AAAAAAAAGhM_YvpV6HxNH-o_s1600_unnamed-chunk-511.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/1.bp.blogspot.com_-2KdXpex_xPs_UrERHAuSMaI_AAAAAAAAGhM_YvpV6HxNH-o_s320_unnamed-chunk-511.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $`Ciudad Valles`&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-y7MR64HVGhw_UrERNawfTTI_AAAAAAAAGhU_Uk_2hpQRng4_s1600_unnamed-chunk-513.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/1.bp.blogspot.com_-y7MR64HVGhw_UrERNawfTTI_AAAAAAAAGhU_Uk_2hpQRng4_s320_unnamed-chunk-513.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Durango&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-rUaryQDdEUE_UrERcEFv6NI_AAAAAAAAGhc_O6oBw2TGG9I_s1600_unnamed-chunk-514.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/1.bp.blogspot.com_-rUaryQDdEUE_UrERcEFv6NI_AAAAAAAAGhc_O6oBw2TGG9I_s320_unnamed-chunk-514.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Cuernavaca&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-JPQ3Si0UIQ8_UrERiAJpFwI_AAAAAAAAGhk_1TpSCjwjMrQ_s1600_unnamed-chunk-515.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/4.bp.blogspot.com_-JPQ3Si0UIQ8_UrERiAJpFwI_AAAAAAAAGhk_1TpSCjwjMrQ_s320_unnamed-chunk-515.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $`Zacatecas-Guadalupe`&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-x0U6mDkaeOk_UrERndD-rKI_AAAAAAAAGhs_WHJ184IjsUc_s1600_unnamed-chunk-516.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/4.bp.blogspot.com_-x0U6mDkaeOk_UrERndD-rKI_AAAAAAAAGhs_WHJ184IjsUc_s320_unnamed-chunk-516.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Monterrey&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-1qycVSFcW_M_UrERspBTJDI_AAAAAAAAGh0_wOV_TLpQv_A_s1600_unnamed-chunk-517.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/3.bp.blogspot.com_-1qycVSFcW_M_UrERspBTJDI_AAAAAAAAGh0_wOV_TLpQv_A_s320_unnamed-chunk-517.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $`Piedras Negras`&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-yJ7xv35EWJE_UrER4Y_S0TI_AAAAAAAAGiE_3cJl-g9rWEY_s1600_unnamed-chunk-518.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/4.bp.blogspot.com_-yJ7xv35EWJE_UrER4Y_S0TI_AAAAAAAAGiE_3cJl-g9rWEY_s320_unnamed-chunk-518.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Mazatlán&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-oWaQOvtrN6o_UrER-G4qUtI_AAAAAAAAGiM_HMuwjBsREbQ_s1600_unnamed-chunk-519.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/4.bp.blogspot.com_-oWaQOvtrN6o_UrER-G4qUtI_AAAAAAAAGiM_HMuwjBsREbQ_s320_unnamed-chunk-519.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Veracruz&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-dJrHpDSmWsI_UrESHa_v7oI_AAAAAAAAGiU_2rCUKULsBpA_s1600_unnamed-chunk-520.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/4.bp.blogspot.com_-dJrHpDSmWsI_UrESHa_v7oI_AAAAAAAAGiU_2rCUKULsBpA_s320_unnamed-chunk-520.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Tijuana&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-CrnEmATGcww_UrESM2wibxI_AAAAAAAAGic_SfbfxrxwWjE_s1600_unnamed-chunk-521.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/2.bp.blogspot.com_-CrnEmATGcww_UrESM2wibxI_AAAAAAAAGic_SfbfxrxwWjE_s320_unnamed-chunk-521.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Guadalajara&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-IK_HNkEVrRA_UrESSaQL5nI_AAAAAAAAGik_noY_GC3-aVE_s1600_unnamed-chunk-522.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/2.bp.blogspot.com_-IK_HNkEVrRA_UrESSaQL5nI_AAAAAAAAGik_noY_GC3-aVE_s320_unnamed-chunk-522.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Tepic&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-EARaW-4KLCw_UrESXur4VZI_AAAAAAAAGis_2LLNVcnIf5s_s1600_unnamed-chunk-523.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/1.bp.blogspot.com_-EARaW-4KLCw_UrESXur4VZI_AAAAAAAAGis_2LLNVcnIf5s_s320_unnamed-chunk-523.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre style="font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; font-size: 1em; line-height: 1.2em; margin: 1.2em 0px;"&gt;&lt;code style="background-color: #f8f8f8; background: none repeat scroll 0% 0% rgb(248, 248, 255); border-radius: 3px; border-radius: 3px; border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(234, 234, 234); color: #333333; display: block ! important; display: block; display: inline; font-family: Consolas,Inconsolata,Courier,monospace; font-size: 0.85em; margin: 0px 0.15em; overflow: auto; padding: 0.5em 0.7em; padding: 0.5em; padding: 0px 0.3em; white-space: pre-wrap; white-space: pre;"&gt;## 
## $Coatzacoalcos&lt;/code&gt;&lt;/pre&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://www.blogger.com/blogger.g?blogID=3280550716273637581" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="/images/blogger_images/3.bp.blogspot.com_-u1hoCv0_6mY_UrESdDuUjuI_AAAAAAAAGi0_FWmreSa2Es0_s1600_unnamed-chunk-524.png" imageanchor="1" &gt;&lt;img border="0" height="274" src="/images/blogger_images/3.bp.blogspot.com_-u1hoCv0_6mY_UrESdDuUjuI_AAAAAAAAGi0_FWmreSa2Es0_s320_unnamed-chunk-524.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="margin: 1.2em 0px ! important;"&gt;
Check out the &lt;a href="https://gist.github.com/diegovalle/7998868"&gt;source code&lt;/a&gt; as an R markdown file.&lt;/div&gt;
&lt;/div&gt;

&lt;div style="clear: both;"&gt;&lt;/div&gt;

&lt;/div&gt;</summary><category term="drug-war"></category></entry><entry><title>An R package with all injury intent deaths registered in Mexico 2004-2012</title><link href="https://blog.diegovalle.net/2013/12/r-package-mexican-homicides.html" rel="alternate"></link><updated>2013-12-17T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-12-17:2013/12/r-package-mexican-homicides.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
This is a data only &lt;a href="https://github.com/diegovalle/mxmortalitydb"&gt;package&lt;/a&gt; containing all injury intent deaths (accidents, suicides, homicides, legal interventions, and deaths of unspecified intent) registered by the &lt;span class="caps"&gt;SSA&lt;/span&gt;/&lt;span class="caps"&gt;INEGI&lt;/span&gt; from 2004 to 2012. The data source for the database is the &lt;a href="http://www.inegi.org.mx/est/contenidos/proyectos/registros/vitales/mortalidad/default.aspx"&gt;&lt;span class="caps"&gt;INEGI&lt;/span&gt;&lt;/a&gt;. In addition the data was coded with the Injury Mortality Matrix provided by the &lt;a href="http://www.cdc.gov/nchs/data/ice/icd10_transcode.pdf"&gt;&lt;span class="caps"&gt;CDC&lt;/span&gt;&lt;/a&gt;.&lt;br/&gt;
&lt;br/&gt;
The package is only available from github, to install:&lt;br/&gt;
&lt;br/&gt;
&lt;span style='font-family: "Courier New",Courier,monospace;'&gt;devtools::install_github(&amp;#8220;diegovalle/mxmortalitydb&amp;#8221;)&lt;/span&gt;&lt;br/&gt;
&lt;br/&gt;
be sure to visit its &lt;a href="https://github.com/diegovalle/mxmortalitydb"&gt;github&lt;/a&gt; page to find out more!
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="drug-war"></category><category term="r"></category></entry><entry><title>Continuously updated crime information</title><link href="https://blog.diegovalle.net/2013/09/continuously-updated-crime-information.html" rel="alternate"></link><updated>2013-09-30T00:00:00+02:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-09-30:2013/09/continuously-updated-crime-information.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-6ItLjBMaZ_k_Uki7ibzHHNI_AAAAAAAAGdw_4RkkPSvKglg_s1600_download.png" imageanchor="1" &gt;&lt;img border="0" height="265" src="/images/blogger_images/4.bp.blogspot.com_-6ItLjBMaZ_k_Uki7ibzHHNI_AAAAAAAAGdw_4RkkPSvKglg_s400_download.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
I&amp;#8217;ve put together a simple website to keep people up to date on the latest crime information. The site polls the &lt;a href="http://www.secretariadoejecutivo.gob.mx/"&gt;&lt;span class="caps"&gt;SESNSP&lt;/span&gt; website&lt;/a&gt; many times a day to see if there is new crime information, and if there is, it cleans up the data and makes it available for download.&lt;br/&gt;
&lt;br/&gt;
&lt;a href="https://elcri.men/en/data.html"&gt;https://elcri.men/en/csv/&lt;/a&gt; (Engish)&lt;br/&gt;
&lt;a href="https://elcri.men/es/data.html"&gt;https://elcri.men/es/csv/&lt;/a&gt; (Spanish)&lt;br/&gt;
&lt;br/&gt;
There&amp;#8217;s also a &lt;a href="https://elcri.men/"&gt;simple report&lt;/a&gt; based on the data. In the future I hope to also include homicide data from the &lt;span class="caps"&gt;INEGI&lt;/span&gt;,&lt;strike&gt; and municipio population from the &lt;span class="caps"&gt;CONAPO&lt;/span&gt;&lt;/strike&gt; (the data now includes municipio population and information for all state level and federal crimes), so the data is bound to change at some point. If you&amp;#8217;d like to see another crime or municipio added to the data or report feel free to contact me.&lt;br/&gt;
&lt;br/&gt;
For major updates or announcements &lt;a href="https://twitter.com/diegovalle"&gt;follow me on twitter&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; Keep in mind that the numbers refer to police reports and not number of victims.
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="drug-war"></category></entry><entry><title>State population datasets 1990-2030</title><link href="https://blog.diegovalle.net/2013/08/state-population-datasets-1990-2030.html" rel="alternate"></link><updated>2013-08-28T00:00:00+02:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-08-28:2013/08/state-population-datasets-1990-2030.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div&gt;
&lt;br/&gt;
Cleaned up Mexican &lt;a href="https://github.com/diegovalle/conapo-2010"&gt;population estimates&lt;/a&gt; by five-year age groups and gender 1990-2030 (mid-year) at the state level:&lt;/div&gt;
&lt;div&gt;
&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/diegovalle/conapo-2010/blob/master/clean-data/state-population.csv"&gt;Total population by&amp;nbsp;sex&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/diegovalle/conapo-2010/blob/master/clean-data/state-population-age-groups.csv"&gt;Total population by sex and five-year age&amp;nbsp;groups&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br/&gt;
Original data from the &lt;a href="http://www.conapo.gob.mx/es/CONAPO/Proyecciones"&gt;&lt;span class="caps"&gt;CONAPO&lt;/span&gt; website&lt;/a&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="python"></category></entry><entry><title>The best high schools in Mexico City (COMIPEMS analysis)</title><link href="https://blog.diegovalle.net/2013/07/the-best-high-schools-in-mexico-city.html" rel="alternate"></link><updated>2013-07-31T00:00:00+02:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-07-31:2013/07/the-best-high-schools-in-mexico-city.html</id><summary type="html">&lt;div class='post-body entry-content' itemprop='articleBody'&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://www.diegovalle.net/maps/comipems" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="/images/blogger_images/4.bp.blogspot.com_-n2e2OLEY920_UfXYHXlmURI_AAAAAAAAGYk__PABkR2okOE_s400_Screenshot+-+07282013+-+09-29-42+PM.png" width="390" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Click on the map to visit the &lt;a href="http://www.diegovalle.net/maps/comipems"&gt;interactive version&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
In Mexico City all ninth graders who want to enroll in a public high school (grades 10 trough 12 in Mexico) must take an exam called &lt;span class="caps"&gt;COMIPEMS&lt;/span&gt;. In order to ensure students are &lt;a href="/images/blogger_images/1.bp.blogspot.com_-6VS5xm2E8fY_UfwplznhwMI_AAAAAAAAGcM_DzHwg2Ll0bU_s1600_gale-shapley.png"&gt;assigned in a fair way&lt;/a&gt; to a school of their choice the following steps are taken:&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Before the test students must rank up to 20 schools in order of&amp;nbsp;preference.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;All high schools&amp;nbsp;rank the students based&amp;nbsp;solely&amp;nbsp;on the score each students gets in the &lt;span class="caps"&gt;COMIPEMS&lt;/span&gt; exam, preferring students who score higher (no allowance is made for diﬀerent&amp;nbsp;skill categories, well, except for the &lt;span class="caps"&gt;UNAM&lt;/span&gt; and &lt;span class="caps"&gt;IPN&lt;/span&gt; which also requires a &lt;span class="caps"&gt;GPA&lt;/span&gt; of at least&amp;nbsp;70%).&amp;nbsp;&lt;/li&gt;
&lt;li&gt;After the test are graded a computer orders the students by test score and proposes to match each student with his first school choice. If the student has the required &lt;span class="caps"&gt;GPA&lt;/span&gt; and the school he proposed to hasn&amp;#8217;t filled up then he is accepted. In a second step each student who has been rejected proposes to their next school choice. Each school that still has free space then considers the students until they reach capacity and so on until all student choices are&amp;nbsp;exhausted.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
There isn&amp;#8217;t a lot of information on how the &lt;span class="caps"&gt;COMIPEMS&lt;/span&gt; handles ties, &lt;strike&gt;but if they use a random algorithm to break ties&lt;/strike&gt;&amp;nbsp;at least in 2001 they used middle school &lt;span class="caps"&gt;GPA&lt;/span&gt; to break ties, and if we ignore the limited number of schools students are allowed to list, then &lt;span class="caps"&gt;COMIPEMS&lt;/span&gt; would be equivalent to a student-optimal version of &lt;a href="https://en.wikipedia.org/wiki/Stable_marriage_problem"&gt;Gale-Shapley&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
In 2013 out of 310,163 student who registered for the test, 280,096 showed up, out of those, 33,695 (12.0%) were not admitted to any school because of the limited number of options they specified. But they can always apply to one of the low quality schools with excess capacity. It would probably be a good idea to encourage students to submit long lists that contain less preferred but still acceptable options.&lt;br /&gt;
&lt;br /&gt;
In fact, the advice given at the &lt;span class="caps"&gt;COMIPEMS&lt;/span&gt; website is wrong (if indeed the admission process follows Gale-Shapley) since it specifically warns students to limit their options in the &lt;span class="caps"&gt;FAQ&lt;/span&gt;:&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
What is the maximum allowed number of highly demanded schools a student can list?&lt;br /&gt;
There isn&amp;#8217;t a maximum number of options; however, it is recommended to choose a maximum a four, this is because highly selective schools can fill up quickly and it is very unlikely that you&amp;#8217;ll be assigned a place after your fourth option.&lt;br /&gt;
&lt;span style="color: #cccccc;"&gt;&lt;i&gt;&amp;#191;Cuál es el número máximo de opciones de alta demanda que se puede seleccionar?&lt;/i&gt;&lt;i&gt;No existe un número máximo; sin embargo, se recomienda elegir un máximo de cuatro, debido a que estos planteles llenan rápidamente sus lugares disponibles y es poco probable quedar asignado en una opción de alta demanda que se selecciona después de la cuarta preferencia.&lt;/i&gt;&lt;/span&gt;&lt;/blockquote&gt;
Under Gale-Shapley it is always optimal to list your true order of preferences regardless of whether your options are likely fill up. If Prepa 6 is your true fifth choice then that&amp;#8217;s what you should list it as, and if you prefer the &lt;span class="caps"&gt;CONALEP&lt;/span&gt; Neza to not studying high school then that&amp;#8217;s what you should list as you twentieth choice.&lt;br /&gt;
&lt;br /&gt;
It would also probably be a good idea to allow schools to rank students based on different skills, some schools specialize in math, other in verbal skills. Perhaps even give priority to students with a sibling already attending one of their preferred options to make life easier for the parents.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-a-kZU_nm4MY_UfcBY3eGGkI_AAAAAAAAGY0_YypW_NR9InU_s1600_histogram.png" imageanchor="1" &gt;&lt;img border="0" height="250" src="/images/blogger_images/1.bp.blogspot.com_-a-kZU_nm4MY_UfcBY3eGGkI_AAAAAAAAGY0_YypW_NR9InU_s400_histogram.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-jQWWKSXoQaM_UflNv2NF9HI_AAAAAAAAGb8_4bzv1yOkO7g_s1600_trends.png" imageanchor="1" &gt;&lt;img border="0" height="250" src="/images/blogger_images/4.bp.blogspot.com_-jQWWKSXoQaM_UflNv2NF9HI_AAAAAAAAGb8_4bzv1yOkO7g_s400_trends.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 1em;"&gt;
&lt;br /&gt;
For some reason the 2013 scores went up compared to 2011. Even when taking into account that nowadays high school is mandatory and everyone is guaranteed a place no matter how low their scores. With a guaranteed spot I can see how the big discontinuity at score 31 would disappear in 2013 with some students slacking off since they are now guaranteed a place, but there was also an increase in the right side of the curve, so students this year were overall smarter (an improvement of 7 points is a lot).&lt;/div&gt;

&lt;b&gt;2013&lt;/b&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Min.&lt;/th&gt;
&lt;th&gt;1st Qu.&lt;/th&gt;
&lt;th&gt;Median&lt;/th&gt;
&lt;th&gt;Mean&lt;/th&gt;
&lt;th&gt;3rd Qu.&lt;/th&gt;
&lt;th&gt;Max.&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2.00&lt;/td&gt;
&lt;td&gt;55.00&lt;/td&gt;
&lt;td&gt;70.00&lt;/td&gt;
&lt;td&gt;70.51&lt;/td&gt;
&lt;td&gt;86.00&lt;/td&gt;
&lt;td&gt;127.00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;


&lt;br/&gt;

&lt;b&gt;2011&lt;/b&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Min.&lt;/th&gt;
&lt;th&gt;1st Qu.&lt;/th&gt;
&lt;th&gt;Median&lt;/th&gt;
&lt;th&gt;Mean&lt;/th&gt;
&lt;th&gt;3rd Qu.&lt;/th&gt;
&lt;th&gt;Max.&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;6.00&lt;/td&gt;
&lt;td&gt;49.00&lt;/td&gt;
&lt;td&gt;63.00&lt;/td&gt;
&lt;td&gt;65.32 &lt;/td&gt;
&lt;td&gt; 80.00&lt;/td&gt;
&lt;td&gt;127.00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
Both the 2011 and 2013 tests had a standard deviation of 20.4&lt;br /&gt;
&lt;br /&gt;
The best public high schools in Mexico City:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-16guH8n7tFM_Ufe1HBVaYnI_AAAAAAAAGak_Pl3qJnzR8pU_s1600_top20.png" imageanchor="1" &gt;&lt;img border="0" height="183" src="/images/blogger_images/2.bp.blogspot.com_-16guH8n7tFM_Ufe1HBVaYnI_AAAAAAAAGak_Pl3qJnzR8pU_s400_top20.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
With two exceptions, the top spots are schools run by the &lt;span class="caps"&gt;UNAM&lt;/span&gt; or the &lt;span class="caps"&gt;IPN&lt;/span&gt;. I wonder what the Preparatoria Oficial 99 is doing to attract so many smart students? If you look at the &lt;a href="http://www.diegovalle.net/maps/comipems"&gt;map&lt;/a&gt; the rest of the zone it is located in (Coacalco) has quite low scores.&lt;/div&gt;

&lt;p&gt;&lt;/div&gt;
In Mexico, high schools can be of three types: &lt;i&gt;Bachillerato Profesional&lt;/i&gt; which is just like regular high school, you take courses in math, literature, and so on; then there is the&amp;nbsp;&lt;i&gt;Bachillerato Tecnológico &lt;/i&gt;where in addition to taking the normal high school subjects the students end up taking extra classes to get a certificate as an administrative assistant, computer technician and so on; finally, there is also the &lt;i&gt;Carrera Técnica&lt;/i&gt; where no regular high school classes are taken and the students just end up with their certificate in graphic design or whatever. That big bump in the &lt;i&gt;Bachillerato Tecnológico&lt;/i&gt;&amp;nbsp;scores is due to the CECyTs run by the &lt;span class="caps"&gt;IPN&lt;/span&gt; which tend to be quite good.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-L9KHK5bNEJY_UfcFMRmtodI_AAAAAAAAGZk_dfxEjJL-cTM_s1600_histogram-type.png" imageanchor="1" &gt;&lt;img border="0" height="200" src="/images/blogger_images/1.bp.blogspot.com_-L9KHK5bNEJY_UfcFMRmtodI_AAAAAAAAGZk_dfxEjJL-cTM_s320_histogram-type.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
By comparing the histograms of scores of the State of Mexico and the Federal District it looks like the &lt;span class="caps"&gt;DF&lt;/span&gt; is stealing all the smart people from the State of Mexico. Sadly, there just &lt;a href="http://www.diegovalle.net/maps/comipems"&gt;aren&amp;#8217;t many good schools &lt;/a&gt;in the state of Mexico, and students have to travel all the way to the Federal District to get an education in accordance with their abilities.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-LbFXPZfnJhI_UfcFKAtJakI_AAAAAAAAGZg_2eJWxooaxFg_s1600_histogram-state.png" imageanchor="1" &gt;&lt;img border="0" height="200" src="/images/blogger_images/3.bp.blogspot.com_-LbFXPZfnJhI_UfcFKAtJakI_AAAAAAAAGZg_2eJWxooaxFg_s320_histogram-state.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
By university affiliation&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_--f2QmZU3AYA_UfcFXW9eNpI_AAAAAAAAGZs_pUEsgbOU1Ow_s1600_histogram-unam-poli.png" imageanchor="1" &gt;&lt;img border="0" height="200" src="/images/blogger_images/3.bp.blogspot.com_--f2QmZU3AYA_UfcFXW9eNpI_AAAAAAAAGZs_pUEsgbOU1Ow_s320_histogram-unam-poli.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-nJZqxJ_1hHU_UfcHPqXuV5I_AAAAAAAAGZ8_uhIkzdOuIxk_s1600_boxplot-unam-poli.png" imageanchor="1" &gt;&lt;img border="0" height="250" src="/images/blogger_images/3.bp.blogspot.com_-nJZqxJ_1hHU_UfcHPqXuV5I_AAAAAAAAGZ8_uhIkzdOuIxk_s400_boxplot-unam-poli.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
I wonder why the Preparatoria Agrícola Chapingo didn&amp;#8217;t take part in &lt;span class="caps"&gt;COMIPEMS&lt;/span&gt; (it is considered quite good)?&lt;br /&gt;
&lt;br /&gt;
We can also investigate whether there is a relationship between &lt;span class="caps"&gt;ENLACE&lt;/span&gt;&amp;nbsp;&lt;span style="background-color: white; color: #444444; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;"&gt;&amp;#8212;&lt;/span&gt;a test given to students in their last year of high school that divides them into insufficient, elementary, good and excellent based on their level of knowledge&lt;span style="background-color: white; color: #444444; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;"&gt;&amp;#8212;&lt;/span&gt;&amp;nbsp;and &lt;span class="caps"&gt;COMIPEMS&lt;/span&gt; quantiles (the black lines are loess):&lt;/div&gt;
&lt;script src="//www.diegovalle.net/maps/comipems/polychart2.standalone.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;
&lt;div class="rChart polycharts" id="chart16e23a17c2d5"&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;script src="/js/comipems1.js"&gt;&lt;/script&gt;&lt;br /&gt;
Note that the CECyT 9s low percentage in the &amp;#8216;good&amp;#8217; category is due to its high proportion of &amp;#8216;excellent&amp;#8217; students as seen in the chart below (don&amp;#8217;t forget to hover over the dots):&lt;br /&gt;
&lt;br /&gt;
&lt;div class="rChart polycharts" id="chart16e241942961"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;script src="/js/comipems2.js"&gt;&lt;/script&gt;&lt;br /&gt;
Bonus points if you guess which CONALEPs are cheating on their &lt;span class="caps"&gt;ENLACE&lt;/span&gt; tests!&lt;br /&gt;
&lt;br /&gt;
When&amp;nbsp;&lt;i&gt;&lt;strike&gt;&lt;a href="http://eldeforma.com/2012/05/24/3-adolescentes-de-apellido-compuesto-posan-para-la-seccion-gente-del-periodico-reforma/"&gt;El Diario Oficial de los Mirreys&lt;/a&gt;&lt;/strike&gt;&amp;nbsp;Reforma&lt;/i&gt;&amp;nbsp;ran a special section on the&amp;nbsp;&lt;a href="http://www.administrativosuin.mx/corporativo/documentos/mejores%20prepas%202013.pdf"&gt;best high schools in Mexico City&amp;nbsp;&lt;/a&gt;it made sure to exclude public schools from its rankings. Using &lt;span class="caps"&gt;ENLACE&lt;/span&gt; it is pretty easy to see how public schools stack up to private schools:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-ID38Lu1QiF4_UffCr6WnFSI_AAAAAAAAGa8_iMD_3Z_19jo_s1600_top-enlace-df.png" imageanchor="1" &gt;&lt;img border="0" height="183" src="/images/blogger_images/2.bp.blogspot.com_-ID38Lu1QiF4_UffCr6WnFSI_AAAAAAAAGa8_iMD_3Z_19jo_s400_top-enlace-df.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
Cleary the high schools run by &lt;span class="caps"&gt;IPN&lt;/span&gt; are very good, and when we take into account that the high schools run by the &lt;span class="caps"&gt;UNAM&lt;/span&gt; do not take part in &lt;span class="caps"&gt;ENLACE&lt;/span&gt;, it is likely that many of the best students in Mexico City attend public schools.&lt;br /&gt;
&lt;br class="Apple-interchange-newline" /&gt;
The top two schools compared:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-qHdR1DNNxQo_UffCmouLTqI_AAAAAAAAGa0_-WtXxJtSIBo_s1600_top2.png" imageanchor="1" &gt;&lt;img border="0" height="250" src="/images/blogger_images/2.bp.blogspot.com_-qHdR1DNNxQo_UffCmouLTqI_AAAAAAAAGa0_-WtXxJtSIBo_s400_top2.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="text-align: left;"&gt;
Since the CECyT 9 is the &lt;a href="http://www.eluniversal.com.mx/nacion/199873.html"&gt;highest &lt;span class="caps"&gt;ENLACE&lt;/span&gt; scoring school in all of Mexico&lt;/a&gt;, the two best schools in the whole country are very likely public! Any ranking that excludes public schools is not based on any measure resembling school quality. Now if you wanted a ranking of the best schools for papalords&amp;#8230;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://www.administrativosuin.mx/corporativo/documentos/mejores%20prepas%202013.pdf" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="320" src="/images/blogger_images/3.bp.blogspot.com_-UYFogbJQGMk_UfcOlqMx-kI_AAAAAAAAGaY_K-Vy9mGTJ88_s320_up.png" width="279" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Be sure to read the fine print when a school claims to be the best one! Source:&amp;nbsp;&lt;a href="http://www.administrativosuin.mx/corporativo/documentos/mejores%20prepas%202013.pdf"&gt;Reforma&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style="text-align: left;"&gt;
The guys at the CECyT 9 are clearly doing something very well and they may indeed be adding value to the education of their pupils rather than simply taking in the best students. In the interactive chart of &amp;#8216;excellent&amp;#8217; &lt;span class="caps"&gt;ENLACE&lt;/span&gt; students it is clear they are way above what you would predict from their &lt;span class="caps"&gt;COMIPEMS&lt;/span&gt; score. It would be nice if Prepa 6 would participate in &lt;span class="caps"&gt;ENLACE&lt;/span&gt; to be able to compare results. This certainly merits further research to see if the methods they use can be replicated at other schools.&lt;/div&gt;
&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="/images/blogger_images/1.bp.blogspot.com_-sx2NGF-dlWg_UfhyqXJNQmI_AAAAAAAAGbs_-fZKf0HZxik_s1600_pisa.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="200" src="/images/blogger_images/1.bp.blogspot.com_-sx2NGF-dlWg_UfhyqXJNQmI_AAAAAAAAGbs_-fZKf0HZxik_s320_pisa.png" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Well, upon further inspection this probably is due to a selection effect since the math scores of Hispanics born in the &lt;span class="caps"&gt;US&lt;/span&gt; are similar to &amp;nbsp;those of Hispanics who weren&amp;#8217;t born in the &lt;span class="caps"&gt;US&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
The CECyT 9 is also the Mexican school with the most medals in the&amp;nbsp;&lt;a href="https://es.wikipedia.org/wiki/Olimpiada_Mexicana_de_Inform%C3%A1tica#M.C3.A9xico_en_las_Olimpiadas_Internacionales_de_Inform.C3.A1tica"&gt;International Olympiad in Informatics&lt;/a&gt;,&amp;nbsp;so it is overall very distinguished.&lt;br /&gt;
&lt;br /&gt;
From all this I conclude it is no big deal if the students from the &lt;span class="caps"&gt;UNAM&lt;/span&gt;-run high schools get automatically admitted to the &lt;span class="caps"&gt;UNAM&lt;/span&gt;&amp;#8217;s university system (if they also maintain an average of 70% and finish in at least 4 years). Ok, they could change the requirement to graduate in 3 years, still they are already very likely to be able to pass the admission exam based on their high test scores! But there is in fact one change the &lt;span class="caps"&gt;UNAM&lt;/span&gt; could do to improve dramatically the quality of its student body which will be the topic of my next post.&lt;br /&gt;
&lt;br /&gt;
The code to replicate my analysis is available on&amp;nbsp;&lt;a href="https://github.com/diegovalle/comipems"&gt;GitHub&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; Yes, I&amp;#8217;m fully aware the students at the top public schools are richer than average, and that in fact the subsidy they receive by attending public school is regressive. But they are not as rich as those attending the top private schools and I get to joke about it.
&lt;div style='clear: both;'&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;</summary><category term="education"></category></entry><entry><title>Shapefiles of Mexico (AGEBs, Manzanas, etc)</title><link href="https://blog.diegovalle.net/2013/06/shapefiles-of-mexico-agebs-manzanas-etc.html" rel="alternate"></link><updated>2013-06-24T00:00:00+02:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-06-24:2013/06/shapefiles-of-mexico-agebs-manzanas-etc.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
   &lt;a href="/images/blogger_images/1.bp.blogspot.com_-FqW_5Q4FoYc_Ub5TFpkun5I_AAAAAAAAGVE_uimPXrWpJMI_s1600_df_localidades.png"&gt;&lt;img border="0" height="297" src="/images/blogger_images/1.bp.blogspot.com_-FqW_5Q4FoYc_Ub5TFpkun5I_AAAAAAAAGVE_uimPXrWpJMI_s400_df_localidades.png" width="400"&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;My post on how to &lt;a href="http://blog.diegovalle.net/2013/02/download-shapefiles-of-mexico.html"&gt;download electoral shapefiles&lt;/a&gt; proved to be very popular, so I decided to create &lt;a href="https://gist.github.com/diegovalle/5843688"&gt;another script&lt;/a&gt; to download shapefiles of census geographies. This is &lt;b&gt;&lt;/b&gt;all data that is freely available from the &lt;span class="caps"&gt;INEGI&lt;/span&gt; website,&amp;nbsp;it&amp;#8217;s just that they make it really hard to find, it&amp;#8217;s only downloadable as a compressed windows executable, and the download links for the files tend to change every few months.&lt;br&gt;
&lt;a id="more" name="more"&gt;&lt;/a&gt;&lt;br&gt;
The shapefiles are encoded as codepage 1252 and were reprojected to &lt;span class="caps"&gt;WGS84&lt;/span&gt;. All data corresponds to the 2010 census.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Now for the ugly bits: You&amp;#8217;ll need a recent version of &lt;a href="http://constexpr.org/innoextract/"&gt;innoextract&lt;/a&gt;,&amp;nbsp;one that can work with files created by version 5.5 of Inno Setup (yes, the &lt;span class="caps"&gt;INEGI&lt;/span&gt; distributes shapefiles as windows installers), the one in Ubuntu universe is not recent enough. The version available from &lt;a href="https://launchpad.net/~arx/+archive/release"&gt;this repository&lt;/a&gt; should&amp;nbsp;work.&lt;/p&gt;
&lt;table class="highlighttable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;1
2
3
4&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div class="highlight"&gt;&lt;pre&gt;sudo add-apt-repository ppa:arx/release
sudo apt-get update
sudo apt-get install innoextract
chmod +x download-census-shp.sh
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;&lt;strike&gt;As of now, this script has not been tested on Windows and Mac systems, only on Ubuntu.&lt;/strike&gt;&amp;nbsp;This script has been tested on Ubuntu, on a Mac you should try and use &amp;#8216;brew install wget&amp;#8217; and &amp;#8216;brew install rename&amp;#8217; before running it, and on Windows use&amp;nbsp;cygwin. &lt;/p&gt;
&lt;p&gt;The script will create a directory called &lt;code&gt;shps&lt;/code&gt; where all the shapefiles are located, if something goes wrong when downloading be sure to delete it and try again. Once you finish running the script you&amp;#8217;ll end up with about 5.5 gigabytes of shapefiles containing all available levels of geographical granularity for the 2010 Mexican census.&lt;br&gt;&lt;/p&gt;
&lt;h3&gt;Census&amp;nbsp;Geographies:&lt;/h3&gt;
&lt;p&gt;&lt;i&gt;States -&amp;gt; Municipios (Counties) -&amp;gt; Localidades (Polygon if urban otherwise point) -&amp;gt; &lt;span class="caps"&gt;AGEB&lt;/span&gt; (Census Areas - Urban only) -&amp;gt; Manzana (Census Blocks - Urban&amp;nbsp;only)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Plus, you&amp;#8217;ll also get a bunch of shapefiles of parks, rivers, schools,&amp;nbsp;etc.&lt;/p&gt;
&lt;p&gt;&lt;a href="/images/blogger_images/2.bp.blogspot.com_-0jvTTH6J9s4_Ub5UXd_70YI_AAAAAAAAGVc_Aj3P5T2Lctk_s1600_estados.png"&gt;&lt;img border="0" height="297" src="/images/blogger_images/2.bp.blogspot.com_-0jvTTH6J9s4_Ub5UXd_70YI_AAAAAAAAGVc_Aj3P5T2Lctk_s400_estados.png" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Municipios&amp;nbsp;(Counties)&lt;/p&gt;
&lt;p&gt;&lt;a href="/images/blogger_images/3.bp.blogspot.com_-akm0LuNkMWw_Ub5Ua_AygHI_AAAAAAAAGVk_wc-K1bizeEQ_s1600_df_municipios.png"&gt;&lt;img border="0" height="297" src="/images/blogger_images/3.bp.blogspot.com_-akm0LuNkMWw_Ub5Ua_AygHI_AAAAAAAAGVk_wc-K1bizeEQ_s400_df_municipios.png" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Localidades&lt;/span&gt; (Urban Polygons and Rural&amp;nbsp;Points)&lt;/p&gt;
&lt;p&gt;&lt;a href="/images/blogger_images/4.bp.blogspot.com_-FqW_5Q4FoYc_Ub5TFpkun5I_AAAAAAAAGVI_V8c5AMgt_VU_s1600_df_localidades.png"&gt;&lt;img border="0" height="297" src="/images/blogger_images/4.bp.blogspot.com_-FqW_5Q4FoYc_Ub5TFpkun5I_AAAAAAAAGVI_V8c5AMgt_VU_s400_df_localidades.png" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="caps"&gt;AGEB&lt;/span&gt; (Census&amp;nbsp;Areas)&lt;/p&gt;
&lt;p&gt;&lt;a href="/images/blogger_images/3.bp.blogspot.com_-Lp1ib2NP6lI_Ub5UkaTjvEI_AAAAAAAAGVs_JFc1DE1xc90_s1600_df_ageb.png" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="297" src="/images/blogger_images/3.bp.blogspot.com_-Lp1ib2NP6lI_Ub5UkaTjvEI_AAAAAAAAGVs_JFc1DE1xc90_s400_df_ageb.png" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Manzanas&amp;nbsp;(Blocks)&lt;/p&gt;
&lt;p&gt;&lt;a href="/images/blogger_images/4.bp.blogspot.com_-edZ6rWmRHCE_Ub5Uoq4OPZI_AAAAAAAAGV0_hn_CjZhvzh8_s1600_df_manazana.png" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="297" src="/images/blogger_images/4.bp.blogspot.com_-edZ6rWmRHCE_Ub5Uoq4OPZI_AAAAAAAAGV0_hn_CjZhvzh8_s400_df_manazana.png" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ejes viales&amp;nbsp;(Streets)&lt;/p&gt;
&lt;p&gt;&lt;a href="/images/blogger_images/4.bp.blogspot.com_-DHf-oy9VV8w_Ub5UsPc09II_AAAAAAAAGV8_4HFdGYzcngU_s1600_df_eje_vial.png" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="238" src="/images/blogger_images/4.bp.blogspot.com_-DHf-oy9VV8w_Ub5UsPc09II_AAAAAAAAGV8_4HFdGYzcngU_s320_df_eje_vial.png" width="320"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Servicios A (polygons and&amp;nbsp;lines)&lt;/h3&gt;
&lt;p&gt;Camellón, Metro Station, Hospitals, Parks, Schools,&amp;nbsp;etc&lt;/p&gt;
&lt;p&gt;&lt;a href="/images/blogger_images/1.bp.blogspot.com_-HKzr2CDRR0E_Ub5UwCOTBqI_AAAAAAAAGWE_u5Lc9uh0vgY_s1600_df_servicios_a.png" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="297" src="/images/blogger_images/1.bp.blogspot.com_-HKzr2CDRR0E_Ub5UwCOTBqI_AAAAAAAAGWE_u5Lc9uh0vgY_s400_df_servicios_a.png" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Servicios L (polygons and&amp;nbsp;points)&lt;/h3&gt;
&lt;p&gt;Bridges, Railways, Tren Metropolitano, Lindero,&amp;nbsp;etc&lt;/p&gt;
&lt;p&gt;&lt;a href="/images/blogger_images/1.bp.blogspot.com_-8_2yvfOSsPw_Ub5WSlOXiqI_AAAAAAAAGWs_T5tUgmGRkbs_s1600_df_servicios_l.png" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="297" src="/images/blogger_images/1.bp.blogspot.com_-8_2yvfOSsPw_Ub5WSlOXiqI_AAAAAAAAGWs_T5tUgmGRkbs_s400_df_servicios_l.png" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Servicios P&amp;nbsp;(points)&lt;/h3&gt;
&lt;p&gt;Churches, Schools, Hospitals,&amp;nbsp;etc&lt;/p&gt;
&lt;p&gt;&lt;a href="/images/blogger_images/2.bp.blogspot.com_-xGy74RIWEuM_Ub5U3iZ2zSI_AAAAAAAAGWM_YCPezZtix_o_s1600_df_servicios_p.png" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="297" src="/images/blogger_images/2.bp.blogspot.com_-xGy74RIWEuM_Ub5U3iZ2zSI_AAAAAAAAGWM_YCPezZtix_o_s400_df_servicios_p.png" width="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s the script you need to run to download the&amp;nbsp;shapefiles:&lt;/p&gt;
&lt;script src="https://gist.github.com/diegovalle/5843688.js"&gt;
&lt;/script&gt;

&lt;p&gt;&lt;br&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; You can contact the &lt;a href="https://twitter.com/INEGI_INFORMA"&gt;&lt;span class="caps"&gt;INEGI&lt;/span&gt;&lt;/a&gt; and tell them what you think of the way they distribute data.&lt;br&gt;
&lt;span class="caps"&gt;P.P.S.&lt;/span&gt; If you need shapefiles of elevation curves, archeological sites, rivers, etc, try this &lt;a href="https://gist.github.com/diegovalle/5864549"&gt;other&amp;nbsp;script&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;i&gt;Update:&lt;/i&gt;&lt;/b&gt; You can also use a docker image to run the script without having to install&amp;nbsp;anything&lt;/p&gt;
&lt;table class="highlighttable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;1
2
3
4
5
6&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div class="highlight"&gt;&lt;pre&gt;docker pull diegovalle/scince2010-docker
&lt;span class="c"&gt;# shared directory to store the output&lt;/span&gt;
mkdir /tmp/scince2010
&lt;span class="c"&gt;# run ./download.sh within the container and the files should be ready&lt;/span&gt;
&lt;span class="c"&gt;# in /tmp/since2010&lt;/span&gt;
docker run -v /tmp/scince2010:/shapefiles/shps -i -t diegovalle/scince2010-docker
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary><category term="ageb"></category><category term="arcgis"></category><category term="archivos"></category><category term="arcmap"></category><category term="distritos"></category><category term="esri"></category><category term="estados"></category><category term="files"></category><category term="georeferenciacion"></category><category term="gis"></category><category term="ife"></category><category term="manzana"></category><category term="mexico"></category><category term="municipios"></category><category term="republica-mexicana"></category><category term="secciones"></category><category term="shapefiles"></category></entry><entry><title>Maps of Mexico City</title><link href="https://blog.diegovalle.net/2013/04/maps-of-mexico-city.html" rel="alternate"></link><updated>2013-04-09T00:00:00+02:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-04-09:2013/04/maps-of-mexico-city.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodemarginacion.html" imageanchor="1" &gt;&lt;img border="0" height="267" src="/images/blogger_images/2.bp.blogspot.com_-joX3zpYg6WU_UWSWnNSNANI_AAAAAAAAGPY_1ga_f4RNjYo_s400_Screenshot+-+04092013+-+05-13-01+PM.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
Just some maps of the Mexico City metro area based on the 2010 census. You can search by address and switch to satellite view. If the maps seem slow I suggest you use &lt;a href="http://www.google.com/chrome"&gt;chrome&lt;/a&gt;.&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodemarginacion.html"&gt;Margination Index (at the &lt;span class="caps"&gt;AGEB&lt;/span&gt;&amp;nbsp;level)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodelobukis.html"&gt;Percentage of 18-24 year olds who are&amp;nbsp;women&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodemonstruos.html"&gt;Percentage over 15 years of&amp;nbsp;age&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyoderucos.html"&gt;Median&amp;nbsp;Age&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodesardinas.html"&gt;Population&amp;nbsp;Density&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodesatanas.html"&gt;Percent with no&amp;nbsp;religion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodetrafico.html"&gt;Households with&amp;nbsp;vehicles&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;a name="more"&gt;&lt;/a&gt;To calculate the margination index I used the first principal component of the percentage of the population with at least one year of college, households with a dirt floor, households without electricity, etc&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-2qigzhBhS9Q_UWSgV3fLj6I_AAAAAAAAGPw_YEVMES6OpOI_s1600_pca.png" imageanchor="1" &gt;&lt;img border="0" height="312" src="/images/blogger_images/3.bp.blogspot.com_-2qigzhBhS9Q_UWSgV3fLj6I_AAAAAAAAGPw_YEVMES6OpOI_s400_pca.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
When it comes to attracting young women to their neighborhoods the &lt;a href="http://www.mirrreybook.com/"&gt;mirrreys&lt;/a&gt; beat the &lt;a href="http://twicsy.com/i/xkCDJ"&gt;hipsters&lt;/a&gt; hands down (though the suburbs are probably not the best place to actually &lt;i&gt;meet&lt;/i&gt; women). &lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-9nVmVUeoTVk_UWSk8SxOWjI_AAAAAAAAGP4_D1AF4fgrl5A_s1600_Screenshot+-+04092013+-+06-30-19+PM.png" imageanchor="1" &gt;&lt;img border="0" height="270" src="/images/blogger_images/4.bp.blogspot.com_-9nVmVUeoTVk_UWSk8SxOWjI_AAAAAAAAGP4_D1AF4fgrl5A_s400_Screenshot+-+04092013+-+06-30-19+PM.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
I also wonder what&amp;#8217;s up with all the non religious persons in La Condesa and Roma Norte. The &lt;span class="caps"&gt;UNAM&lt;/span&gt; I can understand, I&amp;#8217;m guessing I didn&amp;#8217;t get the memo on the hipster heresy.&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-y6zmajjhtKo_UWS3hxj__SI_AAAAAAAAGQI_JZU2p0n1pN0_s1600_Screenshot+-+04092013+-+07-49-01+PM.png" imageanchor="1" &gt;&lt;img border="0" height="267" src="/images/blogger_images/1.bp.blogspot.com_-y6zmajjhtKo_UWS3hxj__SI_AAAAAAAAGQI_JZU2p0n1pN0_s400_Screenshot+-+04092013+-+07-49-01+PM.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
There&amp;#8217;s also a negative relationship between car ownership and population density, though obviously a lot more variables are involved. The rich areas and the outer ring surrounding the urban center are low in population density, while the poor mostly live in high population density areas.&lt;br/&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-kNcabLBRIA8_UWTLVZ3M-4I_AAAAAAAAGQY_sDI9A-J0tE8_s1600_Screenshot+-+04092013+-+09-13-59+PM.png" imageanchor="1" &gt;&lt;img border="0" height="268" src="/images/blogger_images/4.bp.blogspot.com_-kNcabLBRIA8_UWTLVZ3M-4I_AAAAAAAAGQY_sDI9A-J0tE8_s400_Screenshot+-+04092013+-+09-13-59+PM.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-5ZXH8UElqog_UWSdSCrOrUI_AAAAAAAAGPk_5RoNO7dU35I_s1600_scatter-cars-density.png" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/2.bp.blogspot.com_-5ZXH8UElqog_UWSdSCrOrUI_AAAAAAAAGPk_5RoNO7dU35I_s400_scatter-cars-density.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br/&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href="https://github.com/diegovalle/mxc-census-maps"&gt;GitHub&lt;/a&gt;&lt;/div&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="gis"></category><category term="javascript"></category></entry><entry><title>Visualising Change in Presidential Votes</title><link href="https://blog.diegovalle.net/2013/03/visualising-change-in-presidential-votes.html" rel="alternate"></link><updated>2013-03-05T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-03-05:2013/03/visualising-change-in-presidential-votes.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://www.diegovalle.net/maps/secondage" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="205" src="/images/blogger_images/3.bp.blogspot.com_-jwgwgeXd76M_UTVoheu0lxI_AAAAAAAAGOo_P6BXhtHaF8w_s400_Change+in+Presidential+Vote+2006-2012.png" width="400"/&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Click on the image to visit the interactive version (&lt;a href="http://www.diegovalle.net/maps/segundaera"&gt;Spanish&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
I liked this &lt;a href="http://elections.nytimes.com/2012/results/president"&gt;visualization by the New York Times&lt;/a&gt; of the &lt;span class="caps"&gt;US&lt;/span&gt; presidential election so much I decided to recreate it using Mexican data, and in the process added a &lt;a href="http://charliepark.org/slopegraphs/"&gt;slope graph&lt;/a&gt;. So go visit my&lt;a href="http://www.diegovalle.net/maps/secondage"&gt; new visualization of the change in presidential&lt;/a&gt; vote from 2006 to 2012 at the municipality level. I recommend using &lt;a href="http://www.google.com/chrome"&gt;chrome&lt;/a&gt; to view the visualisation, there&amp;#8217;s also a &lt;a href="http://www.diegovalle.net/maps/segundaera"&gt;Spanish version&lt;/a&gt;.&lt;br/&gt;
&lt;br/&gt;
&lt;a name="more"&gt;&lt;/a&gt;&lt;br/&gt;
The &lt;span class="caps"&gt;PRI&lt;/span&gt; gained votes in almost all the big municipalities save for Villahermosa (Centro). The home state of &lt;span class="caps"&gt;AMLO&lt;/span&gt;.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-Bx3XtOgNzI4_UTXv-uoUOlI_AAAAAAAAGO8_IobfKw79MFE_s1600_Rplot21.png" imageanchor="1" &gt;&lt;br class="Apple-interchange-newline"/&gt;&lt;img border="0" height="311" src="/images/blogger_images/3.bp.blogspot.com_-Bx3XtOgNzI4_UTXv-uoUOlI_AAAAAAAAGO8_IobfKw79MFE_s320_Rplot21.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
Not everyone was happy with the post-election protests of the &lt;span class="caps"&gt;PRD&lt;/span&gt; candidate. Interestingly, he did gain votes in several of the municipalities that make up the Monterrey and Guadalajara metro areas.&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/4.bp.blogspot.com_-KETACwDbm0w_UTXv-nnNP0I_AAAAAAAAGO4_PR_EMtU7sJo_s1600_Rplot23.png" imageanchor="1" &gt;&lt;img border="0" height="311" src="/images/blogger_images/4.bp.blogspot.com_-KETACwDbm0w_UTXv-nnNP0I_AAAAAAAAGO4_PR_EMtU7sJo_s320_Rplot23.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
People in Villahermosa must really hate the &lt;span class="caps"&gt;PRI&lt;/span&gt;. I was not surprised to see the &lt;span class="caps"&gt;PAN&lt;/span&gt; lose votes in Culiacán, Juárez, Chihuahua, Cuernavaca, Tijuana, Zapopan, Guadalajara, Monterrey&amp;#8230;&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-CvWedxdIoxA_UTXv-0UbkBI_AAAAAAAAGPA_9ubZlq3Np8E_s1600_Rplot22.png" imageanchor="1" &gt;&lt;img border="0" height="311" src="/images/blogger_images/3.bp.blogspot.com_-CvWedxdIoxA_UTXv-0UbkBI_AAAAAAAAGPA_9ubZlq3Np8E_s320_Rplot22.png" width="320"/&gt;&lt;/a&gt;&lt;/div&gt;
Scatter plots of votes in 2006 vs votes in 2012:&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/3.bp.blogspot.com_-E9B5O1rqurI_UTVdSJD1WEI_AAAAAAAAGOA_j9SvA5Q1HDY_s1600_Rplot12.png" imageanchor="1" &gt;&lt;img border="0" height="266" src="/images/blogger_images/3.bp.blogspot.com_-E9B5O1rqurI_UTVdSJD1WEI_AAAAAAAAGOA_j9SvA5Q1HDY_s400_Rplot12.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/1.bp.blogspot.com_-TRd-qWf6bbs_UTVdSoRg9zI_AAAAAAAAGOI_jf33LT0pW00_s1600_Rplot13.png" imageanchor="1" &gt;&lt;img border="0" height="266" src="/images/blogger_images/1.bp.blogspot.com_-TRd-qWf6bbs_UTVdSoRg9zI_AAAAAAAAGOI_jf33LT0pW00_s400_Rplot13.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="/images/blogger_images/2.bp.blogspot.com_-eE3vZhsWzVk_UTVdTOLWSSI_AAAAAAAAGOQ_FYJHkyMqAtQ_s1600_Rplot14.png" imageanchor="1" &gt;&lt;img border="0" height="266" src="/images/blogger_images/2.bp.blogspot.com_-eE3vZhsWzVk_UTVdTOLWSSI_AAAAAAAAGOQ_FYJHkyMqAtQ_s400_Rplot14.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; The code for the interactive chart is &lt;a href="https://github.com/diegovalle/election-change"&gt;here&lt;/a&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="d3js"></category><category term="gis"></category><category term="javascript"></category><category term="mirrreynato"></category></entry><entry><title>Download electoral shapefiles of Mexico (secciones, distritos, and colonias)</title><link href="https://blog.diegovalle.net/2013/02/download-shapefiles-of-mexico.html" rel="alternate"></link><updated>2013-02-27T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-02-27:2013/02/download-shapefiles-of-mexico.html</id><summary type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="/images/blogger_images/4.bp.blogspot.com_-WopLWoYlbZk_US4LELerTbI_AAAAAAAAGLs_T0GalJUhE4Q_s1600_res.png" imageanchor="1" &gt;&lt;img border="0" height="300" src="/images/blogger_images/4.bp.blogspot.com_-WopLWoYlbZk_US4LELerTbI_AAAAAAAAGLs_T0GalJUhE4Q_s400_res.png" width="400"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve created a set of scripts to &lt;a href="https://github.com/diegovalle/download-maps12"&gt;download and recode shapefiles&lt;/a&gt; from the &lt;span class="caps"&gt;IFE&lt;/span&gt; and &lt;span class="caps"&gt;INEGI&lt;/span&gt;. Once you run the scripts you&amp;#8217;ll find in the &lt;i&gt;map-out&lt;/i&gt; directory:
&lt;br/&gt;
&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;distritos&lt;/b&gt;: Shapefile of the electoral distritos&amp;nbsp;(districts) &lt;/li&gt;
&lt;li&gt;&lt;b&gt;secciones-inegi&lt;/b&gt;: Shapefile of electoral secciones (precincts) with both the ife and inegi codes for the municipalities each seccion belongs&amp;nbsp;to &lt;/li&gt;
&lt;li&gt;&lt;b&gt;estados&lt;/b&gt;: Shapefile of the Mexican states according to the &lt;span class="caps"&gt;INEGI&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;localidades&lt;/b&gt;: Shapefiles of the rural localities and the polygons of the urban&amp;nbsp;ones &lt;/li&gt;
&lt;li&gt;&lt;b&gt;municipios&lt;/b&gt;: Shapefile of the municipalities of Mexico according to the &lt;span class="caps"&gt;INEGI&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;rdata-secciones&lt;/b&gt;: serialized secciones (precincts) map as an R&amp;nbsp;object &lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;
&lt;div style="border: 0px; margin-bottom: 15px; margin-top: 15px; padding: 0px;"&gt;
&lt;br/&gt;



Since the &lt;span class="caps"&gt;IFE&lt;/span&gt; uses a different coding standard for the municipalities of Mexico than the &lt;span class="caps"&gt;INEGI&lt;/span&gt;, I&amp;#8217;ve recoded the municipality codes so that they match the ones the &lt;span class="caps"&gt;INEGI&lt;/span&gt; uses.

&lt;/div&gt;

&lt;p&gt;&lt;i&gt;&lt;span style="background-color: #ffd966; font-family: Verdana, sans-serif;"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/i&gt;
&lt;i&gt;&lt;span style="background-color: #ffd966; font-family: Verdana, sans-serif;"&gt;
&lt;/span&gt;&lt;/i&gt;
&lt;i&gt;&lt;span style="background-color: #ffd966; font-family: Verdana, sans-serif;"&gt;Ecatepec, México according to the &lt;span class="caps"&gt;INEGI&lt;/span&gt; is &lt;b&gt;15 033&lt;/b&gt;, while according to the &lt;span class="caps"&gt;IFE&lt;/span&gt; it&amp;#8217;s &lt;b&gt;15 034&lt;/b&gt; &lt;/span&gt;&lt;/i&gt;&lt;br&gt;
&lt;i&gt;&lt;span style="background-color: #ffd966; font-family: Verdana, sans-serif;"&gt;Guadalajara, Jalisco according to the &lt;span class="caps"&gt;INEGI&lt;/span&gt; is &lt;b&gt;14 039&lt;/b&gt;, while according to the &lt;span class="caps"&gt;IFE&lt;/span&gt; it&amp;#8217;s &lt;b&gt;14 041&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;br/&gt;
&lt;br/&gt;
These codes are only available for the secciones electorales (precincts) shapefile and they are contained in the variables:
&lt;br/&gt;
&lt;br/&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;MUN_INEGI&lt;/b&gt;: The inegi municipio&amp;nbsp;codes &lt;/li&gt;
&lt;li&gt;&lt;b&gt;MUN_IFE&lt;/b&gt;: The original ife municipio codes that came with the&amp;nbsp;file&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
The codebook for the the census data that comes with the distrito and sección shapefiles is in the &lt;i&gt;FD_SECC_IFE.pdf&lt;/i&gt; file and the ife and inegi codes are in the &lt;i&gt;ife.to.inegi.csv&lt;/i&gt; file. I also suggest you check out &lt;a href="https://twitter.com/unRob"&gt;Rob Hidalgo&amp;#8217;s&lt;/a&gt; repository of &lt;a href="https://github.com/unrob/informacion-publica/tree/master/ife/marco-geografico-nacional"&gt;public information&lt;/a&gt; (from freedom of information requests) which includes a shapefile of the municipios of Mexico according to the &lt;span class="caps"&gt;IFE&lt;/span&gt; (my version comes from the &lt;span class="caps"&gt;INEGI&lt;/span&gt; and they differ by a few municipalities)&lt;br/&gt;
&lt;br/&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; Here&amp;#8217;s the &lt;a href="https://github.com/diegovalle/download-maps12"&gt;code&lt;/a&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;i&gt;Update:&lt;/i&gt;&lt;/b&gt; You can also use a docker image to run the program without installing anything
&lt;br&gt;&lt;/p&gt;
&lt;table class="highlighttable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;1
2
3
4
5&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div class="highlight"&gt;&lt;pre&gt;docker pull diegovalle/download-maps12
&lt;span class="c"&gt;# shared directory to store the output&lt;/span&gt;
mkdir -p /tmp/download-ine2010 
&lt;span class="c"&gt;# once the container is up run make&lt;/span&gt;
docker run -v /tmp/download-ine2010:/download-maps12/map-out -i -t diegovalle/download-maps12
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary><category term="gis"></category><category term="mirrreynato"></category><category term="shapefiles"></category></entry><entry><title>Mexican Presidential Election by District</title><link href="https://blog.diegovalle.net/2013/02/mexican-presidential-election-by.html" rel="alternate"></link><updated>2013-02-11T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-02-11:2013/02/mexican-presidential-election-by.html</id><summary type="html">&lt;div class="post-body entry-content" itemprop="articleBody"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.diegovalle.net/maps/mordor/mordor.html" imageanchor="1" &gt;&lt;img border="0" height="357" src="/images/blogger_images/4.bp.blogspot.com_-bmcxI5K3ZdI_URmgDj3eVII_AAAAAAAAGKM_B_rkQ_bedm4_s400_plot.png" width="400"/&gt;&lt;/a&gt;&lt;/div&gt;
Check out the &lt;a href="http://www.diegovalle.net/maps/mordor/mordor.html"&gt;interactive map&lt;/a&gt; I made of the results of the presidential election in Mexico. I even used hierarchical clustering to group Mexico into five clusters according to how people vote (obviously the clusters are very rough and subject to statistical error).&lt;br/&gt;
&lt;br/&gt;
These are the median values for the percentage of the vote for each party in the clusters:&lt;br/&gt;
&lt;!-- Mon Feb 11 20:53:48 2013 --&gt;&lt;br/&gt;
&lt;table border="1"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;Interpretation&lt;/th&gt; &lt;th&gt;Cluster&lt;/th&gt; &lt;th&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt; &lt;/th&gt; &lt;th&gt;&lt;span class="caps"&gt;PAN&lt;/span&gt; &lt;/th&gt; &lt;th&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt; &lt;/th&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;&lt;/td&gt; &lt;td align="right"&gt;1 &lt;/td&gt; &lt;td align="right"&gt;0.27 &lt;/td&gt; &lt;td align="right"&gt;0.20 &lt;/td&gt; &lt;td align="right"&gt;0.46 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;-&lt;span class="caps"&gt;PAN&lt;/span&gt;&lt;/td&gt; &lt;td align="right"&gt;2 &lt;/td&gt; &lt;td align="right"&gt;0.23 &lt;/td&gt; &lt;td align="right"&gt;0.34 &lt;/td&gt; &lt;td align="right"&gt;0.38 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;span class="caps"&gt;PRI&lt;/span&gt;-&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt; &lt;td align="right"&gt;3 &lt;/td&gt; &lt;td align="right"&gt;0.40 &lt;/td&gt; &lt;td align="right"&gt;0.16 &lt;/td&gt; &lt;td align="right"&gt;0.37 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;span class="caps"&gt;PRD&lt;/span&gt;&lt;/td&gt; &lt;td align="right"&gt;4 &lt;/td&gt; &lt;td align="right"&gt;0.54 &lt;/td&gt; &lt;td align="right"&gt;0.15 &lt;/td&gt; &lt;td align="right"&gt;0.27 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;span class="caps"&gt;PAN&lt;/span&gt;&lt;/td&gt; &lt;td align="right"&gt;5 &lt;/td&gt; &lt;td align="right"&gt;0.22 &lt;/td&gt; &lt;td align="right"&gt;0.48 &lt;/td&gt; &lt;td align="right"&gt;0.26 &lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style="clear: both;"&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="d3js"></category><category term="gis"></category><category term="javascript"></category><category term="mirrreynato"></category></entry><entry><title>Interactive map of the drug war in Mexico</title><link href="https://blog.diegovalle.net/2013/01/interactive-map-of-drug-war-in-mexico-2013.html" rel="alternate"></link><updated>2013-01-22T00:00:00+01:00</updated><author><name>Diego Valle-Jones</name></author><id>tag:blog.diegovalle.net,2013-01-22:2013/01/interactive-map-of-drug-war-in-mexico-2013.html</id><summary type="html">&lt;div class='post-body entry-content' itemprop='articleBody'&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.diegovalle.net/narcomap" imageanchor="1" &gt;&lt;img border="0" height="400" src="/images/blogger_images/4.bp.blogspot.com_-ii8mL9QyZCI_UP8tcXh01XI_AAAAAAAAGHk_mUPesFYSCs4_s400_profile.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;I&amp;#8217;ve updated the &lt;a href="http://www.diegovalle.net/narcomap"&gt;interactive map&lt;/a&gt; I made &lt;a href="http://blog.diegovalle.net/2012/01/interactive-map-of-drug-war-in-mexico.html"&gt;last year&lt;/a&gt; to include the 2011 homicide data the &lt;span class="caps"&gt;INEGI&lt;/span&gt; recently released. Because of bad publicity the government will no longer update the drug war-related homicide database, so that dataset will forever remain stuck in September 2011.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt;The cool thing about the new version of map is that you can statistically correct some of the errors in the way homicides are recorded in Mexico.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Violent deaths can be classified as suicides, accidents, homicides, legal interventions and those of unspecified intent. There has been an upsurge in deaths of unspecified intent by firearm in Mexico at the same time all homicides increased, so it&amp;#8217;s natural to assume that some of those unspecified deaths were really homicides.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="/images/blogger_images/4.bp.blogspot.com_-7RaCeePjgOU_UP8xN-JO01I_AAAAAAAAGIM_1NNbfjyKmX0_s1600_noesp.png" imageanchor="1" &gt;&lt;img border="0" height="285" src="/images/blogger_images/4.bp.blogspot.com_-7RaCeePjgOU_UP8xN-JO01I_AAAAAAAAGIM_1NNbfjyKmX0_s400_noesp.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;To correct the mistakes here is what I did:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Classify all deaths of unknown intent into accidents, suicides and homicides based on the age, sex of the victim and injury mechanism by which the death occurred. The method I used is similar to the one I used in my &lt;a href="http://blog.diegovalle.net/2012/07/machine-learning-for-better-homicide.html"&gt;Juarez post&lt;/a&gt;. For example, if someone told you to guess the intent of the death of a 70 year old woman that died in Merida (one of Mexico&amp;#8217;s safest cities) by motor vehicle, you&amp;#8217;d probably guess it was an accident. If you had to guess the intent of the death of a young male in Ciudad Juárez that died by firearm, you&amp;#8217;d probably think it was an homicide.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="/images/blogger_images/1.bp.blogspot.com_-a3NwCKlcOOQ_UP82PEN-K1I_AAAAAAAAGJI_Iv5rPcsztsw_s1600_extra.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="250" src="/images/blogger_images/1.bp.blogspot.com_-a3NwCKlcOOQ_UP82PEN-K1I_AAAAAAAAGJI_Iv5rPcsztsw_s400_extra.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Recode all deaths by legal intervention as homicides (the &lt;a href="http://mexico.cnn.com/nacional/2010/09/16/al-menos-19-personas-mueren-en-enfrentamientos-en-nl-y-tamaulipas"&gt;19 deaths from the shootout&lt;/a&gt; between the army and the narcos in &lt;a href="http://www.diegovalle.net/mapa-guerra-narco.html#city=Polygon&amp;amp;start=2010-01-15&amp;amp;end=2010-12-15&amp;amp;mariguana=true&amp;amp;poppy=false&amp;amp;meth=false&amp;amp;cocaine=false&amp;amp;zoom=9&amp;amp;homtype=INEGI&amp;amp;clat=26.050476281176586&amp;amp;clong=-98.817626953125&amp;amp;statadj=false&amp;amp;names=true&amp;amp;polygon=-99.5965576171875+26.256472923285344%2C-99.4427490234375+26.148041726002866%2C-99.06097412109375+26.44844313751643%2C-99.13787841796875+26.539394329017032%2C-99.5965576171875+26.256472923285344"&gt;General Treviño and Mier were recorded as homicides&lt;/a&gt;)&amp;nbsp;since it seems legal&amp;nbsp;intervention&amp;nbsp;deaths are not always classified&amp;nbsp;correctly.&lt;/li&gt;
&lt;li&gt;Reconcile the problems in the &lt;a href="http://blog.diegovalle.net/2012/09/more-errors-in-mexican-mortality.html"&gt;Federal District&lt;/a&gt; and &lt;a href="http://blog.diegovalle.net/2012/12/how-mexican-state-ended-up-with-more.html"&gt;Sinaloa&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Since firearm accidents went from 6 in 2006 to a 100 in 2007 and again to 6 in 2008 I reclassified all firearm accidents in Baja California in&amp;nbsp;2007.&lt;/li&gt;
&lt;li&gt;I added the mass grave in Taxco and the one in San Fernando since they don&amp;#8217;t appear or are incomplete in the dataset from the &lt;span class="caps"&gt;INEGI&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Here are the results from in terms of sensitivity and specificity from the classification:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="/images/blogger_images/1.bp.blogspot.com_-6iqvsTQj6og_UP8xWdbW4UI_AAAAAAAAGIU_-ZQFmwokzpg_s1600_surface570.png" imageanchor="1" &gt;&lt;img border="0" height="346" src="/images/blogger_images/1.bp.blogspot.com_-6iqvsTQj6og_UP8xWdbW4UI_AAAAAAAAGIU_-ZQFmwokzpg_s400_surface570.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Even with the corrections I made there are still some errors left in the database, hopefully in the future I&amp;#8217;ll figure out how to fix them.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="/images/blogger_images/3.bp.blogspot.com_-JRCnvFBYTqE_UP8xc6goRUI_AAAAAAAAGIc_9ZEHcFBWqGo_s1600_accnoesp.png" imageanchor="1" &gt;&lt;img border="0" height="285" src="/images/blogger_images/3.bp.blogspot.com_-JRCnvFBYTqE_UP8xc6goRUI_AAAAAAAAGIc_9ZEHcFBWqGo_s400_accnoesp.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Visit the map on facebook:&amp;nbsp;&lt;a href="https://www.facebook.com/narcomap"&gt;https://www.facebook.com/narcomap&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="caps"&gt;P.S.&lt;/span&gt; You can download the &lt;a href="https://github.com/diegovalle/drug-war-interactive-map"&gt;source from GitHub&lt;/a&gt;&lt;br /&gt;
&lt;span class="caps"&gt;P.P.&lt;/span&gt;S You can also download the &lt;a href="https://github.com/diegovalle/death.index"&gt;program to clean the&amp;nbsp;mortality database&lt;/a&gt;&lt;br /&gt;
&lt;span class="caps"&gt;P.P.P.&lt;/span&gt;S If all you need is the data you can download it from the &lt;a href="http://www.diegovalle.net/projects.html#url=%23datasets"&gt;datasets section of my website&lt;/a&gt;
&lt;div style='clear: both;'&gt;&lt;/div&gt;
&lt;/div&gt;</summary><category term="drug-war"></category><category term="mortality-errors"></category></entry></feed>