<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CUYNRHo6cSp7ImA9WhBbFEU.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581</id><updated>2013-05-13T17:13:15.419-05:00</updated><category term="GIS" /><category term="Corruption" /><category term="ebrard2018" /><category term="javascript" /><category term="nutrition" /><category term="Economics" /><category term="Statistics" /><category term="France" /><category term="ggplot2" /><category term="Math" /><category term="Wine" /><category term="d3js" /><category term="Shiraz" /><category term="Red Wine" /><category term="Mexican Elections" /><category term="python" /><category term="Stats" /><category term="crime" /><category term="Crappy Restaurants" /><category term="Society" /><category term="protovis" /><category term="linear regression" /><category term="Drug war" /><category term="Swine influenza" /><category term="Sauvignon Blanc-Chardonnay" /><category term="mirrreynato" /><category term="Chardonnay" /><category term="Book Review" /><category term="Dating" /><category term="Cabernet-Merlot" /><category term="Influenza" /><category term="mortality-errors" /><category term="Italy" /><category term="Divorce" /><category term="Movie Review" /><category term="Germany" /><category term="Merlot" /><category term="Argentina" /><category term="Riesling" /><category term="Restaurants" /><category term="White Wine" /><category term="food" /><category term="Spain" /><category term="homicide" /><category term="Chile" /><category term="us" /><category term="Recipe" /><category term="Mexico" /><category term="Education" /><category term="R" /><category term="Malbec" /><title>Diego Valle's Blog</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.diegovalle.net/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>151</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/DiegoVallesFoodWineBlog" /><feedburner:info uri="diegovallesfoodwineblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>DiegoVallesFoodWineBlog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry gd:etag="W/&quot;DEMMR3w7eCp7ImA9WhBWFkk.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-3387388125174191581</id><published>2013-04-09T01:30:00.000-05:00</published><updated>2013-04-10T21:14:46.200-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-10T21:14:46.200-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="GIS" /><title>Maps of Mexico City</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodemarginacion.html" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="267" src="http://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 AGEB 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 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 age&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyoderucos.html"&gt;Median Age&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodesardinas.html"&gt;Population 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 religion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.diegovalle.net/maps/mxc/hoyodetrafico.html"&gt;Households with 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="http://3.bp.blogspot.com/-2qigzhBhS9Q/UWSgV3fLj6I/AAAAAAAAGPw/YEVMES6OpOI/s1600/pca.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="312" src="http://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&amp;nbsp;&lt;i&gt;meet&lt;/i&gt; women).&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-9nVmVUeoTVk/UWSk8SxOWjI/AAAAAAAAGP4/D1AF4fgrl5A/s1600/Screenshot+-+04092013+-+06:30:19+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="270" src="http://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's up with all the non religious persons in La Condesa and Roma Norte. The UNAM I can understand, I'm guessing I didn'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="http://1.bp.blogspot.com/-y6zmajjhtKo/UWS3hxj__SI/AAAAAAAAGQI/JZU2p0n1pN0/s1600/Screenshot+-+04092013+-+07:49:01+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="267" src="http://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'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="http://4.bp.blogspot.com/-kNcabLBRIA8/UWTLVZ3M-4I/AAAAAAAAGQY/sDI9A-J0tE8/s1600/Screenshot+-+04092013+-+09:13:59+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="268" src="http://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="http://2.bp.blogspot.com/-5ZXH8UElqog/UWSdSCrOrUI/AAAAAAAAGPk/5RoNO7dU35I/s1600/scatter-cars-density.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://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;
</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/3387388125174191581/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2013/04/maps-of-mexico-city.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/3387388125174191581?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/3387388125174191581?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/v-J8SrjLHCg/maps-of-mexico-city.html" title="Maps of Mexico City" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-joX3zpYg6WU/UWSWnNSNANI/AAAAAAAAGPY/1ga_f4RNjYo/s72-c/Screenshot+-+04092013+-+05:13:01+PM.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://blog.diegovalle.net/2013/04/maps-of-mexico-city.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMESXg9eSp7ImA9WhBRFEQ.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-1773020118712289237</id><published>2013-03-05T07:33:00.000-06:00</published><updated>2013-03-05T07:33:28.661-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-05T07:33:28.661-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="GIS" /><category scheme="http://www.blogger.com/atom/ns#" term="mirrreynato" /><category scheme="http://www.blogger.com/atom/ns#" term="d3js" /><title>Visualising Change in Presidential Votes</title><content type="html">&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="http://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 US presidential election so much I decided to recreate it using&amp;nbsp;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'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 PRI gained votes in almost all the big municipalities save for Villahermosa (Centro). The home state of AMLO.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-Bx3XtOgNzI4/UTXv-uoUOlI/AAAAAAAAGO8/IobfKw79MFE/s1600/Rplot21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br class="Apple-interchange-newline" /&gt;&lt;img border="0" height="311" src="http://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 PRD 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="http://4.bp.blogspot.com/-KETACwDbm0w/UTXv-nnNP0I/AAAAAAAAGO4/PR_EMtU7sJo/s1600/Rplot23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="311" src="http://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 PRI. I was not surprised to see the PAN lose votes in Culiacán, Juárez, Chihuahua, Cuernavaca, Tijuana, Zapopan, Guadalajara, Monterrey...&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-CvWedxdIoxA/UTXv-0UbkBI/AAAAAAAAGPA/9ubZlq3Np8E/s1600/Rplot22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="311" src="http://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="http://3.bp.blogspot.com/-E9B5O1rqurI/UTVdSJD1WEI/AAAAAAAAGOA/j9SvA5Q1HDY/s1600/Rplot12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="http://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="http://1.bp.blogspot.com/-TRd-qWf6bbs/UTVdSoRg9zI/AAAAAAAAGOI/jf33LT0pW00/s1600/Rplot13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="http://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="http://2.bp.blogspot.com/-eE3vZhsWzVk/UTVdTOLWSSI/AAAAAAAAGOQ/FYJHkyMqAtQ/s1600/Rplot14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="http://2.bp.blogspot.com/-eE3vZhsWzVk/UTVdTOLWSSI/AAAAAAAAGOQ/FYJHkyMqAtQ/s400/Rplot14.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
P.S. The code for the interactive chart is &lt;a href="https://github.com/diegovalle/election-change"&gt;here&lt;/a&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/1773020118712289237/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2013/03/visualising-change-in-presidential-votes.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/1773020118712289237?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/1773020118712289237?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/XpV2KoafrcU/visualising-change-in-presidential-votes.html" title="Visualising Change in Presidential Votes" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-jwgwgeXd76M/UTVoheu0lxI/AAAAAAAAGOo/P6BXhtHaF8w/s72-c/Change+in+Presidential+Vote+2006-2012.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2013/03/visualising-change-in-presidential-votes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYDSHs9eSp7ImA9WhBRFkw.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-5573555168036640600</id><published>2013-02-27T08:01:00.000-06:00</published><updated>2013-03-06T18:29:39.561-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-06T18:29:39.561-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GIS" /><category scheme="http://www.blogger.com/atom/ns#" term="mirrreynato" /><title>Download shapefiles of Mexico</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-WopLWoYlbZk/US4LELerTbI/AAAAAAAAGLs/T0GalJUhE4Q/s1600/res.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://4.bp.blogspot.com/-WopLWoYlbZk/US4LELerTbI/AAAAAAAAGLs/T0GalJUhE4Q/s400/res.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
I'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 IFE and&amp;nbsp;INEGI. Once you run the scripts&amp;nbsp;you'll find&amp;nbsp;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 (districts)&amp;nbsp;&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 to&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;estados&lt;/b&gt;: Shapefile of the Mexican states according to the INEGI&lt;/li&gt;
&lt;li&gt;&lt;b&gt;localidades&lt;/b&gt;: Shapefiles of the rural localities and the polygons of the urban ones&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;municipios&lt;/b&gt;: Shapefile of the municipalities of Mexico according to the INEGI&lt;/li&gt;
&lt;li&gt;&lt;b&gt;rdata-secciones&lt;/b&gt;: serialized secciones (precincts) map as an R object&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style="border: 0px; margin-bottom: 15px; margin-top: 15px; padding: 0px;"&gt;
&lt;br /&gt;
Since the IFE uses a different coding standard for the municipalities of Mexico than the INEGI, I've recoded the municipality codes so that they match the ones the INEGI uses.&lt;/div&gt;
&lt;i&gt;&lt;span style="background-color: #ffd966; font-family: Verdana, sans-serif;"&gt;Ecatepec, México according to the INEGI is 15 033, while according to the IFE it's 15 034&amp;nbsp;&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 INEGI is 14 039, while according to the IFE it's 14 041&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 codes&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;MUN_IFE&lt;/b&gt;: The original ife municipio codes that came with the 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&lt;br /&gt;
&lt;br /&gt;
I also suggest you check out &lt;a href="https://twitter.com/unRob"&gt;Rob Hidalgo'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 IFE (mine comes from the INEGI and they differ by a few municipalities) &lt;br /&gt;
&lt;br /&gt;
P.S. Here's the &lt;a href="https://github.com/diegovalle/download-maps12"&gt;code&lt;/a&gt;&lt;/div&gt;
</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/5573555168036640600/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2013/02/download-shapefiles-of-mexico.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5573555168036640600?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5573555168036640600?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/oNXD_EaIgNs/download-shapefiles-of-mexico.html" title="Download shapefiles of Mexico" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-WopLWoYlbZk/US4LELerTbI/AAAAAAAAGLs/T0GalJUhE4Q/s72-c/res.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2013/02/download-shapefiles-of-mexico.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYCRnk6fCp7ImA9WhBRFkw.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-5306825500671406659</id><published>2013-02-11T21:18:00.000-06:00</published><updated>2013-03-06T18:29:27.714-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-06T18:29:27.714-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="GIS" /><category scheme="http://www.blogger.com/atom/ns#" term="mirrreynato" /><category scheme="http://www.blogger.com/atom/ns#" term="d3js" /><title>Mexican Presidential Election by District</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.diegovalle.net/maps/mordor" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="357" src="http://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"&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;PRD &lt;/th&gt; &lt;th&gt;PAN &lt;/th&gt; &lt;th&gt;PRI &lt;/th&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;PRI&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;PRI-PAN&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;PRI-PRD&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;PRD&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;PAN&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;
</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/5306825500671406659/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2013/02/mexican-presidential-election-by.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5306825500671406659?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5306825500671406659?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/HQYt37nR3-U/mexican-presidential-election-by.html" title="Mexican Presidential Election by District" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-bmcxI5K3ZdI/URmgDj3eVII/AAAAAAAAGKM/B_rkQ_bedm4/s72-c/plot.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://blog.diegovalle.net/2013/02/mexican-presidential-election-by.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YNQ3Y7fyp7ImA9WhNaEUg.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-5205105450496367352</id><published>2013-01-22T21:14:00.000-06:00</published><updated>2013-01-25T15:59:52.807-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-25T15:59:52.807-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><category scheme="http://www.blogger.com/atom/ns#" term="mortality-errors" /><title>Interactive map of the drug war in Mexico - 2011</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.diegovalle.net/narcomap" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/-ii8mL9QyZCI/UP8tcXh01XI/AAAAAAAAGHk/mUPesFYSCs4/s400/profile.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;I'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 INEGI 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'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="http://4.bp.blogspot.com/-7RaCeePjgOU/UP8xN-JO01I/AAAAAAAAGIM/1NNbfjyKmX0/s1600/noesp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="285" src="http://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's safest cities) by motor vehicle, you'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'd probably think it was an homicide.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://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="http://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 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/2011/11/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 2007.&lt;/li&gt;
&lt;li&gt;I added the mass grave in Taxco and the one in San Fernando since they don't appear or are incomplete in the dataset from the INEGI.&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="http://1.bp.blogspot.com/-6iqvsTQj6og/UP8xWdbW4UI/AAAAAAAAGIU/-ZQFmwokzpg/s1600/surface570.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="346" src="http://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'll figure out how to fix them.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-JRCnvFBYTqE/UP8xc6goRUI/AAAAAAAAGIc/9ZEHcFBWqGo/s1600/accnoesp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="285" src="http://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;
P.S. 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;
P.P.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;
P.P.P.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;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/5205105450496367352/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2013/01/interactive-map-of-drug-war-in-mexico.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5205105450496367352?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5205105450496367352?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/xzonIX9yh3k/interactive-map-of-drug-war-in-mexico.html" title="Interactive map of the drug war in Mexico - 2011" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-ii8mL9QyZCI/UP8tcXh01XI/AAAAAAAAGHk/mUPesFYSCs4/s72-c/profile.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2013/01/interactive-map-of-drug-war-in-mexico.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMBQnw8eCp7ImA9WhNaFUw.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-2384506071340440715</id><published>2013-01-22T11:31:00.001-06:00</published><updated>2013-01-29T19:47:33.270-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-29T19:47:33.270-06:00</app:edited><title>Mapa interactivo de la guerra contra el narcotráfico - 2011</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.diegovalle.net/narcomapa" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="147" src="http://1.bp.blogspot.com/-SCgzxmmkFPE/UP7AQvjSywI/AAAAAAAAGDI/j8cOqxGvgdI/s400/cover.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Bueno, pues he actualizado el &lt;a href="http://www.diegovalle.net/narcomapa"&gt;mapa interactivo de la guerra contra el narcotráfico&lt;/a&gt; para incluir los datos de muertes por homicidio en el 2011 que acaba de publicar el &lt;a href="http://www.inegi.org.mx/est/contenidos/espanol/proyectos/continuas/vitales/bd/mortalidad/MortalidadGeneral.asp?s=est&amp;amp;c=11144"&gt;INEGI&lt;/a&gt;. Al parecer el gobierno ya no va a actualizar los homicidios debido al crimen organizado (también llamados de presunta rivalidad delincuencial) pero el mapa los sigue mostrando.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Para contar los homicidios asumo que en aquellos donde no se especifico el día de ocurrencia, ocurrieron en el mismo mes que fueron registrados.&lt;br /&gt;
&lt;br /&gt;
También ajuste los datos del INEGI en el 2011 por aproximadamente 3% debido a que por la fecha de corte del 31 de Diciembre para registrar los homicidios no da tiempo de registrar todos los homicidios que ocurrieron durante el 2011. Asumí que el subregistro de homicidios ocurrió de la misma manera que en el 2010.&lt;br /&gt;
&lt;br /&gt;
Aunque Culiacán y Navolato no son oficialmente un área metropolina las consideré como tal (y&amp;nbsp;actualicé&amp;nbsp;las demás áreas metropolitanas al 2010).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Pero lo más importante del mapa es que ahora se puede hacer un ajuste estadístico por errores y casos no reportados&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Las muertes violentas se pueden clasificar en suicidios, homicidios, accidentes, operaciones legales y aquellas donde no se especificó la intención. Las muertes de intención no especificada por el mecanismo de arma de fuego han ido aumentando al mismo tiempo que se disparó la violencia y es normal pensar muchas de estas muertes en realidad son homicidios.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-SEiyeLVF7O0/UP7EbGkOppI/AAAAAAAAGDw/V2qyJIil7ok/s1600/noesp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="285" src="http://1.bp.blogspot.com/-SEiyeLVF7O0/UP7EbGkOppI/AAAAAAAAGDw/V2qyJIil7ok/s400/noesp.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Usando &lt;a href="http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm"&gt;k-nearest neighbors&lt;/a&gt; clasifiqué cada una de estas muertes como homicidios, suicidios y accidentes en base al sexo, el mecanismo de defunción (arma de fuego,&amp;nbsp;asfixia,&amp;nbsp; transporte, etc) y la edad del difunto.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Para asegurarme de no meter la pata a la hora de clasificar las muertes calculé la &lt;a href="http://es.wikipedia.org/wiki/Sensibilidad_(epidemiolog%C3%ADa)"&gt;sensibilidad&lt;/a&gt; y la &lt;a href="http://es.wikipedia.org/wiki/Especificidad_(epidemiolog%C3%ADa)"&gt;especificidad&lt;/a&gt;&amp;nbsp;de los resultados guardando una muestra del 20% de los casos que no fue usada para entrenar el algoritmo:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Q4VMXgc5Gu4/UP7HFrRigsI/AAAAAAAAGEY/ya529vAvdGM/s1600/surface570.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="346" src="http://1.bp.blogspot.com/-Q4VMXgc5Gu4/UP7HFrRigsI/AAAAAAAAGEY/ya529vAvdGM/s400/surface570.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
A las operaciones legales también las clasifiqué como homicidios&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;En &lt;a href="http://mexico.cnn.com/nacional/2010/09/16/al-menos-19-personas-mueren-en-enfrentamientos-en-nl-y-tamaulipas"&gt;septiembre del 2010&lt;/a&gt; hubo una &lt;a href="http://www.diegovalle.net/narcomapa#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;balacera en los municipios de General Treviño, NL y Mier, Tamps en la que murieron 19 personas &lt;/a&gt;a manos del ejercito. En la base de datos del INEGI aparecen como muertos por homicidio cuando en teoría deberían haber sido registrados como muertes por "Operaciones de Guerra / Intervención Legal". Por este motivo recodifiqué las pocas muertes por operaciones legales que hay en la base de datos (20-40 al año) como homicidios.&lt;br /&gt;
&lt;br /&gt;
Los homicidios que fueron registrados como &lt;a href="http://blog.diegovalle.net/2012/09/more-errors-in-mexican-mortality.html"&gt;muertes accidentales en el Distrito Federal&lt;/a&gt;&amp;nbsp;también los clasifiqué para que fueran bien contados.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;También corregí la &lt;a href="http://blog.diegovalle.net/2011/11/how-mexican-state-ended-up-with-more.html"&gt;discrepancia entre los homicidios totales y homicidios del crimen organizado en Sinaloa&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Y por último agregué la fosa con 55 cuerpos que fue encontrada en Taxco y añadí la otra fosa que fue encontrada en San Fernando en abril del 2011.&lt;br /&gt;
&lt;br /&gt;
A pesar de estas&amp;nbsp;correcciones&amp;nbsp;quedan algunos errores en la base de datos, así que espero en un futuro tener todavía mejores datos:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-rI_YO1UjfYY/UP7HzNC9djI/AAAAAAAAGEg/Lf2TYNNtB7s/s1600/accnoesp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="285" src="http://1.bp.blogspot.com/-rI_YO1UjfYY/UP7HzNC9djI/AAAAAAAAGEg/Lf2TYNNtB7s/s400/accnoesp.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Visita el mapa en facebook:&amp;nbsp;&lt;a href="https://www.facebook.com/narcomapa"&gt;https://www.facebook.com/narcomapa&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
P.D. El código del mapa está &lt;a href="https://github.com/diegovalle/drug-war-interactive-map"&gt;disponible en GitHub&lt;/a&gt;&lt;br /&gt;
P.P.D. El código para &lt;a href="https://github.com/diegovalle/death.index"&gt;limpiar la base de datos de mortalidad&lt;/a&gt; también está disponible&lt;br /&gt;
P.P.P.D Si nada más te interesan los datos también están disponibles para su &lt;a href="http://www.diegovalle.net/projects.html#url=%23datasets"&gt;descarga&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/2384506071340440715/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2013/01/mapa-interactivo-de-la-guerra-contra-el.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/2384506071340440715?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/2384506071340440715?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/QeYin5dFTLI/mapa-interactivo-de-la-guerra-contra-el.html" title="Mapa interactivo de la guerra contra el narcotráfico - 2011" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-SCgzxmmkFPE/UP7AQvjSywI/AAAAAAAAGDI/j8cOqxGvgdI/s72-c/cover.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2013/01/mapa-interactivo-de-la-guerra-contra-el.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYDQX4-cSp7ImA9WhNbEkg.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-4596282050530333624</id><published>2013-01-15T07:22:00.000-06:00</published><updated>2013-01-15T07:22:50.059-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-15T07:22:50.059-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><title>Map of homicides in Monterrey</title><content type="html">&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/monterrey" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/-uCvC0Vgj4o4/UPMoA_1Ls0I/AAAAAAAAF_U/2z-WXGDnxNM/s400/Screenshot+-+01132013+-+03:28:52+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 map&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
This a somewhat cleaned up &lt;a href="http://www.diegovalle.net/monterrey"&gt;2d density map of homicides&lt;/a&gt; in Monterrey as reported by &lt;a href="http://gruporeforma.elnorte.com/libre/offlines/mty/mapas/mapadelcrimen2012.htm"&gt;El Norte&lt;/a&gt; during all of 2012. Do take note that the map is of homicide locations rather than counts and that I removed a couple of non-homicide events that were present in the original data.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Monterrey is surrounded by mountains and if you notice in the map the area around Topo Chico "bleeds" into the mountain, so it would probably be a good idea to use a more complicated model, taking into account the natural boundaries of Monterrey, to estimate the density of homicides.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-lcKZ4GQJqqw/UPMtx13NIqI/AAAAAAAAF_8/rJvsdUl5ZdE/s1600/Screenshot+-+01102013+-+07:01:37+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="219" src="http://3.bp.blogspot.com/-lcKZ4GQJqqw/UPMtx13NIqI/AAAAAAAAF_8/rJvsdUl5ZdE/s320/Screenshot+-+01102013+-+07:01:37+PM.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
In this &lt;a href="http://aitbus.org/aitbus/images/stories/pdf/dr%20arturo%20cervantes%20trejo%20conapra%20mxico.pdf"&gt;presentation&lt;/a&gt; by Arturo Cervantes you can see that the areas with the most homicides kind of&amp;nbsp;match the locations of&amp;nbsp;&lt;a href="http://3.bp.blogspot.com/-lcKZ4GQJqqw/UPMtx13NIqI/AAAAAAAAF_8/rJvsdUl5ZdE/s1600/Screenshot+-+01102013+-+07:01:37+PM.png"&gt;motor vehicle accidents&lt;/a&gt;.&amp;nbsp;The central part of Monterrey is actually &lt;a href="http://www.scielo.cl/fbpe/img/invi/v25n69/art01Fig05.jpg"&gt;less population dense&lt;/a&gt; than other areas, but apparently everybody travels there for work or play. And since everybody is there, that's where most homicides happen.&lt;br /&gt;
&lt;br /&gt;
Data Source:&amp;nbsp;&lt;a href="http://gruporeforma.elnorte.com/libre/offlines/mty/mapas/mapadelcrimen2012.htm" target="_blank"&gt;Mapa del Crimen 2012&lt;/a&gt;&amp;nbsp;from&amp;nbsp;&lt;a href="http://www.elnorte.com/" target="_blank"&gt;El Norte&lt;/a&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/4596282050530333624/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2013/01/map-of-homicides-in-monterrey.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/4596282050530333624?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/4596282050530333624?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/gS_78K91lqc/map-of-homicides-in-monterrey.html" title="Map of homicides in Monterrey" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-uCvC0Vgj4o4/UPMoA_1Ls0I/AAAAAAAAF_U/2z-WXGDnxNM/s72-c/Screenshot+-+01132013+-+03:28:52+PM.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2013/01/map-of-homicides-in-monterrey.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cHQXsycSp7ImA9WhNVEko.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-9162947499509722180</id><published>2012-12-18T22:09:00.000-06:00</published><updated>2012-12-23T10:10:30.599-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-23T10:10:30.599-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><title>The most dangerous days of the year</title><content type="html">&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="http://2.bp.blogspot.com/-lFjHQ0_uqBY/UNcs3bQgFNI/AAAAAAAAF9Q/4-3ciPgNcRA/s1600/text5544-4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="192" src="http://2.bp.blogspot.com/-lFjHQ0_uqBY/UNcs3bQgFNI/AAAAAAAAF9Q/4-3ciPgNcRA/s400/text5544-4.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
When looking at days of the year with the most homicides a pattern jumps out: violence is significantly higher during certain holidays in Mexico compared to the rest of the year. This is a well studied pattern in &lt;a href="http://uwf.edu/hlsd/pr%20homicide%20suicide%20major%20holidays.pdf"&gt;other countries&lt;/a&gt;.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Most violent dates 1998-2007:&lt;br /&gt;
&lt;table border="1" style="width: 300px;"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;Date &lt;/th&gt; &lt;th&gt;Homicides &lt;/th&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2000-Jan-01 &lt;/td&gt; &lt;td align="right"&gt;93 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;1998-Dec-25 &lt;/td&gt; &lt;td align="right"&gt;92 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2001-Jan-01 &lt;/td&gt; &lt;td align="right"&gt;89 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;1999-Jan-01 &lt;/td&gt; &lt;td align="right"&gt;88 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;2005-Jan-01 &lt;/td&gt; &lt;td align="right"&gt;80 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;1999-Dec-25 &lt;/td&gt; &lt;td align="right"&gt;78 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;1998-Mar-01 &lt;/td&gt; &lt;td align="right"&gt;76 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;1998-Jun-14 &lt;/td&gt; &lt;td align="right"&gt;74 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;1998-Oct-25 &lt;/td&gt; &lt;td align="right"&gt;73 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;1998-Nov-29 &lt;/td&gt; &lt;td align="right"&gt;73 &lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Six of the ten most violent days from 1998 to 2007 where either the first day of the year or Christmas. To check whether holidays were really more violent than the rest of the year I plotted the total number of homicides for the period 1998-2003, and 2005 (so each day after February would fall exactly once each day of the week). I excluded the drug war years to make the pattern more obvious.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-9nrBlgBi7po/UNEquxG57AI/AAAAAAAAF8o/SE7NizcpOqY/s1600/surface726.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="192" src="http://3.bp.blogspot.com/-9nrBlgBi7po/UNEquxG57AI/AAAAAAAAF8o/SE7NizcpOqY/s400/surface726.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;Sum of &lt;span style="font-size: small;"&gt;daily homicides&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt; from 1998-2003, and 2005 (ten most vi&lt;span style="font-size: small;"&gt;olent dates)&lt;/span&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;table border="1"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;Total&lt;br /&gt;
Homicides&lt;br /&gt;
(Sum of All Dates) &lt;/th&gt; &lt;th&gt;Day&lt;br /&gt;
Number &lt;/th&gt; &lt;th&gt;Holiday&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;558 &lt;/td&gt; &lt;td&gt;Jan-01 &lt;/td&gt; &lt;td&gt;New Year &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;388 &lt;/td&gt; &lt;td&gt;Dec-25 &lt;/td&gt; &lt;td&gt;Christmas &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;357 &lt;/td&gt; &lt;td&gt;Sep-16 &lt;/td&gt; &lt;td&gt;Independence Day &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;281 &lt;/td&gt; &lt;td&gt;Nov-02 &lt;/td&gt; &lt;td&gt;Day of the Dead&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;270 &lt;/td&gt; &lt;td&gt;Feb-15 &lt;/td&gt; &lt;td&gt;Day After Valentine's Day &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;270 &lt;/td&gt; &lt;td&gt;Dec-12 &lt;/td&gt; &lt;td&gt;Virgin of Guadalupe &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;269 &lt;/td&gt; &lt;td&gt;Dec-24 &lt;/td&gt; &lt;td&gt;Christmas Eve &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;263 &lt;/td&gt; &lt;td&gt;May-10 &lt;/td&gt; &lt;td&gt;Mother's Day &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;259 &lt;/td&gt; &lt;td&gt;Dec-31 &lt;/td&gt; &lt;td&gt;New Year's Eve &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;256 &lt;/td&gt; &lt;td&gt;May-03 &lt;/td&gt; &lt;td&gt;Related to Labor Day?&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
I find it quite interesting that the day of the dead would be one of the most violent days of the year. In countries where most homicides are solved, most homicide victims knew their attacker, so perhaps hanging out with family and friends during the holidays is not such a good idea? Does that stress people out?&lt;br /&gt;
&lt;br /&gt;
Performing an analysis of variance and testing for multiple comparisons with a Tukey test, the list of holidays above (coded as a binary variable), controlling for month of year and day of week, were expected to have between 28 and 39 extra homicides with a point estimate of 33 homicides.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="overflow: auto;"&gt;
&lt;div class="geshifilter"&gt;
&lt;pre class="r geshifilter-R" style="font-family: monospace;"&gt;fit &amp;lt;- &lt;a href="http://inside-r.org/r-doc/stats/aov"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;aov&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;total.deaths ~ &lt;a href="http://inside-r.org/r-doc/base/as.factor"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;as.factor&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;holiday&lt;span style="color: #009900;"&gt;)&lt;/span&gt; + &lt;a href="http://inside-r.org/r-doc/base/as.factor"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;as.factor&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;month&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/date"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;date&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; + &lt;a href="http://inside-r.org/r-doc/base/as.factor"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;as.factor&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;wday&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt; 
            &lt;a href="http://inside-r.org/r-doc/utils/data"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;data&lt;/span&gt;&lt;/a&gt; = homicides&lt;span style="color: #009900;"&gt;)&lt;/span&gt;
&lt;a href="http://inside-r.org/r-doc/stats/TukeyHSD"&gt;&lt;span style="color: #003399; font-weight: bold;"&gt;TukeyHSD&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;fit&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
Results for all days from 1998 to 2007:&lt;br /&gt;
&lt;pre&gt;##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = total.deaths ~ as.factor(holiday) + as.factor(month(date)) + as.factor(wday), data = homicides)
## 
## $`as.factor(holiday)`
##             diff   lwr   upr p adj
## TRUE-FALSE 33.46 28.37 38.55     0
##
## $`as.factor(wday)`
##         diff      lwr       upr  p adj
## 2-1 -11.9148 -13.3360 -10.49355 0.0000
## 3-1 -16.9419 -18.3645 -15.51927 0.0000
## 4-1 -18.3969 -19.8188 -16.97494 0.0000
## 5-1 -17.6014 -19.0226 -16.18016 0.0000
## 6-1 -16.3855 -17.8068 -14.96427 0.0000
## 7-1 -11.1132 -12.5344  -9.69192 0.0000
## 3-2  -5.0271  -6.4490  -3.60516 0.0000
## 4-2  -6.4821  -7.9033  -5.06083 0.0000
## 5-2  -5.6866  -7.1072  -4.26605 0.0000
## 6-2  -4.4707  -5.8913  -3.05016 0.0000
## 7-2   0.8016  -0.6189   2.22219 0.6398
## 4-3  -1.4550  -2.8776  -0.03238 0.0411
## 5-3  -0.6595  -2.0815   0.76240 0.8188
## 6-3   0.5564  -0.8656   1.97829 0.9109
## 7-3   5.8287   4.4068   7.25064 0.0000
## 5-4   0.7955  -0.6258   2.21670 0.6489
## 6-4   2.0113   0.5901   3.43259 0.0006
## 7-4   7.2837   5.8625   8.70495 0.0000
## 6-5   1.2159  -0.2047   2.63645 0.1506
## 7-5   6.4882   5.0677   7.90880 0.0000
## 7-6   5.2724   3.8518   6.69292 0.0000
&lt;/pre&gt;
Sunday is 1</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/9162947499509722180/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/12/the-most-dangerous-days-of-year.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/9162947499509722180?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/9162947499509722180?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/77U8weEvFHY/the-most-dangerous-days-of-year.html" title="The most dangerous days of the year" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-lFjHQ0_uqBY/UNcs3bQgFNI/AAAAAAAAF9Q/4-3ciPgNcRA/s72-c/text5544-4.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/12/the-most-dangerous-days-of-year.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkENQ3Y7eyp7ImA9WhNWEkU.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-5675835873659214170</id><published>2012-12-11T21:58:00.000-06:00</published><updated>2012-12-11T21:58:12.803-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-11T21:58:12.803-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><category scheme="http://www.blogger.com/atom/ns#" term="mortality-errors" /><title>Mexico's Drug War: 63,000 extra deaths in 6 years</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-KERkdsddYDQ/UMfKcVv8bII/AAAAAAAAF7M/wT-3-Wv9atw/s1600/path5216-7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="221" src="http://2.bp.blogspot.com/-KERkdsddYDQ/UMfKcVv8bII/AAAAAAAAF7M/wT-3-Wv9atw/s400/path5216-7.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Six years ago Felipe Calderón declared war on the drug cartels soon after taking office by sending troops to his home state of Michoacán. Six years later the war still rages on as Enrique Peña Nieto starts his term of office, and everyone is taking a look at the legacy of the man who started the war.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
There are newspapers and organizations that keep tallies of drug war-related deaths, which in itself is very laudable, but drug trafficking existed long before Calderón  came to office and it will exist long after he leaves. Plus, there is  also the issue that the government stopped publishing data on drug  war-related deaths after September 2011, and its numbers usually came out higher than the private estimates. &lt;br /&gt;
&lt;br /&gt;
To judge the events of the sexenio I'll focus first on counting the total number of homicides as accurately as possible for a blog post, then setting a baseline and counting the number of excess deaths. To start, there's the official &lt;a href="http://www.inegi.org.mx/est/contenidos/espanol/proyectos/continuas/vitales/bd/mortalidad/MortalidadGeneral.asp?s=est&amp;amp;c=11144"&gt;INEGI data&lt;/a&gt; and &lt;a href="http://www.secretariadoejecutivo.gob.mx/es/SecretariadoEjecutivo/Incidencia_Delictiva_Nacional_fuero_comun"&gt;SNSP data&lt;/a&gt; which everyone can access online. I'll order the INEGI homicides by date registered (instead of date of occurrence) and add firearm accidents since they: &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Have been increasing&amp;nbsp;&lt;/li&gt;
&lt;li&gt;As we saw in &lt;a href="http://blog.diegovalle.net/2011/11/how-mexican-state-ended-up-with-more.html"&gt;my last post&lt;/a&gt; sometimes they resemble homicides more than accidents. &lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;table border="0" cellspacing="0" cols="6"&gt; &lt;colgroup span="6" width="85"&gt;&lt;/colgroup&gt;  &lt;tbody&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="47"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;Year &lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;INEGI Homicides&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;Firearm Accidents&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;Unknown Intent&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;Imputed INEGI Homicides&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;SNSP Homicide&lt;br /&gt;
Reports†&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="17"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;2,004&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;9,328&lt;/td&gt;   &lt;td align="CENTER"&gt;366&lt;/td&gt;   &lt;td align="CENTER"&gt;2,957&lt;/td&gt;   &lt;td align="CENTER"&gt;10,339&lt;/td&gt;   &lt;td align="CENTER"&gt;11,658‡&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="17"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;2,005&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;9,918&lt;/td&gt;   &lt;td align="CENTER"&gt;271&lt;/td&gt;   &lt;td align="CENTER"&gt;2,932&lt;/td&gt;   &lt;td align="CENTER"&gt;10,942&lt;/td&gt;   &lt;td align="CENTER"&gt;11,255‡&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="17"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;2,006&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;10,449&lt;/td&gt;   &lt;td align="CENTER"&gt;265&lt;/td&gt;   &lt;td align="CENTER"&gt;2,793&lt;/td&gt;   &lt;td align="CENTER"&gt;11,414&lt;/td&gt;   &lt;td align="CENTER"&gt;11,775‡&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="17"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;2,007&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;8,864&lt;/td&gt;   &lt;td align="CENTER"&gt;699&lt;/td&gt;   &lt;td align="CENTER"&gt;2,376&lt;/td&gt;   &lt;td align="CENTER"&gt;10,205&lt;/td&gt;   &lt;td align="CENTER"&gt;10,253&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="17"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;2,008&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;14,005&lt;/td&gt;   &lt;td align="CENTER"&gt;555&lt;/td&gt;   &lt;td align="CENTER"&gt;2,567&lt;/td&gt;   &lt;td align="CENTER"&gt;15,246&lt;/td&gt;   &lt;td align="CENTER"&gt;13,193&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="17"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;2,009&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;19,804&lt;/td&gt;   &lt;td align="CENTER"&gt;456&lt;/td&gt;   &lt;td align="CENTER"&gt;2,920&lt;/td&gt;   &lt;td align="CENTER"&gt;21,065&lt;/td&gt;   &lt;td align="CENTER"&gt;16,117&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="17"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;2,010&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;25,757&lt;/td&gt;   &lt;td align="CENTER"&gt;630&lt;/td&gt;   &lt;td align="CENTER"&gt;3,594&lt;/td&gt;   &lt;td align="CENTER"&gt;27,508&lt;/td&gt;   &lt;td align="CENTER"&gt;20,681&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="17"&gt;&lt;b&gt;&lt;span style="font-family: Times New Roman;"&gt;2,011&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;27,212&lt;/td&gt;   &lt;td align="CENTER"&gt;&lt;span style="font-family: Times New Roman;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;5,630&lt;/td&gt;   &lt;td align="CENTER"&gt;&lt;span style="font-family: Times New Roman;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/td&gt;   &lt;td align="CENTER"&gt;22,487&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style="font-size: x-small;"&gt;† A homicide report may refer to more than one victim&lt;br /&gt;
‡ The State of Mexico was registering accidental deaths as if they were homicides&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Notice how deaths of unknown intent were on a downward trend up to 2008 when the trend reversed at the same time homicides surged. As I detailed in &lt;a href="http://blog.diegovalle.net/2012/11/mexicos-most-violent-cities-in-2011.html"&gt;this post&lt;/a&gt; and in my post about &lt;a href="http://blog.diegovalle.net/2012/07/machine-learning-for-better-homicide.html"&gt;classifying deaths of unknown intent in Ciudad Juárez &lt;/a&gt;they:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Statistically resemble homicides and&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Explain some of the difference in under-reported homicide deaths when compared with drug war-related homicides.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
To classify deaths of unknown intent I first recoded &lt;i&gt;legal intervention / operations of war&lt;/i&gt; deaths as homicides, I then excluded deaths  that occurred outside of Mexico. Because of the &lt;a href="http://blog.diegovalle.net/2012/09/more-errors-in-mexican-mortality.html"&gt;anomaly in the Federal District&lt;/a&gt; I recoded all accidental deaths during January and February of 2007 in this federate entity as unknown. In Sinaloa I recoded &lt;a href="http://blog.diegovalle.net/2011/11/how-mexican-state-ended-up-with-more.html"&gt;accidental deaths by firearm&lt;/a&gt;  as unknown as I detailed in my previous post. And in Baja California I set all firearm accidents as deaths of unknown intent in 2007.&lt;br /&gt;
&lt;br /&gt;
I still have lots of doubts about the vital statistics in Chiapas, but since it is not a state that has suffered the worst of the drug war I'll leave it alone. Also the mass graves found in Guerrero seem to be missing from the data (add another 100?), but I'll ignore it.  And in Tamaulipas even including deaths of unknown intent  under-counts drug war-related homicides, but again I'll ignore it (add about another 200-400?  homicides to my estimate). &lt;br /&gt;
&lt;br /&gt;
I used linear discriminant analysis and k-nearest neighbours classify each and every death  of unknown intent in the database (plus some accidents for the states I previously mentioned) taking into account the injury mechanism, and the age and sex of the victim. To make sure I wasn't overfitting the data I calculated the sensitivity ans specificity for each state or group of states (some states are pretty small):&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;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://1.bp.blogspot.com/-3cXrGPt-vCU/UMaDQFfW7YI/AAAAAAAAF6U/mqf042i1M04/s1600/surface2971.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="346" src="http://1.bp.blogspot.com/-3cXrGPt-vCU/UMaDQFfW7YI/AAAAAAAAF6U/mqf042i1M04/s400/surface2971.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;The accuracy refers to the overall accuracy of the classification of homicides, accidents and suicides. The sensitivity and specificity refer only to homicides&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
I could have used fancier algorithms to try and get  better classification performance, but the results were pretty good and I wanted something fast. Also take into account that since I have to use the raw data from the mortality database I only have data available up to 2010.&lt;br /&gt;
&lt;br /&gt;
Here's what the more accurate monthly homicide time series looks like:&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;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-VjDkaEqk_AI/UMfLCe_1KkI/AAAAAAAAF7U/-uRRFytVZtE/s1600/Rplot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="335" src="http://4.bp.blogspot.com/-VjDkaEqk_AI/UMfLCe_1KkI/AAAAAAAAF7U/-uRRFytVZtE/s400/Rplot.png" width="400" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
I used an ARIMA(0,1,1)(1,1,0)[12] regression on the monthly SNSP police  reports to predict the INEGI homicides + firearm accidents + the deaths  of unknown intent imputed to be homicides from January 2012 to November  2012 since no vital statistics data is available after 2011.&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://4.bp.blogspot.com/-wY9jFr8cKyA/UMftm3oaYoI/AAAAAAAAF78/Sits4AqLLxE/s1600/extra.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="250" src="http://4.bp.blogspot.com/-wY9jFr8cKyA/UMftm3oaYoI/AAAAAAAAF78/Sits4AqLLxE/s400/extra.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;Do note the increase in Tamaulipas&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
For the baseline estimate of the number of deaths I simply used the average monthly deaths from January 2004 to November 2006 (increasing at 1% per year), I then substracted or added the total number of imputed deaths from the baseline estimate (some homicides were surely prevented by the drug war in the beginning stages) to obtain the excess deaths. The total excess imputed homicides for the Calderón sexenio was of 63,000 (61,000-66,000 95% CI), I rounded the numbers to the nearest multiple of 1,000 since it doesn't make any sense to report the number with much accuracy.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-KERkdsddYDQ/UMfKcVv8bII/AAAAAAAAF7M/wT-3-Wv9atw/s1600/path5216-7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="221" src="http://2.bp.blogspot.com/-KERkdsddYDQ/UMfKcVv8bII/AAAAAAAAF7M/wT-3-Wv9atw/s400/path5216-7.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
There are a number of problems with my estimate:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;I used data on police reports from the SNSP, but if I used drug war homicide data from &lt;a href="http://www.milenio.com/cdb/doc/noticias2011/7d97ccec10baf5f29e3d096cff54a3ea"&gt;Milenio&lt;/a&gt; I would have goten much higher estimates since deaths during the first eleven months of each year &lt;b&gt;increased&lt;/b&gt; from 11,343 in 2011 to 11,412 in 2012.&lt;/li&gt;
&lt;li&gt;The more or less arbitrary baseline is open to criticism. According to the Secretary of Interior Alejandro Poiré they found a country &lt;a href="http://www.elindependiente.mx/noticias/?idNota=9736"&gt;"infested by rats"&lt;/a&gt;. Calderón supporters would put the baseline much much higher than the one I used, though I have the feeling this is just an ad-hoc justification since they never provided any evidence for this. Then there is also the fact that the government considers most of the dead to have been criminals, so we have the president (in)famously stating "&lt;a href="http://www.hrw.org/news/2011/05/26/monster-and-monterrey"&gt;If you see dust in the air, it's because we're cleaning house,"&lt;/a&gt;&amp;nbsp;supporters of the war would argue that those who lost their lives in a certain way deserved their fate.&lt;/li&gt;
&lt;li&gt;Saying that Mexico was on the verge of a drug war before the president took office is not the only view since each generation of Mexicans was &lt;a href="http://blog.diegovalle.net/2012/10/age-period-cohort-models-and-decline-of.html"&gt;becoming less violent&amp;nbsp;before the drug war&lt;/a&gt; (though with important &lt;a href="http://3.bp.blogspot.com/-_Y4BX2ZUJGc/UHOaFNPdOfI/AAAAAAAAFpM/h8JRVj1WSDo/s1600/flowRoot3806.png"&gt;period effects&lt;/a&gt;), and Mexico had had episodes of localized drug violence before in &lt;a href="http://4.bp.blogspot.com/_q3Caf3YFFAs/TFwxvePIh8I/AAAAAAAAES4/8Oe4cwGvNzQ/s1600/cd.juarez-historic.png"&gt;mid-ninties in Ciudad Juárez&lt;/a&gt; and at the turn of the century in Tijuana without plunging into a extended drug war, so maybe the baseline is set too high. &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
I'm still missing mass graves that haven't been found, and bodies that simply disappeared without leaving a trace.&amp;nbsp; One could &lt;a href="http://www.stat.duke.edu/~kcl12/Human%20Rights_files/academic-paper.pdf"&gt;combine the various lists of disappeared&lt;/a&gt; kept by the PGR and SSP to produce an estimate of the number of missing persons in Mexico, but you would still have to match them somehow to the mortality datase since many o the dead are never fully identified. This means my estimate is a lower limit.&lt;br /&gt;
&lt;br /&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/5675835873659214170/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/12/mexicos-drug-war-63000-extra-deaths-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5675835873659214170?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5675835873659214170?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/fUVnPUN4KlQ/mexicos-drug-war-63000-extra-deaths-in.html" title="Mexico's Drug War: 63,000 extra deaths in 6 years" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-KERkdsddYDQ/UMfKcVv8bII/AAAAAAAAF7M/wT-3-Wv9atw/s72-c/path5216-7.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/12/mexicos-drug-war-63000-extra-deaths-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMERnY8eyp7ImA9WhNXF0s.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-7710228755983952914</id><published>2012-12-05T21:59:00.000-06:00</published><updated>2012-12-05T22:00:07.873-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-05T22:00:07.873-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><category scheme="http://www.blogger.com/atom/ns#" term="mortality-errors" /><category scheme="http://www.blogger.com/atom/ns#" term="R" /><title>How a Mexican state ended up with more drug war homicides than total homicides</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-8cVSAdiqkq0/UL9pKdSXsvI/AAAAAAAAF5s/q35vQF7ibUY/s1600/diffplot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://1.bp.blogspot.com/-8cVSAdiqkq0/UL9pKdSXsvI/AAAAAAAAF5s/q35vQF7ibUY/s400/diffplot.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
During 2007 and 2008 the Mexican &lt;a href="http://www.diegovalle.net/drug-war-map.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=5&amp;amp;homtype=INEGI&amp;amp;clat=27.876578730659567&amp;amp;clong=-107.4583740234375&amp;amp;polygon=-109.51171875+25.893820362797484%2C-108.3306884765625+27.010196431931526%2C-107.1551513671875+25.591994180254712%2C-107.1002197265625+25.010950810695284%2C-106.3916015625+24.191858272317656%2C-106.182861328125+24.347096633808512%2C-105.6719970703125+23.34729931216778%2C-105.5126953125+23.115101554603044%2C-105.46875+22.61908160971607%2C-105.732421875+22.512556954051437%2C-107.984619140625+24.1367281697474%2C-109.6270751953125+25.710836919640595%2C-109.51171875+25.893820362797484"&gt;state of Sinaloa&lt;/a&gt; had more drug war-related homicides than total homicides. This should in theory be impossible since drug war homicides are a subset of total homicides. How did this happen? &lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;Here is a chart from &lt;a href="http://blog.diegovalle.net/2011/02/strengths-and-weaknesses-of-crime-data.html"&gt;my old post highlighting the monthly difference between the vital statistics data and drug war-related homicides (Dec 2006- Dec 2009)&lt;/a&gt;:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/_q3Caf3YFFAs/TVK65KW6OZI/AAAAAAAAEpc/p5Fji8Jnefs/s1600/drh-vs-inegi-recent.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="280" src="http://4.bp.blogspot.com/_q3Caf3YFFAs/TVK65KW6OZI/AAAAAAAAEpc/p5Fji8Jnefs/s400/drh-vs-inegi-recent.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Just two weeks ago &lt;a href="http://www.notinfomex.info/2012/11/localizan-ocho-cuerpos-ejecutado-y.html"&gt;8 bodies were found in Sinaloa&lt;/a&gt;, I can only image how difficult it must be to determine the exact dates the  homicides occurred in some cases. So it's not a big deal if a month ends  up having 5 or so extra drug war homicides than total homicides. But when drug homicides exceed total homicides for a year and a half as it did in Sinaloa, you know  something is wrong.&lt;br /&gt;
&lt;br /&gt;
Most homicides in Sinaloa are caused by firearms, and given the &lt;a href="http://blog.diegovalle.net/2010/12/some-problems-with-mexican-mortality.html"&gt;other&lt;/a&gt; &lt;a href="http://blog.diegovalle.net/2012/09/more-errors-in-mexican-mortality.html"&gt;errors&lt;/a&gt; in the mortality database it seems one should look if the discrepancy in the numbers lie in an excess of firearm deaths.&lt;br /&gt;
&lt;br /&gt;
Here's a table of the yearly vital statistics data on homicides, firearm accidents and drug war-related homicides:&lt;br /&gt;
&lt;br /&gt;
&lt;table border="2" cellpadding="6" cellspacing="0" frame="hsides" rules="groups"&gt;&lt;caption&gt; &lt;/caption&gt;  &lt;colgroup&gt;&lt;col class="right"&gt;&lt;/col&gt;&lt;col class="right"&gt;&lt;/col&gt;&lt;col class="left"&gt;&lt;/col&gt;&lt;col class="right"&gt;&lt;/col&gt;  &lt;/colgroup&gt;  &lt;tbody&gt;
&lt;tr&gt;&lt;td class="right"&gt;&lt;b&gt;Year&lt;/b&gt;&lt;/td&gt;&lt;td class="right"&gt;&lt;b&gt;All Homicides&lt;/b&gt;&lt;/td&gt;&lt;td class="left"&gt;&lt;b&gt;Drug-Related&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Homicides&lt;/b&gt;&lt;/td&gt;&lt;td class="right"&gt;&lt;b&gt;Accidental&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Firearm Deaths&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="right"&gt;2004&lt;/td&gt;&lt;td class="right"&gt;387&lt;/td&gt;&lt;td class="left"&gt;NA&lt;/td&gt;&lt;td class="right"&gt;61&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="right"&gt;2005&lt;/td&gt;&lt;td class="right"&gt;450&lt;/td&gt;&lt;td class="left"&gt;NA&lt;/td&gt;&lt;td class="right"&gt;47&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="right"&gt;2006&lt;/td&gt;&lt;td class="right"&gt;451&lt;/td&gt;&lt;td class="left"&gt;NA&lt;/td&gt;&lt;td class="right"&gt;26&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="right"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;2007&lt;/span&gt;&lt;/td&gt;&lt;td class="right"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;387&lt;/span&gt;&lt;/td&gt;&lt;td class="left"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;426&lt;/span&gt;&lt;/td&gt;&lt;td class="right"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;204&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="right"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;2008&lt;/span&gt;&lt;/td&gt;&lt;td class="right"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;869&lt;/span&gt;&lt;/td&gt;&lt;td class="left"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;1,084&lt;/span&gt;&lt;/td&gt;&lt;td class="right"&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;198&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="right"&gt;2009&lt;/td&gt;&lt;td class="right"&gt;1,422&lt;/td&gt;&lt;td class="left"&gt;1,059&lt;/td&gt;&lt;td class="right"&gt;36&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="right"&gt;2010&lt;/td&gt;&lt;td class="right"&gt;2,277&lt;/td&gt;&lt;td class="left"&gt;1,815&lt;/td&gt;&lt;td class="right"&gt;67†&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;  &lt;/table&gt;
&lt;span style="font-size: x-small;"&gt;† Preliminary estimates undercounted by about 6%&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #222222; font-family: arial,sans-serif; font-size: x-small;"&gt;&lt;span style="line-height: 16px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;
I highlighted the years where drug homicides exceeded all homicides. As you can see the anomalous years also had an extremely high number of firearm accidents (I used the &lt;a href="http://www.cdc.gov/nchs/injury/ice/matrix10.htm"&gt;External Cause of Injury Mortality Matrix&lt;/a&gt; for ICD-10 to code accidents by firearm) &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="http://1.bp.blogspot.com/-aduxS_YGljQ/UL1L_FAcO2I/AAAAAAAAF4M/hD7jv0btDlY/s1600/drh_firearm-acc_hom.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://1.bp.blogspot.com/-aduxS_YGljQ/UL1L_FAcO2I/AAAAAAAAF4M/hD7jv0btDlY/s400/drh_firearm-acc_hom.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
In fact, there's a very high correlation when looking at the unexplained drug homicides (the drug homicides left over when we substract the drug war-related homicides from the total homicides) and firearm accidents, but only during the anomalous years:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-8cVSAdiqkq0/UL9pKdSXsvI/AAAAAAAAF5s/q35vQF7ibUY/s1600/diffplot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://1.bp.blogspot.com/-8cVSAdiqkq0/UL9pKdSXsvI/AAAAAAAAF5s/q35vQF7ibUY/s400/diffplot.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
I don't think there can be any doubt that at least some of deaths by firearm accident correspond to those in the drug-war related homicide database during 2007 and 2008. Now the question is whether they are really homicides or accidents.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
It seems natural that firearm accidents would rise along with homicides as the drug war ratcheted up, since an escalation of violence would involve hiring newer, less experienced gunmen. As you'd expect the newer gunmen were not the&amp;nbsp;brightest&amp;nbsp;bulbs in the box. But even for dumb cartel gunmen I'm surprised by the sudden increase in accidents and the sudden drop after 2008.&amp;nbsp;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
There's also the fact that the police and government authorities are under much more pressure to bring down the number of homicides than the number of accidents. For all these reasons I think it is much more likely that at least some homicides were misclassified as accidents, and that this explains part of the discrepancy during 2007 and 2008.&lt;/div&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="315" src="http://www.youtube.com/embed/Gw5fGGSfSFg" width="420"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;span style="font-size: x-small;"&gt;As funny as I find this, it probably didn't happen in Sinaloa in 2007 and 2008&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
What I'll do to find out whether the deaths were accidents or homicides is to first ignore the classification specified in the mortality database for all firearm accidents from January 2007 to December 2008. Then use machine learning to see if the characteristics of the original firearm accidents  (sex, age, place of occurrence, etc) are sufficient to separate them into homicides and accidents.&lt;br /&gt;
&lt;br /&gt;
Homicides in Sinaloa tend to occur on public streets:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-h1V15ZoeV3Q/UL1MnFXDxrI/AAAAAAAAF4c/0nh2-d5Okc4/s1600/homicide-place.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://4.bp.blogspot.com/-h1V15ZoeV3Q/UL1MnFXDxrI/AAAAAAAAF4c/0nh2-d5Okc4/s400/homicide-place.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
However, accidentals deaths tend to occur all over the place except for 2007 and 2008 when there were a lot accidents on public streets (surprise, surprise):&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Y44GbrPdrUY/UL1MPHOyx8I/AAAAAAAAF4U/mTn2bng1xbc/s1600/accident-place.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://2.bp.blogspot.com/-Y44GbrPdrUY/UL1MPHOyx8I/AAAAAAAAF4U/mTn2bng1xbc/s400/accident-place.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Once we ignore the firearm accidents that occurred in 2007 and 2008 there are very few accidentals deaths by firearm in Sinaloa, and since the more data the better, I used all 1,834 firearms accidents in the rest of Mexico (excluding Chiapas because its vital statistics are a mess) together with all homicides and accidents by firearm in Sinaloa (excluding 2007 and 2008 obviously) to train a classifier. &lt;br /&gt;
&lt;br /&gt;
There are still some unresolved problems with this approach since the state of Baja California went from having 6 deaths by firearm in 2006, to 100 in  2007, to 6 again in 2008, in comparison homicides went from 303 in 2006 down to 243 in 2007. This could imply that Sinaloa is not the only  state with mortality misclassifications and underlines just how difficult  it is to get training data (I ignored any possible errors in the rest of  the country for classifying the data)&lt;br /&gt;
&lt;br /&gt;
I ended up using the age, sex, place of occurrence of the injury, year of death, marital status and whether an autopsy was perfomed as the variables (including their interactions) in a penalized logistic regression to separate homicides from accidents. To avoid overfitting I separeted 30% of the data into a test dataset.&lt;br /&gt;
&lt;br /&gt;
These are the results of &lt;a href="http://en.wikipedia.org/wiki/Cross-validation_(statistics)"&gt;crossvalidating&lt;/a&gt; on the test database: &lt;br /&gt;
&lt;pre&gt;           Reference
Prediction Accident Homicide
  Accident      193       82
  Homicide      166      933
                                          
               Accuracy : 0.8195          
                 95% CI : (0.7981, 0.8395)
    No Information Rate : 0.7387          
    P-Value [Acc &amp;gt; NIR] : 8.951e-13       
                                          
                  Kappa : 0.4942          
 Mcnemar's Test P-Value : 1.360e-07       
                                          
            &lt;b&gt;Sensitivity : 0.5376          
           Specificity : 0.9192&lt;/b&gt;         
         Pos Pred Value : 0.7018          
         Neg Pred Value : 0.8490          
             Prevalence : 0.2613          
         Detection Rate : 0.1405          
   Detection Prevalence : 0.2001          
                                          
       'Positive' Class : Accident  
&lt;/pre&gt;
&lt;br /&gt;
Specificity measures the proportion of homicides which were correctly identified, which in this case is more important than misclassified accidents (sensitivity), since I'm trying to prove that the accidents are really homicides. With a specificity of 92% we can be pretty certain that a homicide classified as such is actually a homicide, but with a sensitivity of only 54% we might as well flip a coin when determining how certain we are that an accident is actually an accident. With such a low sensitivity we can consider the number of homicides in the table below as a sort of lower limit.&lt;br /&gt;
&lt;br /&gt;
&lt;table border="0" cellspacing="0" cols="3"&gt; &lt;colgroup span="3" width="85"&gt;&lt;/colgroup&gt;  &lt;tbody&gt;
&lt;tr&gt;   &lt;td align="LEFT" height="16"&gt;&lt;b&gt;Year&lt;/b&gt;&lt;/td&gt;   &lt;td align="LEFT"&gt;&lt;b&gt;Imputed Intent &lt;/b&gt;&lt;/td&gt;   &lt;td align="LEFT"&gt;&lt;b&gt;Number of Deaths&lt;/b&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="RIGHT" height="16"&gt;2007&lt;/td&gt;   &lt;td align="LEFT"&gt;Accident&lt;/td&gt;   &lt;td align="RIGHT"&gt;61&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="RIGHT" height="16"&gt;2007&lt;/td&gt;   &lt;td align="LEFT"&gt;Homicide&lt;/td&gt;   &lt;td align="RIGHT"&gt;143&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="RIGHT" height="16"&gt;2008&lt;/td&gt;   &lt;td align="LEFT"&gt;Accident&lt;/td&gt;   &lt;td align="RIGHT"&gt;20&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td align="RIGHT" height="16"&gt;2008&lt;/td&gt;   &lt;td align="LEFT"&gt;Homicide&lt;/td&gt;   &lt;td align="RIGHT"&gt;178&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
The result of classifying the 204 and 198 firearm accidents in 2007 and 2008.&lt;br /&gt;
&lt;br /&gt;
As you can see the data looks much more  reasonable now, though in 2008 there were still more drug homicides than  total homicides, which may have been because some homicides were registered as accidents by a cause other than firearm (in around 23% of accidents the cause is left unspecified). When it comes to violence in Mexico it seems we watch shadows projected on a cave's wall.&lt;br /&gt;
&lt;br /&gt;
Given that the sudden increase in homicides coincided with the end and start of a new year there may have been some sort of law or some legal means that made it ok to classify a homicide as an accident but that is just a matter of &lt;a href="http://www.brainyquote.com/quotes/quotes/a/abrahamlin125047.html"&gt;calling a tail a leg.&lt;/a&gt; But at this point I'm just speculating as to possible motives for recording a homicide as an accident, so I'll stop.&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
I can't confitm anything. There's something to what you ask, but I can't confirm anything. We have to perfom tests, you'll have the data later. What we know is that it was an accident, but a very strange one because the body was dumped at the public hospital where he died. &lt;br /&gt;
&lt;div style="text-align: right;"&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;—&lt;/span&gt;&lt;a href="http://www.riodoce.com.mx/index.php?option=com_content&amp;amp;task=view&amp;amp;id=11565"&gt;Jesús Antonio Aguilar Íñiguez, Chief of Sinaloa's Investigative Police&lt;/a&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
No te puedo confirmar nada. Algo  hay de lo que preguntas, pero no te puedo confirmar nada. Faltan  pruebas periciales por realizar, después tendrás los datos. Lo que  sabemos es que es un accidente, pero muy raro porque el cuerpo fue  arrojado en el Seguro Social y ahí murió&lt;br /&gt;
&lt;div style="text-align: right;"&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;—&lt;/span&gt;&lt;a href="http://www.riodoce.com.mx/index.php?option=com_content&amp;amp;task=view&amp;amp;id=11565"&gt;Jesús Antonio Aguilar Íñiguez, jefe de la Policía Ministerial del Estado&lt;/a&gt;&lt;/div&gt;
&lt;/blockquote&gt;
P.S. The data and code are available from my &lt;a href="https://github.com/diegovalle/sinaloa-discrepancy"&gt;GitHub&lt;/a&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/7710228755983952914/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2011/11/how-mexican-state-ended-up-with-more.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/7710228755983952914?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/7710228755983952914?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/P-9hskpiTcM/how-mexican-state-ended-up-with-more.html" title="How a Mexican state ended up with more drug war homicides than total homicides" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-8cVSAdiqkq0/UL9pKdSXsvI/AAAAAAAAF5s/q35vQF7ibUY/s72-c/diffplot.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2011/11/how-mexican-state-ended-up-with-more.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUMRX45fCp7ImA9WhNXF0s.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-3944094605380148085</id><published>2012-11-26T22:33:00.000-06:00</published><updated>2012-12-05T21:58:04.024-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-05T21:58:04.024-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><category scheme="http://www.blogger.com/atom/ns#" term="mortality-errors" /><title>Mexico's most violent cities in 2011</title><content type="html">&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://1.bp.blogspot.com/-krJkdyc8IE8/ULLHxHcvRtI/AAAAAAAAFwE/GoQF8RhaTY8/s1600/cities.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="640" src="http://1.bp.blogspot.com/-krJkdyc8IE8/ULLHxHcvRtI/AAAAAAAAFwE/GoQF8RhaTY8/s640/cities.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;Note the log scale and that data are incomplete&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
The &lt;a href="http://www.inegi.org.mx/est/contenidos/espanol/proyectos/continuas/vitales/bd/mortalidad/MortalidadGeneral.asp?s=est&amp;amp;c=11144"&gt;INEGI&lt;/a&gt; finally released homicide data at the municipality level, analyzing it by state turned out very similar results to the preliminary data released back in August, so I won't repeat the&lt;a href="http://blog.diegovalle.net/2012/08/preliminary-homicide-data-for-2011.html"&gt; state level charts&lt;/a&gt; I did back then, instead I will focus on the trends in violence at the metro area or big municipality level since both Tijuana and Ciudad Juárez had big declines in homicides &lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;—&lt;/span&gt;though they are still very violent&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;—&lt;/span&gt; and Monterrey, Acapulco and Veracruz saw big increases.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
As I &lt;a href="http://blog.diegovalle.net/2012/07/machine-learning-for-better-homicide.html"&gt;previously wrote&lt;/a&gt; there have been a lot deaths of unknown intent with characteristics similar to homicides since the drug war started, and 2011 was no exception: Coahuila went from registering 2 deaths of unknown intent in 2009 to 216 in 2011, Veracruz went from 197 to 747, Chiapas went from 2 to 614, Tamaulipas had 195 in 2011, and &lt;span style="background-color: #ffd966;"&gt;&lt;b&gt;Mexico as a whole went from registering 2,376 deaths of unknown intent in 2007 to 5,630 in 2011&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We can also compare the number of homicides to the number of deaths in the recently cancelled drug war-related homicide database (only including the first 9 moths of 2011) to find out which states had more drug war deaths than total homicides, which in theory should be impossible&lt;br /&gt;
&lt;br /&gt;
&lt;table border="1"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;State &lt;/th&gt; &lt;th&gt;Year &lt;/th&gt; &lt;th&gt;Drug War-&lt;br /&gt;
Related Homicides &lt;/th&gt; &lt;th&gt;Homicides&lt;/th&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Coahuila &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;572 &lt;/td&gt; &lt;td style="text-align: center;"&gt;478 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Sinaloa &lt;/td&gt; &lt;td align="right"&gt;2007 &lt;/td&gt; &lt;td style="text-align: center;"&gt;414 &lt;/td&gt; &lt;td style="text-align: center;"&gt;388 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Sinaloa &lt;/td&gt; &lt;td align="right"&gt;2008 &lt;/td&gt; &lt;td style="text-align: center;"&gt;1084 &lt;/td&gt; &lt;td style="text-align: center;"&gt;871 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Tamaulipas &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;1209 &lt;/td&gt; &lt;td style="text-align: center;"&gt;1011 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Tamaulipas &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;1108 &lt;/td&gt; &lt;td style="text-align: center;"&gt;830 &lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;!-- html table generated in R 2.15.2 by xtable 1.7-0 package --&gt;One can also look at the data disaggregated by metro area or municipality (only showing those cities where drug war-related homicides exceeded all homicides by at least 15)&lt;br /&gt;
&lt;!-- Sun Nov 25 16:20:18 2012 --&gt;&lt;br /&gt;
&lt;table border="1"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;City&lt;/th&gt; &lt;th&gt;Year &lt;/th&gt; &lt;th&gt;Drug War-&lt;br /&gt;
Related Homicides &lt;/th&gt; &lt;th&gt;Homicides &lt;/th&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Culiacán-Navolato &lt;/td&gt; &lt;td align="right"&gt;2008 &lt;/td&gt; &lt;td style="text-align: center;"&gt;654 &lt;/td&gt; &lt;td style="text-align: center;"&gt;460 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Culiacán-Navolato &lt;/td&gt; &lt;td align="right"&gt;2007 &lt;/td&gt; &lt;td style="text-align: center;"&gt;271 &lt;/td&gt; &lt;td style="text-align: center;"&gt;131 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;San Fernando, Tamps &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;292 &lt;/td&gt; &lt;td style="text-align: center;"&gt;159 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;La Laguna &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;633 &lt;/td&gt; &lt;td style="text-align: center;"&gt;509 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Veracruz &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;261 &lt;/td&gt; &lt;td style="text-align: center;"&gt;164 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Valle Hermoso, Tamps &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;95 &lt;/td&gt; &lt;td style="text-align: center;"&gt;14 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Reynosa &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;154 &lt;/td&gt; &lt;td style="text-align: center;"&gt;92 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Miguel Alemán, Tamps &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;110 &lt;/td&gt; &lt;td style="text-align: center;"&gt;58 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Mier, Tamps &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;93 &lt;/td&gt; &lt;td style="text-align: center;"&gt;42 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Guerrero, Tamps &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;45 &lt;/td&gt; &lt;td style="text-align: center;"&gt;0 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;San Fernando, Tamps &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;169 &lt;/td&gt; &lt;td style="text-align: center;"&gt;130 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Taxco de Alarcón, Gro &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;75 &lt;/td&gt; &lt;td style="text-align: center;"&gt;38 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;La Laguna &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;704 &lt;/td&gt; &lt;td style="text-align: center;"&gt;673 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Mier, Tamps &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;50 &lt;/td&gt; &lt;td style="text-align: center;"&gt;19 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Morelia &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;104 &lt;/td&gt; &lt;td style="text-align: center;"&gt;78 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Ahumada, Chih &lt;/td&gt; &lt;td align="right"&gt;2009 &lt;/td&gt; &lt;td style="text-align: center;"&gt;27 &lt;/td&gt; &lt;td style="text-align: center;"&gt;4 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Guerrero, Tamps &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;35 &lt;/td&gt; &lt;td style="text-align: center;"&gt;12 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Gustavo Díaz Ordaz, Tamps &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;25 &lt;/td&gt; &lt;td style="text-align: center;"&gt;7 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Jiménez, Chih &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;47 &lt;/td&gt; &lt;td style="text-align: center;"&gt;30 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Cosalá, Sin &lt;/td&gt; &lt;td align="right"&gt;2011 &lt;/td&gt; &lt;td style="text-align: center;"&gt;25 &lt;/td&gt; &lt;td style="text-align: center;"&gt;8 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Salvador Alvarado, Sin &lt;/td&gt; &lt;td align="right"&gt;2008 &lt;/td&gt; &lt;td style="text-align: center;"&gt;47 &lt;/td&gt; &lt;td style="text-align: center;"&gt;31 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;strike&gt;Sáric, Son &lt;/strike&gt;&lt;/td&gt; &lt;td align="right"&gt;&lt;strike&gt;2010 &lt;/strike&gt;&lt;/td&gt; &lt;td style="text-align: center;"&gt;&lt;strike&gt;30 &lt;/strike&gt;&lt;/td&gt; &lt;td style="text-align: center;"&gt;&lt;strike&gt;14 &lt;/strike&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Camargo, Tamps &lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td style="text-align: center;"&gt;30 &lt;/td&gt; &lt;td style="text-align: center;"&gt;15 &lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
*Saric, Sonora has been crossed out because the deaths were registered in &lt;a href="http://www.diegovalle.net/drug-war-map.html#city=Tubutama%2C+Sonora&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=30.721636319197138&amp;amp;clong=-110.97125244140625"&gt;Tubutama&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
With so many missing deaths I've opted to watermark the plots with a text that says 'incomplete data' since I could probably get better estimates by &lt;a href="http://blog.diegovalle.net/2012/07/machine-learning-for-better-homicide.html"&gt;classifying the deaths of unknown intent&lt;/a&gt;, but I need access to the raw data which is not available yet. In the plot at the top of the blog Tuxtla is the safest city, but with 112 deaths of unknown intent and only 10 homicides this is extremely likely to be wrong.&lt;br /&gt;
&lt;br /&gt;
By looking at the metro area homicide numbers you can miss diverging municipality level trends, so for La Laguna and Mexico City I've plotted the data grouped by state.&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;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://4.bp.blogspot.com/-_0m1zROlowQ/ULPNgjSsjXI/AAAAAAAAFyI/OtIhokJ_TCk/s1600/Rplot11.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="223" src="http://4.bp.blogspot.com/-_0m1zROlowQ/ULPNgjSsjXI/AAAAAAAAFyI/OtIhokJ_TCk/s400/Rplot11.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;The model is loess &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Since inside a metro area people travel all around the city it is more 
important to focus on the trend rather than the levels. In Mexico City the increase in homicides has been much more marked in the State of Mexico than in the Federal District, mostly due to trends in Ecatepec and Neza.&lt;br /&gt;
&lt;br /&gt;
In La Laguna violence in the part of the city situated in Coahuila (mainly Torreón) increased while violence in the Durango part decreased (mainly Gomez Palacio)&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;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://3.bp.blogspot.com/-JLjuvCH6O_c/ULPNlhpScaI/AAAAAAAAFyQ/oU_55VdAfNc/s1600/Rplot10.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="223" src="http://3.bp.blogspot.com/-JLjuvCH6O_c/ULPNlhpScaI/AAAAAAAAFyQ/oU_55VdAfNc/s400/Rplot10.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;The model is loes &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Cities that saw big decreases in violence:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-kKcdfoXPhxM/ULJ0CdEENfI/AAAAAAAAFvI/Im-4Gi_vUEA/s1600/Rplot01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="270" src="http://4.bp.blogspot.com/-kKcdfoXPhxM/ULJ0CdEENfI/AAAAAAAAFvI/Im-4Gi_vUEA/s400/Rplot01.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Cities that saw increases in violence:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-VK3hoSvyKMo/ULJ0Gd8jmSI/AAAAAAAAFvQ/EQ-XZAx0FjY/s1600/Rplot02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="270" src="http://1.bp.blogspot.com/-VK3hoSvyKMo/ULJ0Gd8jmSI/AAAAAAAAFvQ/EQ-XZAx0FjY/s400/Rplot02.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Cities where the homicide rate didn't vary much:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-l2IBYh9n8Fg/ULN0tWKWFBI/AAAAAAAAFwo/pqKVy9WtsSs/s1600/Rplot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" src="http://3.bp.blogspot.com/-l2IBYh9n8Fg/ULN0tWKWFBI/AAAAAAAAFwo/pqKVy9WtsSs/s400/Rplot.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
And the obligatory map:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-oC29GRPLNuo/ULJ0PYXT5LI/AAAAAAAAFvg/y_04dDmbqt4/s1600/Rplot04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" src="http://3.bp.blogspot.com/-oC29GRPLNuo/ULJ0PYXT5LI/AAAAAAAAFvg/y_04dDmbqt4/s400/Rplot04.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/3944094605380148085/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/11/mexicos-most-violent-cities-in-2011.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/3944094605380148085?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/3944094605380148085?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/0pThRHzsrEg/mexicos-most-violent-cities-in-2011.html" title="Mexico's most violent cities in 2011" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-krJkdyc8IE8/ULLHxHcvRtI/AAAAAAAAFwE/GoQF8RhaTY8/s72-c/cities.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/11/mexicos-most-violent-cities-in-2011.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AASH0yfCp7ImA9WhNQFEg.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-4477600829083437372</id><published>2012-11-20T18:54:00.000-06:00</published><updated>2012-11-20T19:02:29.394-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-20T19:02:29.394-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><title>Mexico's most dangerous cities for women</title><content type="html">&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;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-0CVd6g5PsHY/UKwi-qAsZPI/AAAAAAAAFtw/uwSoDbwRwrM/s1600/agerates.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-0CVd6g5PsHY/UKwi-qAsZPI/AAAAAAAAFtw/uwSoDbwRwrM/s400/agerates.png" width="315" /&gt;&lt;/a&gt;&lt;/div&gt;
Before the drug war the metro area of Toluca was by far the most violent city in Mexico for females and not Ciudad Juarez as commonly believed, in fact, when cities are ranked by their age-adjusted homicide rates from 1990 to 2006 (right before the drug war started) Juárez was not much more violent than Mexico City (Valle de México in the chart). &lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;To construct the list I used the metropolitan areas as definied by the INEGI plus a made up metro area of the municipalities of Culiacán and Navolato, I also included municipalities like Durango which are not part of a metro area but have a population of more than 400,000.&lt;br /&gt;
&lt;br /&gt;
Since violence in Mexico was &lt;a href="http://blog.diegovalle.net/2012/10/age-period-cohort-models-and-decline-of.html"&gt;declining before the drug war&lt;/a&gt; it is also worthwhile to take a look at the yearly rates:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-nPqIer8oa0k/UKwUtnHU3fI/AAAAAAAAFs0/CzDrTGL57uc/s1600/metro-smallmultiples.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291" src="http://3.bp.blogspot.com/-nPqIer8oa0k/UKwUtnHU3fI/AAAAAAAAFs0/CzDrTGL57uc/s400/metro-smallmultiples.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Notice how if we look at the drug war years Toluca actually had a lower female homicide rate than Monterrey in 2010, which used to be the safest metro area in Mexico.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-16DOOMXuh3U/UKwU1YX0_2I/AAAAAAAAFs8/piJpbekCMiM/s1600/homicides-mas.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://4.bp.blogspot.com/-16DOOMXuh3U/UKwU1YX0_2I/AAAAAAAAFs8/piJpbekCMiM/s400/homicides-mas.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="http://2.bp.blogspot.com/-tscqyjaups0/UKwi2LpzX6I/AAAAAAAAFto/d_F4r23gNCU/s1600/agerates.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-tscqyjaups0/UKwi2LpzX6I/AAAAAAAAFto/d_F4r23gNCU/s400/agerates.png" width="315" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/4477600829083437372/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/11/mexicos-most-dangerous-cities-for-women.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/4477600829083437372?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/4477600829083437372?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/154I301xxqs/mexicos-most-dangerous-cities-for-women.html" title="Mexico's most dangerous cities for women" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-0CVd6g5PsHY/UKwi-qAsZPI/AAAAAAAAFtw/uwSoDbwRwrM/s72-c/agerates.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/11/mexicos-most-dangerous-cities-for-women.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4BRHo7eSp7ImA9WhJaGE8.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-1193978971598604354</id><published>2012-10-09T19:12:00.000-05:00</published><updated>2012-10-09T19:12:35.401-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-09T19:12:35.401-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><category scheme="http://www.blogger.com/atom/ns#" term="R" /><title>Age-Period-Cohort models and the decline of violence</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ZTUlPRR5js4/UHRRr1ZXkpI/AAAAAAAAFp0/D5U67n3lDPM/s1600/Rplot04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" src="http://2.bp.blogspot.com/-ZTUlPRR5js4/UHRRr1ZXkpI/AAAAAAAAFp0/D5U67n3lDPM/s400/Rplot04.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Ever since the end of the Mexican Revolution and the Cristero War violence in Mexico inched down in fits and starts from a high of about &lt;a href="http://www.mexicomaxico.org/Voto/Homicidios100M.htm"&gt;60 homicides per 100,000 people&lt;/a&gt; to its lowest level sometime during the middle of the last decade (there's some &lt;a href="http://blog.diegovalle.net/2012/09/more-errors-in-mexican-mortality.html"&gt;uncertainty about the number of homicides in 2007&lt;/a&gt;). Then, the drug war happened and the homicide rate shot straight up.&lt;br /&gt;
&lt;br /&gt;
After reading &lt;i&gt;The Better Angels of Our Nature: Why Violence Has Declined&lt;/i&gt;, by Steven Pinker, and looking at &lt;a href="http://www2.warwick.ac.uk/fac/arts/history/postgraduate/ma_studies/mamodules/hi971/topics/interpersonal/long-term-historical-trends-of-violent-crime.pdf"&gt;reviews of the literature&lt;/a&gt; on homicide decline in Europe, it seemed to me as if some of the posited reasons for the decline of violence would involve strong cohort effects&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt; —&lt;/span&gt;each generation successively becoming less and less violent&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline !important; float: none; font-family: arial, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;.&lt;/span&gt; This immediately reminded me of Mexico, and so I decided to take a quick look at the data:&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://3.bp.blogspot.com/-4SR6D9zoi6A/UGseCfGN5SI/AAAAAAAAFjg/QoHnzdOmyZw/s1600/surface223.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="250" src="http://3.bp.blogspot.com/-4SR6D9zoi6A/UGseCfGN5SI/AAAAAAAAFjg/QoHnzdOmyZw/s400/surface223.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;Each cohort group is connected by a loess line(only ages 12-60 are shown in the graph)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;For a more formal analysis of the decline of violence I used homicide data from the INEGI/SINAIS at the national level from 1985 and at the state/municipality level from 1990 onwards. Since I'm interested in understanding the period before the drug war I discarded all data after 2006. As usual, there are some issues with the data:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;About 3% of homicides have no data corresponding to the age of the victim. I'll simply ignore the missing data. The data also presents &lt;a href="http://2.bp.blogspot.com/-9XjNdkpH_x0/UHRzCoSUzkI/AAAAAAAAFqc/8tMqssViXss/s1600/age-rate-period.png"&gt;clumping of victim's ages which end in 0 or 5&lt;/a&gt;, to deal with this I grouped the data by 5 year age groups.&lt;/li&gt;
&lt;li&gt;Some &lt;a href="http://blog.diegovalle.net/2012/07/machine-learning-for-better-homicide.html"&gt;deaths of unknown intent&lt;/a&gt; are probably homicides, for sure I could use multiple imputation to get better estimates of the number of homicides for the age-period-cohort model, but again I'll ignore this.&lt;/li&gt;
&lt;li&gt;Previous to 1994 there were a lot of homicides registered in the INEGI database &lt;a href="http://imgur.com/0VW2s.png"&gt;with no year of occurrence recorded&lt;/a&gt;. I used the date of registration of the homicide as the year of occurrence before 1994 .&lt;/li&gt;
&lt;li&gt;There are some &lt;a href="http://blog.diegovalle.net/search/label/mortality-fraud"&gt;errors in the mortality database&lt;/a&gt; where homicides are registered as accidents or simply missing. And of course the &lt;a href="http://blog.diegovalle.net/2010/12/some-problems-with-mexican-mortality.html"&gt;Acteal Massacre&lt;/a&gt; is missing from the homicide database.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
 In countries with reliable statistics on offenders most women are 
killed by men, so I focused on total homicide victims rather than each 
sex since I see no reason why Mexico should be any different. To explore the data I plotted the age-adjusted homicide rates for each state of Mexico. Since the five states with the biggest declines in homicides all &lt;a href="http://www.diegovalle.net/drug-war-map.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=6&amp;amp;homtype=INEGI&amp;amp;clat=19.906246721165836&amp;amp;clong=-96.7304164711386&amp;amp;polygon=-94.1484375+15.996827733220593%2C-93.68701171875+17.260024118987044%2C-95.26904296875+17.53260283829153%2C-95.79638671875+18.013851941338817%2C-96.78515625+18.431264931987986%2C-97.42236328125+18.118298892018803%2C-98.356201171875+17.951154013794522%2C-98.707763671875+18.12874016774441%2C-98.982421875+18.368716953208857%2C-98.6748046875+18.54587709865494%2C-98.619873046875+19.00874677363432%2C-99.2845458984375+19.122967001585273%2C-99.3504638671875+19.291556949193534%2C-99.13485717773438+19.590699545167702%2C-99.05795288085938+19.396513826230773%2C-98.96182250976562+19.32395824616624%2C-98.9769287109375+19.080143640286064%2C-98.62948608398438+19.012641939704597%2C-98.65283203125+19.40558100225861%2C-98.68304443359375+19.558351452463494%2C-98.60614013671875+19.767851471727575%2C-98.70913696289062+19.88153886700858%2C-98.88766479492188+19.899617992091663%2C-99.02774047851562+20.017081906042804%2C-99.17330932617188+20.029984690068133%2C-99.35458374023438+19.80274147699627%2C-99.4603271484375+19.93060597328348%2C-99.45620727539062+20.13832620316427%2C-99.64022827148438+20.23499626834093%2C-99.86819458007812+20.28781718416226%2C-100.0867397133261+20.037898107201507%2C-100.2899867836386+20.29571753646128%2C-100.6415492836386+19.924323023949768%2C-101.1743861977011+19.96046942717407%2C-101.8335658852011+20.239033856239015%2C-102.0917445961386+20.362680608311315%2C-102.6190883461386+20.228725508945246%2C-103.0420619789511+20.110130463337367%2C-103.0145961586386+20.001769462539364%2C-102.7289516273886+19.862338533132775%2C-102.7564174477011+19.634855213402673%2C-102.5696498695761+19.3137635649681%2C-102.8607875648886+19.19448776622114%2C-103.1793910805136+18.96087230164082%2C-103.4925014320761+18.97645689948904%2C-103.7891322914511+18.63326086105811%2C-103.4979945961386+18.19285356585945%2C-100.7953578773886+16.862405285407124%2C-97.5983363930136+15.850418000793935%2C-96.2030727211386+15.511941022490356%2C-95.1813442055136+15.977201328986842%2C-94.1484375+15.996827733220593"&gt;lie in this contiguous area of Mexico&lt;/a&gt; I highlighted them in blue.&amp;nbsp; &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-RB7sgGjTecE/UHBoyvnx_YI/AAAAAAAAFlA/a-WRRHwfKqM/s1600/states.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="282" src="http://3.bp.blogspot.com/-RB7sgGjTecE/UHBoyvnx_YI/AAAAAAAAFlA/a-WRRHwfKqM/s400/states.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
The border states seem to follow a different dynamic than the rest of Mexico so I plotted the age-adjusted homicide rate for all municipalities whose head locality lies at least 200 km from the U.S. border:&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="http://2.bp.blogspot.com/-RZovM_WpegQ/UHDsSYfZtGI/AAAAAAAAFnM/SMl6RLrZMSM/s1600/border.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="221" src="http://2.bp.blogspot.com/-RZovM_WpegQ/UHDsSYfZtGI/AAAAAAAAFnM/SMl6RLrZMSM/s400/border.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Since we have a bunch of contiguous states which saw big declines in violence and the municipalities near the U.S. border which saw increases, I'll build two different age-period-cohort models for each area using the &lt;a href="http://cran.r-project.org/web/packages/Epi/index.html"&gt;Epi package&lt;/a&gt; (tough I could also use a multilevel model). Prior to building the age-period-cohort model I'll visualize the four classic plots for the two areas of Mexico I mentioned.&lt;br /&gt;
&lt;br /&gt;
The southern states:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-VovM2ex3HzY/UHBpEEtScrI/AAAAAAAAFlQ/QcffrR1H3HM/s1600/south3p.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://4.bp.blogspot.com/-VovM2ex3HzY/UHBpEEtScrI/AAAAAAAAFlQ/QcffrR1H3HM/s400/south3p.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Municipalities 200 km from the border:&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="http://3.bp.blogspot.com/-8QjW70B97XQ/UHDo9FgGyxI/AAAAAAAAFmI/rQR6d8usOsg/s1600/border3p.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://3.bp.blogspot.com/-8QjW70B97XQ/UHDo9FgGyxI/AAAAAAAAFmI/rQR6d8usOsg/s400/border3p.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;The top left plot shows the rate versus the age with each birth cohort group connected by a quadratic polynomial regression line. You can see a very clear pattern of each cohort being less violet in the southern states but not in the municipalities near the U.S. border.&lt;/li&gt;
&lt;li&gt;The top right plot shows the rate versus the age, with each period connected. You can see that children have low homicide rates and young adults the highest. Near the U.S. border there is a drop in homicide rates after 40 years of age (but remember the cohort effects from the first plot!).&lt;/li&gt;
&lt;li&gt;The bottom left plot shows the rate versus the period, with each age group connected. You can see that the decrease in violence occurred primarily among the ages with the highest rates  in the southern states but not so much near the U.S. border.&lt;/li&gt;
&lt;li&gt;The bottom right plot shows the rate versus the cohort, with the each age group connected. You can see how in the southern states each cohort suffered less violence than the rest, though not so much near the U.S. border (but keep in mind period effects!).&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
After looking at those plots it seems appropriate to fit an Age-Period-Cohort model to separate the effects of each component:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Age effect: Changes in the rates according to biological process  of aging: children have low homicides rates, young adults a high one.&lt;/li&gt;
&lt;li&gt;Cohort  effect: Changes in the rates according to the birth date of each  homicide victim. People born in the 50s were more likely to be murdered  than people born in the 90s (well, until the drug war), which could reflect better schooling, higher literacy, etc.&lt;/li&gt;
&lt;li&gt;Period  effect: Changes in the rates affecting the entire population at a given point in time, related  to historical events such as the arrival of the drug cartels to the  border during the 90s and the problems with the Familia Michoacana  before the drug war.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
In the model, I used the 1970 cohort as reference for the age and cohort effect, and 2003 as the period reference since that was the year before the expiration of the assault weapon ban, Chapo Guzmán killing the brother of the Juárez Cartel leader, La Barbie in Nuevo Laredo and the whole La Familia Michoacana thing.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-_Y4BX2ZUJGc/UHOaFNPdOfI/AAAAAAAAFpM/h8JRVj1WSDo/s1600/flowRoot3806.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="277" src="http://3.bp.blogspot.com/-_Y4BX2ZUJGc/UHOaFNPdOfI/AAAAAAAAFpM/h8JRVj1WSDo/s400/flowRoot3806.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;br /&gt;
From the chart we can see that the age pattern for homicides follows that found in &lt;a href="http://www.unodc.org/documents/data-and-analysis/statistics/Homicide/Globa_study_on_homicide_2011_web.pdf"&gt;other countries&lt;/a&gt; (Fig 3.3 page 41), once we control for cohort and period effects, with the highest risk of being a homicide victim for people in their early 20s. Interestingly, near the border people remain much much violent throughout their lives. Also note how much more violent southern Mexico was compared to the U.S. border. Infants living in the south where at a higher risk of dying of murder than people in their 20s near the U.S. border (controling for cohort and period effects). This probably because people in their 20s commit infanticide and also kill their peers in their 20s.&lt;br /&gt;
&lt;br /&gt;
Looking at the cohort effect there was a big decrease in violence by each successive generation. The period effect shows a rise in the early 90s which might have been related to the land reform enacted about that time (this is pure speculation) and the heightned importance of the Mexico-US border for traficking cocaine in the 90s, the model also shows a rise after 2003 which is very likely related to the whole breakup of the Federation and the rise of La Familia Michoacana as stated previously, though keep in mind its size compared to the cohort effect (they are on the same scale)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;: &lt;i&gt;I'm more interested in explaining the decline of 
violence in Mexico rather than predicting the drug war, so the age 
specific rates for the 1970 cohort are wrong after age 38 since 2008 was
 the year homicide rates shot up because of the drug war.&lt;/i&gt; &lt;br /&gt;
&lt;br /&gt;
One problem with looking at homicide victims is that we ignore data on those who committed the homicides. But in Mexico there is very little data on those who commit murder, &lt;span style="background-color: yellow;"&gt;in 1930 the government detained about &lt;a href="http://www.columbia.edu/~pp143/estadisticascrimen/EstadisticasSigloXX.htm"&gt;6,500 presumed murderers&lt;/a&gt;, the same number as in 2011!&amp;nbsp;&lt;/span&gt;But in other parts of the world those who commit homicide have similar ages to their victims, in fact they are usually acquaintances (with the obvious exception of infants).&lt;br /&gt;
&lt;br /&gt;
There is also the possibility that rather than a reduction in violence the decrease in homicides could reflect better medical treatment, but Mexico also saw a reduction in all criminal activity:&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 style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-YWptDIVFKsc/UHHm5bFT2KI/AAAAAAAAFn0/Jy_5HChNBVk/s1600/totalcrimes.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="250" src="http://1.bp.blogspot.com/-YWptDIVFKsc/UHHm5bFT2KI/AAAAAAAAFn0/Jy_5HChNBVk/s400/totalcrimes.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;The trendline was adjusted for seasonal effects and length of month&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
There is also the fact that the homicide rate in Mexico followed the homicide rates of Canada and the U.S. until the drug war. The consensus is that in Canada and the U.S. people really became less violent.&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://2.bp.blogspot.com/-_nGvcqpQ354/UGr2yVgwLvI/AAAAAAAAFiQ/jhvzXKjKiBw/s1600/adjusted-can-mx-us-homicide.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="300" src="http://2.bp.blogspot.com/-_nGvcqpQ354/UGr2yVgwLvI/AAAAAAAAFiQ/jhvzXKjKiBw/s400/adjusted-can-mx-us-homicide.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;Data Sources: INEGI, FBI, and Statistics Canada (Criminal Justice)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
So my best guess is that each cohort of Mexicans really was less violent than the previous ones. You certainly didn't want to mess with someone born around the time of the revolution, but with each passing generation, for reasons still unknown, people became less and less violent until the late 80s and early 90s saw the birth of the &lt;a href="http://www.mirrreybook.com/"&gt;mirrrey generation&lt;/a&gt;: people more interested in aping the clothing style of &lt;a href="http://grammar.about.com/od/shortpassagesforanalysis/a/fussellclassstyle.htm"&gt;uncivilized proles&lt;/a&gt;, with their garrish logos and shirts with legible clothing, than in being violent.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-0WTIXh28XNI/UHBnebDymaI/AAAAAAAAFk4/s0de5jLUGcU/s1600/evolution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="321" src="http://4.bp.blogspot.com/-0WTIXh28XNI/UHBnebDymaI/AAAAAAAAFk4/s0de5jLUGcU/s400/evolution.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
The real tragedy is that what was supposed to be the least violent generation in recorded history is now the protagonist of the drug war:&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://1.bp.blogspot.com/-acixFGw5iJQ/UHBm3sFBuyI/AAAAAAAAFkw/AS0b-egeF-A/s1600/surface388.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="250" src="http://1.bp.blogspot.com/-acixFGw5iJQ/UHBm3sFBuyI/AAAAAAAAFkw/AS0b-egeF-A/s400/surface388.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;Each cohort group is connected by a loess line(only ages 12-60 are shown in the graph)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
P.S. You can download the code and data from &lt;a href="https://github.com/diegovalle/age-period-cohort"&gt;GitHub&lt;/a&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/1193978971598604354/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/10/age-period-cohort-models-and-decline-of.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/1193978971598604354?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/1193978971598604354?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/HVM0N3HiQT0/age-period-cohort-models-and-decline-of.html" title="Age-Period-Cohort models and the decline of violence" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-ZTUlPRR5js4/UHRRr1ZXkpI/AAAAAAAAFp0/D5U67n3lDPM/s72-c/Rplot04.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/10/age-period-cohort-models-and-decline-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0IAQX8yeCp7ImA9WhJbFk4.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-5320211616849180195</id><published>2012-09-25T23:59:00.000-05:00</published><updated>2012-09-25T23:59:00.190-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-25T23:59:00.190-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><title>Drug use and seizures in the U.S.</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-w68X6tEGy9I/UGJBI5sm70I/AAAAAAAAFhY/eFEjUdx06C8/s1600/past-month.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://2.bp.blogspot.com/-w68X6tEGy9I/UGJBI5sm70I/AAAAAAAAFhY/eFEjUdx06C8/s400/past-month.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
According to data from the &lt;a href="http://www.oas.samhsa.gov/nhsda.htm"&gt;National Survey on Drug Use &amp;amp; Health 2001-2011&lt;/a&gt; marijuana and heroin use are up, but cocaine and methampethamine use are down.&amp;nbsp;&lt;a href="http://www.oas.samhsa.gov/nhsda.htm"&gt;&lt;/a&gt; (Data on methamphetamine consumption was statistically adjusted to account for survey changes) &lt;b style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: Verdana, Arial, Helvetica; font-size: medium; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-center; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;/span&gt;&lt;/b&gt;&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="http://3.bp.blogspot.com/-Efk7G5QsTgU/UGJBH_7gnPI/AAAAAAAAFhQ/opB92Lbol8E/s1600/past-month-per.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://3.bp.blogspot.com/-Efk7G5QsTgU/UGJBH_7gnPI/AAAAAAAAFhQ/opB92Lbol8E/s400/past-month-per.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
The spike in heroin users in 2006 is probably because the NSDUH is a household survey and as such it probably has quite a bit of error in capturing the real number of drug users. Since most drug consumption is due to addicts, I'm also showing data for those persons that were dependent or abused drugs.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-78JNgagE78A/UGJBG-NFQUI/AAAAAAAAFhI/yBcv9bdcGaM/s1600/abuse.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://1.bp.blogspot.com/-78JNgagE78A/UGJBG-NFQUI/AAAAAAAAFhI/yBcv9bdcGaM/s400/abuse.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
For drug seizures I used data from the &lt;a href="http://www.justice.gov/archive/ndic/pubs44/44849/44849p.pdf"&gt;National&amp;nbsp;Drug Threat&amp;nbsp;Assessment 2011&lt;/a&gt; (page 50). The southwest region corresponds to the the US-Mexico border crossings and nearby counties. Basically seizures of all drugs along the US-Mexico border have gone up except for cocaine, probably because cocaine consumption has decreased. (Also see this &lt;a href="http://www.animalpolitico.com/blogueros-plata-o-plomo/2012/09/12/enigmas-de-la-cocaina/"&gt;blog post&lt;/a&gt; by Alejandro Hope for Mexican drug seizure data)&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-X9dnJyEPgnQ/UGJBLCa85tI/AAAAAAAAFho/1cRsYMGSfIE/s1600/seizures.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://2.bp.blogspot.com/-X9dnJyEPgnQ/UGJBLCa85tI/AAAAAAAAFho/1cRsYMGSfIE/s400/seizures.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
As a percentage change I decided to only show seizure data along the northern border for Marijuana and MDMA (ecstasy) since all the other numbers are so small. Also keep in mind that MDMA from Mexico grew from a very low starting point, though seizures are now about the size of those along the Northern border in 2006.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-fMVq3ctx5Gw/UGJBJ1LI5oI/AAAAAAAAFhg/1JtrTg3S90I/s1600/seizures-per.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://3.bp.blogspot.com/-fMVq3ctx5Gw/UGJBJ1LI5oI/AAAAAAAAFhg/1JtrTg3S90I/s400/seizures-per.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/5320211616849180195/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/09/drug-use-and-seizures-in-us.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5320211616849180195?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5320211616849180195?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/X_365sjjR28/drug-use-and-seizures-in-us.html" title="Drug use and seizures in the U.S." /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-w68X6tEGy9I/UGJBI5sm70I/AAAAAAAAFhY/eFEjUdx06C8/s72-c/past-month.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/09/drug-use-and-seizures-in-us.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQDQX86eyp7ImA9WhNRE08.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-4516231237824395780</id><published>2012-09-12T21:06:00.000-05:00</published><updated>2012-11-07T15:06:10.113-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-07T15:06:10.113-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ebrard2018" /><category scheme="http://www.blogger.com/atom/ns#" term="mortality-errors" /><title>More errors in the Mexican Mortality Database</title><content type="html">&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-92ja9SQ0BDE/UFEt2ht97fI/AAAAAAAAFfw/SIjrULlRNFM/s1600/df1.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://4.bp.blogspot.com/-92ja9SQ0BDE/UFEt2ht97fI/AAAAAAAAFfw/SIjrULlRNFM/s400/df1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
I've written before about how the deaths of the &lt;a href="http://blog.diegovalle.net/2010/12/some-problems-with-mexican-mortality.html"&gt;Acteal massacre&lt;/a&gt; weren't registered as homicides in the mortality database and about the large number of &lt;a href="http://blog.diegovalle.net/2012/07/machine-learning-for-better-homicide.html"&gt;deaths of unknown intent in Ciudad Juárez&lt;/a&gt;. There's actually another large error in the database that occurred in January and February of 2007. Lots of accidents of unspecified injury mechanism were registered in the Federal District at the same time there was a never before seen drop in the number of homicides.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
The drop didn't just involve homicides but also all kind of accidental deaths, though that is not an error but a drop in the quality of vital statistics data (I only show accidental deaths by cause of transportation in the chart for clarity purposes)&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-OA8Ia_pgytI/UFEt1wzO4OI/AAAAAAAAFfo/N83J9bFj4LU/s1600/df.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://2.bp.blogspot.com/-OA8Ia_pgytI/UFEt1wzO4OI/AAAAAAAAFfo/N83J9bFj4LU/s400/df.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Loking at the data for the whole metro area of Mexico City broken down by state of occurrence one can see that the error only occurred in the Federal District (the spike during late 2007 in the State of Mexico is due transport accidents misclassified as unspecified, though it is difficult to see in the data due to seasonal patterns)&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-w7VGFDllYOg/UFEyQuflWiI/AAAAAAAAFgk/TiHfdvwhk2g/s1600/mexico-city.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://4.bp.blogspot.com/-w7VGFDllYOg/UFEyQuflWiI/AAAAAAAAFgk/TiHfdvwhk2g/s400/mexico-city.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
The ages of accidental deaths by unspecified cause that took place during January and February 2007 look different than those that occurred at other times.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-D7LzfRi_i_Y/UFEtzwV8swI/AAAAAAAAFfY/JddVcpASPtM/s1600/age.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-D7LzfRi_i_Y/UFEtzwV8swI/AAAAAAAAFfY/JddVcpASPtM/s320/age.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
The male to female ratio of accidental deaths by unspecified cause that took place during January and February 2007 look different than those that occurred at other times. During January and February more males than females died, just as in homicides and accidental deaths by cause of transportation.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-NMa_Q0gq_-E/UFEt31JnGiI/AAAAAAAAFgA/k4YPFdUZLHc/s1600/ratio.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-NMa_Q0gq_-E/UFEt31JnGiI/AAAAAAAAFgA/k4YPFdUZLHc/s320/ratio.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
I don't think there can be any doubt that some homicides "leaked" into accidental deaths by unspecified cause. I tried to classify the Jan-Feb accidents into homicides and accidents based on the characteristics of the dead (age, sex, place of occurrence) but given that the cause of death was left unspecified (firearm, suffocation, cut/pierce, etc) I was only able to obtain sensitivities and specificities of .60, which is only a little better than chance.&lt;br /&gt;
&lt;br /&gt;
It looks as if the error didn't just happen in the Federal District but all over Mexico (though obviously no the state of Mexico). You see the same pattern of a big drop in homicides at the same time accidents by unspecified cause rise. Perhaps someone hired his dump brother in law to administer the database and he screwed things up?&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-9_VM4pISjGY/UFEt3S1gHCI/AAAAAAAAFf4/zckIVE3z-bY/s1600/not-df.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="221" src="http://3.bp.blogspot.com/-9_VM4pISjGY/UFEt3S1gHCI/AAAAAAAAFf4/zckIVE3z-bY/s400/not-df.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
The most worrying part is that the error coincided with the first military operations of the drug war. Perhaps the Mexican government saw the drop in homicides and became a little too cocky about its capacity to take on the drug cartels.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-7lmlbvld-oo/UFEt1FPMMGI/AAAAAAAAFfg/NIFUwJz7c00/s1600/df-mich-tam.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-7lmlbvld-oo/UFEt1FPMMGI/AAAAAAAAFfg/NIFUwJz7c00/s400/df-mich-tam.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
In &lt;a href="http://www.diegovalle.net/drug-war-map.html#city=Nuevo+Laredo&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=6&amp;amp;homtype=INEGI&amp;amp;clat=24.67059077598693&amp;amp;"&gt;Nuevo Laredo&lt;/a&gt; during the first months of 2007 there were more drug related homicides that total homicides according to the INEGI.</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/4516231237824395780/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/09/more-errors-in-mexican-mortality.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/4516231237824395780?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/4516231237824395780?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/08JaoGaQQOY/more-errors-in-mexican-mortality.html" title="More errors in the Mexican Mortality Database" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-92ja9SQ0BDE/UFEt2ht97fI/AAAAAAAAFfw/SIjrULlRNFM/s72-c/df1.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/09/more-errors-in-mexican-mortality.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMMR3c_eCp7ImA9WhJUEEs.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-5468120877346595634</id><published>2012-09-07T20:38:00.000-05:00</published><updated>2012-09-07T20:41:26.940-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-07T20:41:26.940-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GIS" /><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><category scheme="http://www.blogger.com/atom/ns#" term="R" /><title>Violence along Mexico's Southern Border and Central America</title><content type="html">&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://2.bp.blogspot.com/-_KA7-6sC3gc/UEkgdMbjoHI/AAAAAAAAFdU/nfJTvdMVaDc/s1600/central-america.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="332" src="http://2.bp.blogspot.com/-_KA7-6sC3gc/UEkgdMbjoHI/AAAAAAAAFdU/nfJTvdMVaDc/s400/central-america.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;Rates for Panama and Nicaragua are from 2009, all other countries 2010. Municipalities which are part of a metro area in Mexico are shown with the metro area homicide rate.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;"&gt;&lt;a href="https://www.google.com/fusiontables/embedviz?viz=MAP&amp;amp;q=select+col8+from+1iEBGSQhAGe5zhIVmAATEuw2klgl3maros_o6mYw&amp;amp;h=false&amp;amp;lat=15.041111671053436&amp;amp;lng=-86.79885912500004&amp;amp;z=6&amp;amp;t=1&amp;amp;l=col8&amp;amp;y=2&amp;amp;tmplt=1"&gt;Visit the interactive map of homicides&lt;/a&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
Having just posted on &lt;a href="http://blog.diegovalle.net/2012/09/homicides-along-united-statesmexico.html"&gt;violence along Mexico's northern border&lt;/a&gt;, I figured it's time to analyze what is happing south of Mexico where some countries have experienced sharp increases in homicides.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;It's a little bit fallacious to compare a country as big as Mexico with its southern neighbors since Mexico's most populous state has more people living in it than the entire country of Guatemala, and all Mexican states are more populous than Belize, also the administrative divisions in each country are a little bit different:&lt;br /&gt;
&lt;br /&gt;
In Mexico the divisions go something like this:&lt;br /&gt;
&lt;br /&gt;
States -&amp;gt; Municipalities (Counties)&lt;br /&gt;
&lt;br /&gt;
In Guatemala:&lt;br /&gt;
&lt;br /&gt;
Deparments -&amp;gt; Municipalities&lt;br /&gt;
&lt;br /&gt;
In Belize:&lt;br /&gt;
&lt;br /&gt;
Districts -&amp;gt; Constituencies &lt;br /&gt;
&lt;br /&gt;
So in the map I'm showing at the top of this post I'm comparing level 1 divisions in Guatemala and Belize (departments and districts) with level 2 divisions in Mexico (municipalities).&lt;br /&gt;
&lt;br /&gt;
In addition, homicide records are not always reliable in both Mexico and Guatemala, in Mexico vital statistics records of homicides based on death certificates are usually more reliable than those compiled from police records, but in Chiapas –which borders Guatemala– police records consistently record a higher number of homicides. Looking at the monthly data one can see that some months both &lt;a href="http://3.bp.blogspot.com/-tRPL2ieMJuk/UDLjuC2HkDI/AAAAAAAAFag/iikgkQIqzoU/s1600/chiapas.png"&gt;transportation accidents and homicides fall to levels near zero&lt;/a&gt;. I interpret this as Chiapas not being able to register every death, being one of Mexico's poorest states this is not surprising. Chiapas health records are not up to par with the rest of the country.&lt;br /&gt;
&lt;br /&gt;
Homicides in Chiapas from different sources:&lt;br /&gt;
&lt;table border="0" cellspacing="0" cols="3" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: arial; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;"&gt;&lt;colgroup span="3" width="85"&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td align="LEFT" height="16" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td align="RIGHT" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;2010&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td align="RIGHT" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;2011&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="LEFT" height="16" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;a href="http://www.inegi.org.mx/est/contenidos/espanol/proyectos/continuas/vitales/bd/mortalidad/MortalidadGeneral.asp?s=est&amp;amp;c=11144"&gt;INEGI&lt;/a&gt;(Vital Statistics)&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td align="RIGHT" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;197&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td align="RIGHT" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;185&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align="LEFT" height="16" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;a href="http://www.secretariadoejecutivo.gob.mx/es/SecretariadoEjecutivo/Incidencia_Delictiva_Nacional_fuero_comun"&gt;SNSP&lt;/a&gt;(Police)&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td align="RIGHT" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;513&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;td align="RIGHT" style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;613&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
In Guatemala police records consistently document more homicides than vital statistics compiled by health authorities, though there are a lot of deaths of unknown intent. I interpret this as police records being more accurate than vital statistics.&lt;br /&gt;
&lt;br /&gt;
With all that said it's now a matter of collecting the data. Lucky for me, &lt;a href="http://multimedia.laprensagrafica.com/pdf/2011/03/20110322-PDF-Informe-0311-Homicidios-en-Centroamerica.pdf"&gt;La Prensa Gráfica&lt;/a&gt; compiled homicide statistics for Central America and they used the police sources for Guatemala. So, it's mostly a matter of downloading and merging shapefiles to analyze the data:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="r geshifilter-R" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: #222222; font-family: monospace; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 15px; margin: 0px; orphans: 2; overflow: auto; padding: 10px; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; word-wrap: normal;"&gt;getMaps &lt;span style="margin: 0px; padding: 0px;"&gt;&amp;lt;-&lt;/span&gt; &lt;a href="http://inside-r.org/r-doc/base/function" style="color: #0077df; margin: 0px; padding: 0px; text-decoration: none;"&gt;&lt;span style="color: #003399; font-weight: bold; margin: 0px; padding: 0px;"&gt;function&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;codes&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; level&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt; &lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;{&lt;/span&gt;
  &lt;span style="color: #666666; font-style: italic; margin: 0px; padding: 0px;"&gt;##Different column names to uniquely identify each group&lt;/span&gt;
  &lt;span style="color: #666666; font-style: italic; margin: 0px; padding: 0px;"&gt;##depending on the level requested&lt;/span&gt;
  column.name &lt;span style="margin: 0px; padding: 0px;"&gt;&amp;lt;-&lt;/span&gt; &lt;a href="http://inside-r.org/r-doc/base/ifelse" style="color: #0077df; margin: 0px; padding: 0px; text-decoration: none;"&gt;&lt;span style="color: #003399; font-weight: bold; margin: 0px; padding: 0px;"&gt;ifelse&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;level &lt;span style="margin: 0px; padding: 0px;"&gt;==&lt;/span&gt; &lt;span style="color: #cc66cc; margin: 0px; padding: 0px;"&gt;1&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; &lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"NAME_0"&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; &lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"ISO"&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;
  &lt;span style="color: #666666; font-style: italic; margin: 0px; padding: 0px;"&gt;##Download the maps&lt;/span&gt;
  country.ll &lt;span style="margin: 0px; padding: 0px;"&gt;&amp;lt;-&lt;/span&gt; llply&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;codes&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt;
                      &lt;a href="http://inside-r.org/r-doc/base/function" style="color: #0077df; margin: 0px; padding: 0px; text-decoration: none;"&gt;&lt;span style="color: #003399; font-weight: bold; margin: 0px; padding: 0px;"&gt;function&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;x&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt; &lt;a href="http://inside-r.org/r-doc/nlme/getData" style="color: #0077df; margin: 0px; padding: 0px; text-decoration: none;"&gt;&lt;span style="color: #003399; font-weight: bold; margin: 0px; padding: 0px;"&gt;getData&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;&lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"GADM"&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; path = &lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"maps"&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt;
                                          country = x&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; level = level&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;
  &lt;span style="color: #666666; font-style: italic; margin: 0px; padding: 0px;"&gt;##Change the id of the maps since some are repeated and we need to&lt;/span&gt;
  &lt;span style="color: #666666; font-style: italic; margin: 0px; padding: 0px;"&gt;##merge them, use ISO code as the unique identifier&lt;/span&gt;
  country.ll &lt;span style="margin: 0px; padding: 0px;"&gt;&amp;lt;-&lt;/span&gt; llply&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;country.ll&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt;
                      &lt;a href="http://inside-r.org/r-doc/base/function" style="color: #0077df; margin: 0px; padding: 0px; text-decoration: none;"&gt;&lt;span style="color: #003399; font-weight: bold; margin: 0px; padding: 0px;"&gt;function&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;x&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt; spChFIDs&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;x&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; str_c&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/row.names" style="color: #0077df; margin: 0px; padding: 0px; text-decoration: none;"&gt;&lt;span style="color: #003399; font-weight: bold; margin: 0px; padding: 0px;"&gt;row.names&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;x&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; x&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;[&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;[&lt;/span&gt;column.name&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;]&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;]&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;[&lt;/span&gt;&lt;span style="color: #cc66cc; margin: 0px; padding: 0px;"&gt;1&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;]&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;
  &lt;span style="color: #666666; font-style: italic; margin: 0px; padding: 0px;"&gt;##Merge the list of maps one by one&lt;/span&gt;
  &lt;span style="color: black; font-weight: bold; margin: 0px; padding: 0px;"&gt;for&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;i &lt;span style="color: black; font-weight: bold; margin: 0px; padding: 0px;"&gt;in&lt;/span&gt; &lt;span style="color: #cc66cc; margin: 0px; padding: 0px;"&gt;2&lt;/span&gt;&lt;span style="margin: 0px; padding: 0px;"&gt;:&lt;/span&gt;&lt;a href="http://inside-r.org/r-doc/base/length" style="color: #0077df; margin: 0px; padding: 0px; text-decoration: none;"&gt;&lt;span style="color: #003399; font-weight: bold; margin: 0px; padding: 0px;"&gt;length&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;country.ll&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;{&lt;/span&gt;
    &lt;span style="color: black; font-weight: bold; margin: 0px; padding: 0px;"&gt;if&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;i &lt;span style="margin: 0px; padding: 0px;"&gt;==&lt;/span&gt; &lt;span style="color: #cc66cc; margin: 0px; padding: 0px;"&gt;2&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt; &lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;{&lt;/span&gt;
      map &lt;span style="margin: 0px; padding: 0px;"&gt;&amp;lt;-&lt;/span&gt; spRbind&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;country.ll&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;[&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;[&lt;/span&gt;&lt;span style="color: #cc66cc; margin: 0px; padding: 0px;"&gt;1&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;]&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;]&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; country.ll&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;[&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;[&lt;/span&gt;&lt;span style="color: #cc66cc; margin: 0px; padding: 0px;"&gt;2&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;]&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;]&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;
    &lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;}&lt;/span&gt; &lt;span style="color: black; font-weight: bold; margin: 0px; padding: 0px;"&gt;else&lt;/span&gt; &lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;{&lt;/span&gt; 
      map &lt;span style="margin: 0px; padding: 0px;"&gt;&amp;lt;-&lt;/span&gt; spRbind&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;map&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; country.ll&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;[&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;[&lt;/span&gt;i&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;]&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;]&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;
    &lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;}&lt;/span&gt;
  &lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;}&lt;/span&gt;
  map
&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;}&lt;/span&gt;
&lt;span style="color: #666666; font-style: italic; margin: 0px; padding: 0px;"&gt;##Codes for the Central American Countries&lt;/span&gt;
country.codes &lt;span style="margin: 0px; padding: 0px;"&gt;&amp;lt;-&lt;/span&gt; &lt;a href="http://inside-r.org/r-doc/base/c" style="color: #0077df; margin: 0px; padding: 0px; text-decoration: none;"&gt;&lt;span style="color: #003399; font-weight: bold; margin: 0px; padding: 0px;"&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;&lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"GTM"&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; &lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"BLZ"&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; &lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"HND"&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; &lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"SLV"&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; &lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"CRI"&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; &lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"NIC"&lt;/span&gt;&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; &lt;span style="color: blue; margin: 0px; padding: 0px;"&gt;"PAN"&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;
&lt;span style="color: #666666; font-style: italic; margin: 0px; padding: 0px;"&gt;##Get the maps of States/Districts&lt;/span&gt;
map &lt;span style="margin: 0px; padding: 0px;"&gt;&amp;lt;-&lt;/span&gt; getMaps&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;country.codes&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; level = &lt;span style="color: #cc66cc; margin: 0px; padding: 0px;"&gt;1&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;
&lt;span style="color: #666666; font-style: italic; margin: 0px; padding: 0px;"&gt;##Get the maps of the country outlines&lt;/span&gt;
map.borders &lt;span style="margin: 0px; padding: 0px;"&gt;&amp;lt;-&lt;/span&gt; getMaps&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;(&lt;/span&gt;country.codes&lt;span style="color: #339933; margin: 0px; padding: 0px;"&gt;,&lt;/span&gt; level = &lt;span style="color: #cc66cc; margin: 0px; padding: 0px;"&gt;0&lt;/span&gt;&lt;span style="color: #009900; margin: 0px; padding: 0px;"&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Here's a map showing the homicide rates from police sources in the Mexican states that border Guatemala and Belize:&lt;br /&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://1.bp.blogspot.com/-qKVoi1GZVaU/UEkgkwpkVUI/AAAAAAAAFdc/qCIfBtihmGs/s1600/central-america-states.png" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="332" src="http://1.bp.blogspot.com/-qKVoi1GZVaU/UEkgkwpkVUI/AAAAAAAAFdc/qCIfBtihmGs/s400/central-america-states.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;Rates for Panama and Nicaragua are from 2009, Mexico from 2011, and all other countries 2010. Data for Central America from &lt;a href="http://multimedia.laprensagrafica.com/pdf/2011/03/20110322-PDF-Informe-0311-Homicidios-en-Centroamerica.pdf"&gt;La Prensa Gráfica&lt;/a&gt;, Mexico from &lt;a href="http://www.secretariadoejecutivo.gob.mx/es/SecretariadoEjecutivo/Incidencia_Delictiva_Nacional_fuero_comun"&gt;SNSP&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
If the police homicide statistics are closer to reality, then the border states of Mexico would have a homicide rate of 13 (about the same level as metro Mexico City). The departments and districts of Guatemala and Belize that touch the border with Mexico would have a combined homicide rate of 20 (about the same level as metro Detroit or New Orleans). And as you can see, the most violent part of Guatemala is closer to Honduras and El Salvador than Mexico, with the big exception of Petén. I wonder why the souther border hasn't seen the increase in violence seen in other parts of Mexico? The real contrast is provided by Nicaragua.&lt;br /&gt;
&lt;br /&gt;
The intensity of drug trafficking does seem to be correlated with homicides according to this &lt;a href="http://siteresources.worldbank.org/INTLAC/Resources/FINAL_VOLUME_I_ENGLISH_CrimeAndViolence.pdf"&gt;report by the World Bank&lt;/a&gt; (page 13).&lt;br /&gt;
&lt;br /&gt;
For the time series of homicide rates I added a line representing the Mexican states of &lt;a href="http://www.diegovalle.net/drug-war-map.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=5&amp;amp;homtype=INEGI&amp;amp;clat=23.61796278994952&amp;amp;clong=-95.02734375&amp;amp;polygon=-118.34033203125+33.90106918005482%2C-118.29638671875+31.23498317723463%2C-115.61572265625+28.684429398649353%2C-112.49560546875+28.41421700676992%2C-114.47314453125+31.272551046389815%2C-113.50634765625+31.159802615515293%2C-111.00146484375+26.81780603121026%2C-107.79345703125+23.234895661141312%2C-105.72802734375+21.241879373194685%2C-103.79443359375+21.118949331671576%2C-104.18994140625+22.83047609089846%2C-103.39892578125+24.480759867020126%2C-103.13525390625+25.59557137647338%2C-104.10205078125+27.287450647929447%2C-103.61865234375+31.12218994344478%2C-104.32177734375+33.572165993665266%2C-118.34033203125+33.90106918005482"&gt;Baja California, Sonora, Chihuahua, Sinaloa, Durango and Nayarit&lt;/a&gt;
 to serve as comparison, together these states would have a population 
similar to that of Guatemala and about twice that of El Salvador or 
Honduras, though their area is much bigger and their GDP per capita much
 higher. Belize is a pretty small country, so keep in mind that while 
the trend is increasing, the number of homicides went from 41 in 2000 to
 129 in 2010. Another thing to keep in mind is that Central American 
countries are very young and Ceteris Paribus having more young adults 
will mean more homicides. &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://1.bp.blogspot.com/-gNMHbf0pUyk/UEoiM0WkhAI/AAAAAAAAFes/BFbDR56bFvw/s1600/hom-ca.png" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="221" src="http://1.bp.blogspot.com/-gNMHbf0pUyk/UEoiM0WkhAI/AAAAAAAAFes/BFbDR56bFvw/s400/hom-ca.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;Sources: &lt;a href="http://data.un.org/Data.aspx?d=UNODC&amp;amp;f=tableCode%3A1"&gt;UNODC Homicide Statistics 2012&lt;/a&gt;, INEGI&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style="background-color: #ffe599;"&gt;Violence in Guatemala as of 2011 is at its lowest level since 2004.&lt;/span&gt; But homicide rates are higher in all Central American countries compared to 2000:&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://1.bp.blogspot.com/-0RfP2d21hQs/UEoiUOn7IFI/AAAAAAAAFe0/fc9-5etR3_o/s1600/hom-ca-percentage.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="221" src="http://1.bp.blogspot.com/-0RfP2d21hQs/UEoiUOn7IFI/AAAAAAAAFe0/fc9-5etR3_o/s400/hom-ca-percentage.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;Sources: &lt;a href="http://data.un.org/Data.aspx?d=UNODC&amp;amp;f=tableCode%3A1"&gt;UNODC Homicide Statistics 2012&lt;/a&gt;, INEGI&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Here's an &lt;a href="https://www.google.com/fusiontables/embedviz?viz=MAP&amp;amp;q=select+col8+from+1iEBGSQhAGe5zhIVmAATEuw2klgl3maros_o6mYw&amp;amp;h=false&amp;amp;lat=15.041111671053436&amp;amp;lng=-86.79885912500004&amp;amp;z=6&amp;amp;t=1&amp;amp;l=col8&amp;amp;y=2&amp;amp;tmplt=1"&gt;interactive map&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder="no" height="500" scrolling="no" src="https://www.google.com/fusiontables/embedviz?viz=MAP&amp;amp;q=select+col8+from+1iEBGSQhAGe5zhIVmAATEuw2klgl3maros_o6mYw&amp;amp;h=false&amp;amp;lat=15.041111671053436&amp;amp;lng=-86.79885912500004&amp;amp;z=6&amp;amp;t=1&amp;amp;l=col8&amp;amp;y=2&amp;amp;tmplt=1" width="500"&gt;&lt;/iframe&gt;Municipalities which are part of a metro area in Mexico are shown with the metro area homicide rate.&lt;br /&gt;
&lt;br /&gt;
P.S. &lt;a href="https://github.com/diegovalle/central-america"&gt;Data and code are available from GitHub&lt;/a&gt; </content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/5468120877346595634/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/09/violence-along-mexicos-southern-border.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5468120877346595634?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5468120877346595634?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/VVr8VLuTkQw/violence-along-mexicos-southern-border.html" title="Violence along Mexico's Southern Border and Central America" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-_KA7-6sC3gc/UEkgdMbjoHI/AAAAAAAAFdU/nfJTvdMVaDc/s72-c/central-america.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/09/violence-along-mexicos-southern-border.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMAR307eCp7ImA9WhJVGEw.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-6948910041091026984</id><published>2012-09-04T18:37:00.000-05:00</published><updated>2012-09-04T21:34:06.300-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-04T21:34:06.300-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><title>Homicides along the United States–Mexico border</title><content type="html">The drug war in Mexico has increased the homicide rate in several parts of the country, but one of the most affected regions has been those areas near the U.S. border.&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://1.bp.blogspot.com/-1D9hh37KaTg/UEaFIXdcYYI/AAAAAAAAFb8/mmmY_VxZAGA/s1600/rate.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="250" src="http://1.bp.blogspot.com/-1D9hh37KaTg/UEaFIXdcYYI/AAAAAAAAFb8/mmmY_VxZAGA/s400/rate.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;Sources: CDC / INEGI. For Mexican municipalities the distance to the border was measured from the main locality of each municipality, for US counties the distance to the border was measured from the centroid.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Violence has generally stayed on the Mexican side of the border. The trend in 
homicides for all U.S. counties at least 160 km from the Mexican border has been downward since the drug war started.&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://3.bp.blogspot.com/-rTqHde1V5Sk/UEaFN-ALXfI/AAAAAAAAFcE/Bvr-SKfgKCI/s1600/percent.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="250" src="http://3.bp.blogspot.com/-rTqHde1V5Sk/UEaFN-ALXfI/AAAAAAAAFcE/Bvr-SKfgKCI/s400/percent.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;Sources: CDC / INEGI&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Keep in mind that violence in Mexican municipalities at least 160km from the border was lower in 
2006, when the drug war started, than in 1999.&lt;br /&gt;
&lt;br /&gt;
P.S. When referring to homicides in the US I included those deaths that were the result of legal interventions since in Mexico police/military interventions are usually counted as homicides.</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/6948910041091026984/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/09/homicides-along-united-statesmexico.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/6948910041091026984?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/6948910041091026984?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/xI48tGGmUjY/homicides-along-united-statesmexico.html" title="Homicides along the United States–Mexico border" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-1D9hh37KaTg/UEaFIXdcYYI/AAAAAAAAFb8/mmmY_VxZAGA/s72-c/rate.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/09/homicides-along-united-statesmexico.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4ERXc8cCp7ImA9WhJWFUg.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-7788594921215959307</id><published>2012-08-20T22:32:00.001-05:00</published><updated>2012-08-21T08:15:04.978-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-21T08:15:04.978-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><title>Preliminary homicide data for 2011</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-kmabbx2DB-o/UDLfW6ul8RI/AAAAAAAAFZ8/65UmXW4ibm8/s1600/historic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/-kmabbx2DB-o/UDLfW6ul8RI/AAAAAAAAFZ8/65UmXW4ibm8/s400/historic.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
The Mexican government through the INEGI just released &lt;a href="http://www.inegi.org.mx/inegi/contenidos/espanol/prensa/Boletines/Boletin/Comunicados/Especiales/2012/agosto/comunica29.pdf"&gt;preliminary homicide data for 2011&lt;/a&gt;. I feel bound to remind my readers that the government also released preliminary data in 2010, with the state of Chihuahua missing over a thousand murders, so the data should be interpreted as strictly preliminary.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;According to the INEGI the homicide rate was 24 and the total number of homicides in 2011 was 27,199.&lt;br /&gt;
&lt;br /&gt;
Homicides actually went down in many of the most violent states in 2010. Chihuahua, Sinaloa, Baja California and Sonora all registered a drop in homicides in 2011, though they still are way above their longtime trendlines. In Chihuahua and Baja California it's been claimed that part of the reason for the drop in homicides is the fact that the Sinaloa Cartel won control of the &lt;i&gt;plaza&lt;/i&gt; (the drug smuggling routes and the political and law enforcement arrangements through which drug traffickers work). Since the Mexican government seems to be going after the Zetas rather than Sinaloa there seems to be one hell of an incentive to invade other cartel's plazas.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-W_yrJEPim1Q/UDLj4koBt8I/AAAAAAAAFao/am_jOjo6s-s/s1600/border.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://4.bp.blogspot.com/-W_yrJEPim1Q/UDLj4koBt8I/AAAAAAAAFao/am_jOjo6s-s/s320/border.png" width="320" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-9xuR6-o-XdE/UDLj9J648oI/AAAAAAAAFaw/hzsPAu8NonM/s1600/coah.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/-9xuR6-o-XdE/UDLj9J648oI/AAAAAAAAFaw/hzsPAu8NonM/s320/coah.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
Keep in mind that Tamaulipas had lots of deaths of unknown intent in 2010 and it is possible the same thing happened in 2011.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-UQ22bAyf7ow/UDLkBNjsZKI/AAAAAAAAFa4/unMwbVUUhEE/s1600/zetas.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/-UQ22bAyf7ow/UDLkBNjsZKI/AAAAAAAAFa4/unMwbVUUhEE/s320/zetas.png" width="320" /&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;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-lfMCUyBtC3s/UDLkFevd4xI/AAAAAAAAFbA/NCuNxeqdqog/s1600/jal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/-lfMCUyBtC3s/UDLkFevd4xI/AAAAAAAAFbA/NCuNxeqdqog/s320/jal.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
The rise in homicides in Michoacán and Guerrero used to justify the drug war now seem quaint and barely visible&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="http://1.bp.blogspot.com/-G9cccX145Vw/UDLkJ9eu6QI/AAAAAAAAFbI/FTAMdCbdOTQ/s1600/southern.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/-G9cccX145Vw/UDLkJ9eu6QI/AAAAAAAAFbI/FTAMdCbdOTQ/s320/southern.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
Veracruz in spite of all the bad press Veracruz doesn't seem to be all that violent relative to other regions of Mexico, though I wonder how it breaks down at the municipality level? Without access to the mortality database I have no idea. According to the drug-war related homicide database the &lt;a href="http://www.diegovalle.net/drug-war-map.html#city=Veracruz&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=5&amp;amp;homtype=INEGI&amp;amp;clat=23.61796278994952&amp;amp;clong=-95.02734375"&gt;Veracruz metro area&lt;/a&gt; is extremely violent.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ehbR6qB81l4/UDLkRRhChBI/AAAAAAAAFbQ/NYsoo0TtD8Q/s1600/ver.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/-ehbR6qB81l4/UDLkRRhChBI/AAAAAAAAFbQ/NYsoo0TtD8Q/s320/ver.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
The rate of increase has been higher for the State of Mexico than the Federal District, it would be interesting to break it down for the Mexico City metro area.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ULJTESy-uug/UDLkW18M4LI/AAAAAAAAFbY/UfBgZDBoLiw/s1600/df.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/-ULJTESy-uug/UDLkW18M4LI/AAAAAAAAFbY/UfBgZDBoLiw/s320/df.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
The data is not without problems, for example in Chiapas the vital statistics system doesn't seem to be very good, with falls in both homicides and transportation accidents coinciding with the New Year. &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-tRPL2ieMJuk/UDLjuC2HkDI/AAAAAAAAFag/iikgkQIqzoU/s1600/chiapas.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/-tRPL2ieMJuk/UDLjuC2HkDI/AAAAAAAAFag/iikgkQIqzoU/s320/chiapas.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
The number of homicides in the the SNSP database was greater than the number of homicides according to the INEGI  in San Luis Potosí . This is very likely due to the high number of deaths of unknown intent, but I need access to the 2011 mortality database to be certain.&lt;br /&gt;
&lt;br /&gt;
Deaths of unknown intent and by homicide in San Luis Potosí&lt;br /&gt;
&lt;table border="1"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;&lt;/th&gt; &lt;th&gt;ANIODEF &lt;/th&gt; &lt;th&gt;Homicide &lt;/th&gt; &lt;th&gt;Unknown &lt;/th&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td align="right"&gt;2004 &lt;/td&gt; &lt;td align="right"&gt;135 &lt;/td&gt; &lt;td align="right"&gt;36 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td align="right"&gt;2005 &lt;/td&gt; &lt;td align="right"&gt;131 &lt;/td&gt; &lt;td align="right"&gt;66 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td align="right"&gt;2006 &lt;/td&gt; &lt;td align="right"&gt;160 &lt;/td&gt; &lt;td align="right"&gt;68 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td align="right"&gt;2007 &lt;/td&gt; &lt;td align="right"&gt;145 &lt;/td&gt; &lt;td align="right"&gt;3 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td align="right"&gt;2008 &lt;/td&gt; &lt;td align="right"&gt;200 &lt;/td&gt; &lt;td align="right"&gt;11 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td align="right"&gt;2009 &lt;/td&gt; &lt;td align="right"&gt;209 &lt;/td&gt; &lt;td align="right"&gt;17 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;&lt;br /&gt;&lt;/td&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td align="right"&gt;357 &lt;/td&gt; &lt;td align="right" style="background-color: #ffd966;"&gt;99 &lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/7788594921215959307/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/08/preliminary-homicide-data-for-2011.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/7788594921215959307?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/7788594921215959307?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/5i3FZGzpfiw/preliminary-homicide-data-for-2011.html" title="Preliminary homicide data for 2011" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-kmabbx2DB-o/UDLfW6ul8RI/AAAAAAAAFZ8/65UmXW4ibm8/s72-c/historic.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/08/preliminary-homicide-data-for-2011.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMGQ3g4eCp7ImA9WhNRE08.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-8108434569098161564</id><published>2012-07-30T07:28:00.000-05:00</published><updated>2012-11-07T15:07:02.630-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-07T15:07:02.630-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Drug war" /><category scheme="http://www.blogger.com/atom/ns#" term="Stats" /><category scheme="http://www.blogger.com/atom/ns#" term="mortality-errors" /><category scheme="http://www.blogger.com/atom/ns#" term="R" /><title>Machine learning for better homicide counts in Ciudad Juarez</title><content type="html">&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://1.bp.blogspot.com/-W2o3uUKAMBU/TfjTaI2nGPI/AAAAAAAAEws/5QtWaSSKr-Y/s1600/3327366294_127b38c355_b.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="262" src="http://1.bp.blogspot.com/-W2o3uUKAMBU/TfjTaI2nGPI/AAAAAAAAEws/5QtWaSSKr-Y/s400/3327366294_127b38c355_b.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="color: #999999;"&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;P&lt;small&gt;hoto Credit:&amp;nbsp;&lt;a href="http://www.flickr.com/photos/frecuenciaspopulares/3327366294/"&gt;Jesús Villaseca Pérez&lt;/a&gt;&lt;/small&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Ever since March 2008 Ciudad Juárez began to register an alarming number of homicides becoming Mexico's most violent city. According to the Mexican vital statistics system Ciudad Juárez (coterminous with the Juárez municipality) went from having just 202 murders in 2007 to 1,616 in 2008, 2,397 in 2009, and 3,686 in 2010.&lt;br /&gt;
&lt;br /&gt;
Mexican and US officials explain the dramatic increase in violence as due to a conflict between the Sinaloa and Juárez Cartels. After a new governor was elected in October 2010 Ciudad Juárez does seem to have started turning around, but it is still an extremely violent city.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;Mortality from ill-defined conditions is quite high in Ciudad Juárez.  Deaths of unknown injury intent went from 33 in 2004 to 193 in 2010. It  is an open question just how good the homicide records are in places  that saw incredible rises in homicides since one can only assume that  forensic services were overwhelmed and that educated professionals like  doctors were the first to leave town.&lt;br /&gt;
&lt;br /&gt;
Recently there was a story in the &lt;a href="http://www.nytimes.com/2012/02/19/magazine/shopping-habits.html?pagewanted=all"&gt;New York Times&lt;/a&gt;  about how Target figured out a teen girl was pregnant before her father  did based on her shopping patterns, and if Target can classify its  shoppers into pregnant and not pregnant based on the stuff they buy, I can certainly train a computer  to classify deaths in Mexico based on the characteristics of the deaths.&lt;br /&gt;
&lt;br /&gt;
Intuitively if someone were to ask you to guess the type  of death of a 70  year old woman whose cause of death was transport  related you would  probably guess it was an accident. On the other hand, if you  had to guess the type  of death of a young adult male whose cause of  death was a firearm, and the  injury took place on a public street in Juárez, you  would  probably guess it was a homicide.&lt;br /&gt;
&lt;br /&gt;
The Mexican government &lt;a href="http://blog.diegovalle.net/2011/12/homicides-in-mexico-2010.html"&gt;supposedly&lt;/a&gt; keeps a record of all deaths in its &lt;a href="http://www.sinais.salud.gob.mx/basesdedatos/estandar.html"&gt;mortality database&lt;/a&gt;. For my purposes there are four types of violent or injury intent deaths:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Accidents (unintentional injuries)&lt;/li&gt;
&lt;li&gt;Suicides (self inflicted injuries)&lt;/li&gt;
&lt;li&gt;Homicides (intentional injuries)&lt;/li&gt;
&lt;li&gt;Unknown Intent (cases where forensic or legal experts determined information was not sufﬁcient to make a decision about the injury intent) &lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
There is a fifth type of injury intent death: "Legal intervention, operations of war, military operations, and terrorism" but there are only about 30-40 deaths of this type in Mexico each year. Most of them occur in Puebla. It is very likely that most of the shootouts where the police or military kill someone (or die themselves) are classified as plain old homicides, so I chose to recode this type of death as homicides.&lt;br /&gt;
&lt;br /&gt;
The Mexican vital statistics database assigns every death an &lt;a href="http://www.who.int/classifications/icd/en/"&gt;International Classification of Diseases&lt;/a&gt; (ICD) code which is used worldwide to categorize diseases, injuries, and external causes of injury. Sadly, it can be a little too specific since it includes distinctions for&lt;span style="background-color: white; color: black; display: inline ! important; float: none; font-family: Arial,Helvetica,sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.icd10watch.com/blog/macaws-parrots-and-other-fun-facts-about-icd-10"&gt;"wounds inflicted by macaws" and "wounds inflicted by parrots,"&lt;/a&gt; in addition it combines the injury mechanism (parrot, macaw, drop bear, chupacabras, etc.) with intent (suicide, homicide, etc.), e.g., the code for accidental death by handgun is "W32," and the code for homicide by handgun is "X93".&lt;br /&gt;
&lt;br /&gt;
Ideally I would have a way of classifying the injury mechanism into meaningful groups separate from intent, something akin to the &lt;a href="http://en.wikipedia.org/wiki/Cluedo#Weapons"&gt;game of clue&lt;/a&gt; where there are half a dozen or so weapons like candlestick, knife, rope, gun, etc. that can be used to harm people, except since epidemiology is a real science we would have to substitute the name of the weapons for fancy names like "struck by or against," "cut/pierce," "suffocation," "firearm," etc. Lucky for me the CDC's National Center for Health Statistics has already done exactly that with its &lt;a href="http://www.cdc.gov/nchs/data/ice/icd10_transcode.pdf"&gt;External Cause of Injury Mortality Matrix for ICD-10&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Once we have &lt;a href="https://github.com/diegovalle/Juarez-Classifier/blob/master/src/codeMM.R"&gt;recoded the mortality database&lt;/a&gt; to include the mortality matrix we can visualize the different types of violent or injury intent deaths according to injury mechanism:&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/--woDL7FfFh4/T9ZimidCH3I/AAAAAAAAFVQ/jULY3_Yis78/s1600/percent.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="http://2.bp.blogspot.com/--woDL7FfFh4/T9ZimidCH3I/AAAAAAAAFVQ/jULY3_Yis78/s400/percent.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
You can visually notice the resemblance between homicide deaths and deaths of unknown intent since both tend to involve firearms. Deaths by accident are mainly caused by transportation (motor vehicles) and suicides by suffocation (think hanging).&lt;br /&gt;
&lt;br /&gt;
It's also worth pointing out that accidental deaths by unspecified mechanism increased at precisely the same time homicides shot through the roof, which could imply that there was some leakage of homicides into accidents, but in this post I'll go with the conservative assumption that all homicides, suicides and accidents were correctly classified by the Mexican health authorities.&lt;br /&gt;
&lt;br /&gt;
The injury mechanism isn't the only useful information we can use to differentiate the type of death since victims of homicide also tend to be younger. We can also use the location where the body was found and the year of death. I could certainly use a more complex model that included marital status, day of week when they death occurred, and so on, but with the high &lt;a href="http://en.wikipedia.org/wiki/Sensitivity_and_specificity"&gt;specificity and sensitivity&lt;/a&gt; that resulted from the simple model I used, I saw no need to complicate things further (that and my laptop has 2GB of RAM).&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;br /&gt;
Of course things are never as simple as in textbooks, and the Mexican mortality database has some missing values. I assumed homicides where the year of occurrence was not available occurred in the same year the death was registered. For the rest of the data I used k-Nearest Neighbors to impute the missing values.&lt;i style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial, sans-serif; font-size: small; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 16px; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;br /&gt;
&lt;/i&gt;&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="http://3.bp.blogspot.com/-z5jWTK0yHKA/T9NqkJzatLI/AAAAAAAAFUM/L8PkDv04mMA/s1600/missing.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="221" src="http://3.bp.blogspot.com/-z5jWTK0yHKA/T9NqkJzatLI/AAAAAAAAFUM/L8PkDv04mMA/s400/missing.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;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
Most accidents by unspecified injury mechanism were classified as transportation accidents which agrees with &lt;a href="http://www.who.int/violence_injury_prevention/road_safety_status/2009/gsrrs_paho.pdf"&gt;previous findings&lt;/a&gt; that road deaths are under-counted in Mexico.&lt;br /&gt;
&lt;br /&gt;
The cleaned up dataset looks like this: &lt;br /&gt;
&lt;pre&gt;EDADVALOR         CAUSE SEXOtxt     LUGLEStxt ANIODEF PRESUNTOtxt
7.483315 All Transport    Male          Home    2007    Accident
5.656854       Firearm    Male          Home    2007    Homicide
6.164414       Firearm    Male Public Street    2009    Homicide
6.082763       Firearm    Male          Home    2007    Homicide
4.690416     Poisoning    Male Public Street    2004    Accident&lt;/pre&gt;
Where:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;EDADVALOR is the square root of age in years&lt;/li&gt;
&lt;li&gt;CAUSE is the injury mechanism&lt;/li&gt;
&lt;li&gt;SEXOtxt is the sex of the victim&lt;/li&gt;
&lt;li&gt;LUGLEStxt is the place where the lesion occurred&lt;/li&gt;
&lt;li&gt;ANIODEF is the year the death occurred&lt;/li&gt;
&lt;li&gt;PRESUNTOtxt is the injury intent&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
I divided the dataset into training (75% of the data) and test sets. I then fit a penalized a regression (glmnet package), a support vector machine (with a radial kernel since it had better performance than a linear one), and a random forest model to the training set and evaluated their accuracy against the test set using the &lt;a href="http://cran.r-project.org/web/packages/caret/index.html"&gt;caret package&lt;/a&gt;.&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="http://1.bp.blogspot.com/--azCncFl10I/T9aE752-O1I/AAAAAAAAFVc/vEE617kHv94/s1600/accuracy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="288" src="http://1.bp.blogspot.com/--azCncFl10I/T9aE752-O1I/AAAAAAAAFVc/vEE617kHv94/s320/accuracy.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
The random forest model had the highest accuracy (though within the margin of error of the SVM) and that's the algorithm I used to classify the deaths. Here's its confusion matrix:&lt;br /&gt;
&lt;pre&gt;Confusion Matrix and Statistics

          Reference
Prediction Accident Homicide Suicide
  Accident      743       50       5
  Homicide       92     2083      22
  Suicide        19       33      92

Overall Statistics
                                          
               Accuracy : 0.9296          
                 95% CI : (0.9201, 0.9383)
    No Information Rate : 0.69            
    P-Value [Acc &amp;gt; NIR] : &amp;lt; 2.2e-16       
                                          
                  Kappa : 0.8422          
 Mcnemar's Test P-Value : 4.468e-05       

Statistics by Class:

                     Class: Accident Class: Homicide Class: Suicide
Sensitivity                   0.8700          0.9617        0.77311
Specificity                   0.9759          0.8828        0.98278
Pos Pred Value                0.9311          0.9481        0.63889
Neg Pred Value                0.9526          0.9119        0.99098
Prevalence                    0.2721          0.6900        0.03791
Detection Rate                0.2367          0.6636        0.02931
Detection Prevalence          0.2542          0.6999        0.04587&lt;/pre&gt;
&lt;br /&gt;
The random forest had a sensitivity of 96% for homicides, that is, out of the 2166 homicides in our testing sample, 2083 where classified correctly. And a specificity of 88%, that is, out of the 973 suicides and accidents in our testing sample, 859 where classified correctly.&lt;br /&gt;
&lt;br /&gt;
Here's the comparison with the original data:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-0psNwG50Y2w/T9KcEPtDBwI/AAAAAAAAFTo/ps20apJfjbY/s1600/juarez-correct.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://2.bp.blogspot.com/-0psNwG50Y2w/T9KcEPtDBwI/AAAAAAAAFTo/ps20apJfjbY/s400/juarez-correct.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;table border="1"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;Year &lt;/th&gt; &lt;th&gt;Injury Intent &lt;/th&gt; &lt;th&gt;Original Deaths &lt;/th&gt; &lt;th&gt;Imputed Deaths &lt;/th&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;2004 &lt;/td&gt; &lt;td&gt;Homicide &lt;/td&gt; &lt;td align="right"&gt;208 &lt;/td&gt; &lt;td align="right"&gt;226 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;2005 &lt;/td&gt; &lt;td&gt;Homicide &lt;/td&gt; &lt;td align="right"&gt;275 &lt;/td&gt; &lt;td align="right"&gt;288 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;2006 &lt;/td&gt; &lt;td&gt;Homicide &lt;/td&gt; &lt;td align="right"&gt;221 &lt;/td&gt; &lt;td align="right"&gt;248 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right" style="background-color: #fff2cc; color: black;"&gt;&lt;b&gt;2007 &lt;/b&gt;&lt;/td&gt; &lt;td style="background-color: #fff2cc; color: black;"&gt;&lt;b&gt;Homicide &lt;/b&gt;&lt;/td&gt; &lt;td align="right" style="background-color: #fff2cc; color: black;"&gt;&lt;b&gt;202 &lt;/b&gt;&lt;/td&gt; &lt;td align="right" style="background-color: #fff2cc; color: black;"&gt;&lt;b&gt;300 &lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;2008 &lt;/td&gt; &lt;td&gt;Homicide &lt;/td&gt; &lt;td align="right"&gt;1616 &lt;/td&gt; &lt;td align="right"&gt;1679 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;2009 &lt;/td&gt; &lt;td&gt;Homicide &lt;/td&gt; &lt;td align="right"&gt;2397 &lt;/td&gt; &lt;td align="right"&gt;2476 &lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td align="right"&gt;2010 &lt;/td&gt; &lt;td&gt;Homicide &lt;/td&gt; &lt;td align="right"&gt;3686* &lt;/td&gt; &lt;td align="right"&gt;3867&lt;span style="background-color: white; color: black; display: inline ! important; float: none; font-family: verdana,arial,helvetica,code2000,sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;*&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style="font-size: x-small;"&gt;* Under-counted by about 3%&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The imputed number is still not the final number of homicides since (ignoring any statistical error and clandestine graves) homicides are under-counted by around 3% for the last year because the database has a cutoff date for registering deaths of December 31st. Taking this into account and rounding up, the number of imputed homicides in Juárez woud be close to 4,000. According to the &lt;a href="http://www.secretariadoejecutivo.gob.mx/work/models/SecretariadoEjecutivo/Resource/131/1/images/CIEISP_2010%281%29.pdf"&gt;SNSP&lt;/a&gt; there were 3,903 homicides in the state of Chihuahua (yeah right), and according to the criminal rivalry database there were 2,738 drug war-related homicides in Juárez during 2010.&lt;br /&gt;
&lt;br /&gt;
&lt;table border="1"&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;Total 2008-2010 &lt;/th&gt; &lt;th&gt;Original Deaths &lt;/th&gt; &lt;th&gt;Imputed Deaths &lt;/th&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&amp;nbsp; &lt;/td&gt; &lt;td align="right"&gt;7699 &lt;/td&gt; &lt;td align="right"&gt;8022 &lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div style="font-family: Verdana,sans-serif;"&gt;
&lt;b&gt;Why did it happen?&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
The high number of deaths of unknown injury intent that resemble homicides could be due to several factors:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The takeover of law enforcement functions by the military in 2008, then the federal police in 2010, and yet again the municipal police in 2011 could have played havoc on record keeping.&lt;/li&gt;
&lt;li&gt;The high levels of violence overwhelmed forensic services and legal authorities.&lt;/li&gt;
&lt;li&gt;Some estimates put the number of people who left Juárez as high as 230,000, this surely that had some effect on the quality of vital statistics.&lt;/li&gt;
&lt;li&gt;Given that classifying deaths of unknown intent increased the number of homicides by about 50% in 2007-- before the violence started-- statistical manipulation is certainly worth some consideration. &lt;a href="http://kpbs.media.clients.ellingtoncms.com/news/documents/2011/09/05/Wikileaks_Ciudad_Juarez.pdf"&gt;According to wikileaks&lt;/a&gt; Juárez had 316 murders in 2007 (though it's not clear if the number refers to the Zona Norte) which is close to the imputed estimate.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;div style="font-family: Verdana,sans-serif;"&gt;
&lt;b&gt;Future Research&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
Juárez is not the only place where deaths of unknown intent increased, it's also worth checking out states like Tamaulipas, Coahuila, San Luís Potosí and Durango.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-wh-g4GU-5D8/TxxU8-ZVrgI/AAAAAAAAFCc/Ravy9NmlM_o/s1600/uii-firearm.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://3.bp.blogspot.com/-wh-g4GU-5D8/TxxU8-ZVrgI/AAAAAAAAFCc/Ravy9NmlM_o/s400/uii-firearm.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Sometimes accidental deaths by firearm have interesting patterns&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-1xxFw-5XG5E/UA9gD08P8BI/AAAAAAAAFZY/t8MEn4KXEHI/s1600/diffplot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://2.bp.blogspot.com/-1xxFw-5XG5E/UA9gD08P8BI/AAAAAAAAFZY/t8MEn4KXEHI/s400/diffplot.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
In Michoacán homicides dropped soon after the start of the Operation Michoacán on December 11, 2007, but accidents of unknown injury mechanism rose at the same time, since transport accidents dropped at the same time as homicides it is not entirely clear what happened:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-p__YIEFQqLU/UA9lSwbdwzI/AAAAAAAAFZk/i5dw7V-l550/s1600/mich.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="201" src="http://4.bp.blogspot.com/-p__YIEFQqLU/UA9lSwbdwzI/AAAAAAAAFZk/i5dw7V-l550/s400/mich.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
P.S. You can download the code and data at my &lt;a href="https://github.com/diegovalle/Juarez-Classifier"&gt;github account&lt;/a&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/8108434569098161564/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/07/machine-learning-for-better-homicide.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/8108434569098161564?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/8108434569098161564?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/ginC4HK8u5o/machine-learning-for-better-homicide.html" title="Machine learning for better homicide counts in Ciudad Juarez" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-W2o3uUKAMBU/TfjTaI2nGPI/AAAAAAAAEws/5QtWaSSKr-Y/s72-c/3327366294_127b38c355_b.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/07/machine-learning-for-better-homicide.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0IFQH89eip7ImA9WhJSEkU.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-3931746796713682014</id><published>2012-07-02T19:24:00.000-05:00</published><updated>2012-07-02T22:18:31.162-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-02T22:18:31.162-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mexican Elections" /><title>Poll of polls including the 'quick count'</title><content type="html">&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="http://3.bp.blogspot.com/-ttzpI2cDV1E/T_JkchXwUPI/AAAAAAAAFYw/ObNkqMNJTdA/s1600/surface327.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-ttzpI2cDV1E/T_JkchXwUPI/AAAAAAAAFYw/ObNkqMNJTdA/s400/surface327.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
As expected Peña Nieto won and AMLO came in second place, but the polls way overestimated the voting intention of Peña Nieto, underestimated AMLO's expected vote, and to a lesser extent also underestimated Josefina Vázquez Mota's vote.&lt;br /&gt;
&lt;br /&gt;
The Federal Elections Board in Mexico runs a "quick count" (conteo rápido), a random sample of returns from voting booths across the country, which serves as a highly accurate exit poll. Measuring the euclidian distance from the normalized "quick count" to the voting preferences, the most accurate pollsters were:&amp;nbsp; SDP Noticias-Covarrubias, Grupo Reforma, Ipsos-Bimsa, and UNO TV-María de las Hera. The worst performing pollsters were Milenio-GEA ISA and Indemerc.&lt;br /&gt;
&lt;br /&gt;
Rerunning my polls of polls using the quick count results as if they were the result of a poll taken on election day with a massive sample size and free of pollster bias (I plan on rerunning this analysis when the final election results are known) I get the chart at the top the post. The results are quite striking, particularly with regard to Pena Nieto, and indicate a relatively big bias among most pollsters. I'm very curious about what it is the polling firms did wrong to oversample PRI voters or otherwise bias their results.&lt;br /&gt;
&lt;br /&gt;
There's always the possibility that AMLO had a late surge, but it doesn't look like there was one since some of the private exit polls also tended to put Peña Nieto ahead of what the "quick count" predicted. And exit polls are usually much more accurate than polling. It's very likely there was bias.&lt;br /&gt;
&lt;br /&gt;
Reference&lt;br /&gt;
&lt;br /&gt;
Simon Jackman. Bayesian Analysis for the Social Sciences. John Wiley &amp;amp; Sons, 2009</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/3931746796713682014/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/07/poll-of-polls-including-quick-count.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/3931746796713682014?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/3931746796713682014?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/a8wJBH0s-wE/poll-of-polls-including-quick-count.html" title="Poll of polls including the 'quick count'" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-ttzpI2cDV1E/T_JkchXwUPI/AAAAAAAAFYw/ObNkqMNJTdA/s72-c/surface327.png" height="72" width="72" /><thr:total>6</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/07/poll-of-polls-including-quick-count.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04ERXw7eSp7ImA9WhJTGE4.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-4063387724521643281</id><published>2012-06-27T17:23:00.001-05:00</published><updated>2012-06-27T17:25:04.201-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-27T17:25:04.201-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mexican Elections" /><title>Final poll of polls</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-MK6Hw0x6Yn8/T-t2E0zeJ4I/AAAAAAAAFX8/UEXGqY30Azk/s1600/surface242.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-MK6Hw0x6Yn8/T-t2E0zeJ4I/AAAAAAAAFX8/UEXGqY30Azk/s400/surface242.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
On Sunday, July 1, 2012 Mexican voters will go to the polls and elect a new president. In Mexico whichever candidate wins a simple plurality of the national vote is elected. Before the election of Vicente Fox of the PAN in 2000 Mexico had been ruled by a single party (the PRI) for over 70 years. &lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
There are three main parties in Mexico:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;i&gt;Partido Revolucionary Institucional&lt;/i&gt; (PRI) commonly described as&amp;nbsp;center-left. Its candidate is the former governor of the State of Mexico Enrique Peña Nieto (EPN)&lt;/li&gt;
&lt;li&gt;The &lt;i&gt;Partido Acción Nacional&lt;/i&gt; (PAN): The right-wing party which currently holds the presidency. Its candidate is&amp;nbsp;Josefina Vázquez Mota (JVM)&lt;/li&gt;
&lt;li&gt;The &lt;i&gt;Partido de la Revolución Democrática&lt;/i&gt;: A left wing party which lost the presidency in 2006 by the razor thin margin of .56%. It's candidate is the same one as in 2006, Andrés Manuel López Obrador (AMLO)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;The Data&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
My data comes from the &lt;a href="http://www.adnpolitico.com/encuestas"&gt;poll of polls by ADN Político&lt;/a&gt;. I made some adjustments to the data:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;I'm using the midpoint of the start and end dates of the surveys as the polling date &lt;/li&gt;
&lt;li&gt;I added a couple of polls conducted by Indemerc and corrected some missing polls from El Universal - Buendía y Laredo &lt;/li&gt;
&lt;li&gt;I'm using weekly averages of the GEA-ISA daily tracking poll because it has some weird periodical artifacts&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;The Model&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
My first idea was to simply model the presidential race using a dirichlet regression for all four candidates smoothed with splines. This ignores any effect each polling firm may have (some polling firms tend to favor one particular candidate) &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-x0heZ2-rIZ8/T9ZcMdvJsfI/AAAAAAAAFU8/Xn9Zk8EXrFc/s1600/surface759.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="213" src="http://4.bp.blogspot.com/-x0heZ2-rIZ8/T9ZcMdvJsfI/AAAAAAAAFU8/Xn9Zk8EXrFc/s320/surface759.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
I later switched to a Bayesian method of pooling the polls. I'm using a Kalman 
Filter that corrects for House Effects (the bias of each polling firm) 
as described in &lt;a href="http://www.essex.ac.uk/bes/2007%20nes%20conference/papers/jackman.pdf"&gt;&lt;i&gt;Pooling the Polls Over an Election Campaign&lt;/i&gt;&lt;/a&gt; (pdf), by Simon Jackman&lt;i&gt;&lt;/i&gt; (any mistakes are obviously mine). The only difference from the paper (a minor one) is that since Australia has two main political parties and Mexico has 3 main ones plus one small one, the precision is calculated a bit differently.&lt;br /&gt;
&lt;br /&gt;
I could certainly have improved the forecast by taking into account the economic and security conditions in Mexico since those are the two issues which come out on top when voters are asked what they care about the most. But with virtually only one free presidential election having happened in Mexico (the 2006 one doesn't count since it was very close) it would involve more time than I'm willing to commit.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-b-rS4-CwLbY/T-tCdAJKzlI/AAAAAAAAFXc/9igbelc26gU/s1600/gdp-leamer.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/-b-rS4-CwLbY/T-tCdAJKzlI/AAAAAAAAFXc/9igbelc26gU/s320/gdp-leamer.png" width="320" /&gt;&lt;/a&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="http://2.bp.blogspot.com/-bmhdnrJ_Tvc/T-tC9y2Z3lI/AAAAAAAAFXk/WVRYRXf9ELo/s1600/Rplot15.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="175" src="http://2.bp.blogspot.com/-bmhdnrJ_Tvc/T-tC9y2Z3lI/AAAAAAAAFXk/WVRYRXf9ELo/s320/Rplot15.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;&lt;br /&gt;&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://4.bp.blogspot.com/-WVHQRLG6AfY/T-tH2SjZqwI/AAAAAAAAFXw/uzcRt6yY87Y/s1600/historic.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="208" src="http://4.bp.blogspot.com/-WVHQRLG6AfY/T-tH2SjZqwI/AAAAAAAAFXw/uzcRt6yY87Y/s320/historic.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
Given the security and economic situation in Mexico, once campaigning started Josefina Vázquez Mota &lt;a href="http://blog.diegovalle.net/2012/06/campaign-effects.html"&gt;dropped in the polls&lt;/a&gt;. Even former president Vicente Fox recently stabbed the PAN in the back and called on the electorate to 
vote for the front-runner Peña Nieto and accused the current president 
of violating human rights due to the drug war.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Forecast&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Mexico enforces a polling ban three days before the election (starting tomorrow) and there seems to be very noticeable trend in the voting intention of the candidates so I simulated draws from the posterior voting intention of each candidate and then used the auto.arima function from the &lt;a href="http://cran.r-project.org/web/packages/forecast/index.html"&gt;forecast&lt;/a&gt; package to predict what the trend would be on election day.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;House Effects&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The model could also be improved by using better priors for the house effect of each polling firm. For example, if you believe there is an institutional bias in favor of Peña Nieto and that the most thrustworthy pollster are Reforma, SDP Noticias and UNO TV then you'll disagree with the estimate from the model I'm using with diffuse priors.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ehK0-oI9tGY/T-t2sC0eQAI/AAAAAAAAFYM/-9T2U3ga9CY/s1600/surface247.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://2.bp.blogspot.com/-ehK0-oI9tGY/T-t2sC0eQAI/AAAAAAAAFYM/-9T2U3ga9CY/s400/surface247.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
The three polling firms where Peña Nieto polled the worst where Grupo Reforma, SDP Noticas-Covarrubias, and UNO TV-María de las Heras (María de las Heras was the worst pollster at predicting the 2006 election). All three polling firms reported and increase in Peña Nieto voting intention from May to June (Uno TV 39% -&amp;gt; 40.1%, SDP Noticias 40% -&amp;gt; 41%, and Reforma 38% -&amp;gt; 42%)&lt;br /&gt;
&lt;br /&gt;
It would take an act of god for Peña Nieto not to be declared the winner
 on Sunday. &lt;b&gt;The probability of AMLO beating JVM for
 the second place is 96%&lt;/b&gt;. &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-1dNG4z_G0z8/T-t2M0UE9gI/AAAAAAAAFYE/ftZcTrRWElY/s1600/surface262.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-1dNG4z_G0z8/T-t2M0UE9gI/AAAAAAAAFYE/ftZcTrRWElY/s400/surface262.png" width="342" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;b&gt;Interactive Chart&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I may still be missing one or two polls in this analysis so be sure to visit my &lt;a href="http://www.diegovalle.net/electometer"&gt;interactive chart&lt;/a&gt; for the latest info and forecast.&lt;br /&gt;
&lt;br /&gt;
One thing is for certain: there is no stopping Enrique Peña Nieto; the PRI will soon be here. And I for one welcome our new prehistoric overlords. I'd like to remind them that as a trusted blog personality, I can be helpful in hiding crime statistics (under the bed) while the proletariat toils in their underground meth labs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;References&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Pooling the Polls Over an Election Campaign,&lt;a href="http://www.tandf.co.uk/journals/titles/10361146.asp"&gt; Australian Journal of Political Science&lt;/a&gt;, 2005 V40(4):499-517
&lt;br /&gt;
&lt;br /&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/4063387724521643281/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/06/final-poll-of-polls.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/4063387724521643281?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/4063387724521643281?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/UMWcfQ7zl60/final-poll-of-polls.html" title="Final poll of polls" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-MK6Hw0x6Yn8/T-t2E0zeJ4I/AAAAAAAAFX8/UEXGqY30Azk/s72-c/surface242.png" height="72" width="72" /><thr:total>6</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/06/final-poll-of-polls.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcHSHo-fip7ImA9WhJTGU4.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-6941301528044792998</id><published>2012-06-27T07:39:00.000-05:00</published><updated>2012-06-28T21:13:59.456-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-28T21:13:59.456-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="Mexican Elections" /><category scheme="http://www.blogger.com/atom/ns#" term="d3js" /><title>Elect-o-meter</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.diegovalle.net/electometer" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-tfbc1GXvXQE/T-qE3LjgZhI/AAAAAAAAFXQ/4gef-385B-M/s400/Screenshot+from+2012-06-26+22:56:27.png" width="360" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Check out the &lt;a href="http://www.diegovalle.net/electometer"&gt;interactive poll of polls&lt;/a&gt; I made.&lt;br /&gt;
&lt;br /&gt;
P.S. There is a poll ban starting tomorrow so I'll restrict access to the interactive chart to people outside Mexico.</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/6941301528044792998/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/06/elect-o-meter.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/6941301528044792998?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/6941301528044792998?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/iROgndUBLhw/elect-o-meter.html" title="Elect-o-meter" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-tfbc1GXvXQE/T-qE3LjgZhI/AAAAAAAAFXQ/4gef-385B-M/s72-c/Screenshot+from+2012-06-26+22:56:27.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/06/elect-o-meter.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkAMQ3s4cCp7ImA9WhJTFEw.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-5808045952266336868</id><published>2012-06-22T00:00:00.000-05:00</published><updated>2012-06-22T20:26:22.538-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-22T20:26:22.538-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mexican Elections" /><title>Campaign Effects</title><content type="html">&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;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-A64YRQZ3Su8/T-UbNpEtYAI/AAAAAAAAFWg/zGaqrmjHBkA/s1600/jos.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://3.bp.blogspot.com/-A64YRQZ3Su8/T-UbNpEtYAI/AAAAAAAAFWg/zGaqrmjHBkA/s400/jos.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
In Mexico presidential campaigns last 90 days. This year campaigning started on March 30, before this date all campaigning was prohibited. Judging by the way Josefina Vázquez Mota's support fell after she started campaigning voters either didn't like what they saw in her ideology and issue stance or she is a very bad campaigner.</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/5808045952266336868/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/06/campaign-effects.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5808045952266336868?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5808045952266336868?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/b8B0IKWs5qU/campaign-effects.html" title="Campaign Effects" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-A64YRQZ3Su8/T-UbNpEtYAI/AAAAAAAAFWg/zGaqrmjHBkA/s72-c/jos.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/06/campaign-effects.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8ARH84eSp7ImA9WhJTEkQ.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-1456892458569843677</id><published>2012-06-21T09:00:00.000-05:00</published><updated>2012-06-21T10:34:05.131-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-21T10:34:05.131-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mexican Elections" /><title>Debate Effects</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-Of_BRTijPr8/T-J6DzlZNYI/AAAAAAAAFV0/eZAJIc7R2cw/s1600/surface16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" src="http://4.bp.blogspot.com/-Of_BRTijPr8/T-J6DzlZNYI/AAAAAAAAFV0/eZAJIc7R2cw/s400/surface16.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Gabriel Quadri, the candidate for the Mexican presidency of a small party practically owned by the teachers' union must be a good debater. Since his debate performance he has managed to consistently poll over the 2% required for his party to keep its registration. One small problem with this analysis is that sometimes polling firms report voter preferences as rounded numbers, and for candidates polling in the 0-4% range this introduces some artifacts.</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/1456892458569843677/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/06/debate-effects.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/1456892458569843677?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/1456892458569843677?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/VZr-RWSqHDI/debate-effects.html" title="Debate Effects" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-Of_BRTijPr8/T-J6DzlZNYI/AAAAAAAAFV0/eZAJIc7R2cw/s72-c/surface16.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/06/debate-effects.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YBQH08cSp7ImA9WhJTEkk.&quot;"><id>tag:blogger.com,1999:blog-3280550716273637581.post-5732073207981637999</id><published>2012-06-20T21:57:00.001-05:00</published><updated>2012-06-20T22:25:51.379-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-20T22:25:51.379-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mexican Elections" /><title>Poll of polls - June 20</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-cyYb8U7dn60/T-KCTLJwUZI/AAAAAAAAFWA/BHYsTRpQZ6k/s1600/surface6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="http://3.bp.blogspot.com/-cyYb8U7dn60/T-KCTLJwUZI/AAAAAAAAFWA/BHYsTRpQZ6k/s400/surface6.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Time for another update of my poll of polls. With less than two weeks remaining until voting day the race is on! I mean the race for second place because Enrique Peña Nieto of the &lt;i&gt;Partido Revolucionario Institucional&lt;/i&gt; has pretty much cinched the presidency for the next six years. &lt;br /&gt;
&lt;br /&gt;
I've now switched to a Bayesian method of pooling the polls. I'm using a Kalman Filter that corrects for House Effects (the bias of each polling firm) as described in &lt;a href="http://www.essex.ac.uk/bes/2007%20nes%20conference/papers/jackman.pdf"&gt;&lt;i&gt;Pooling the Polls Over an Election Campaign&lt;/i&gt;&lt;/a&gt; (pdf), by Simon Jackman&lt;i&gt;.&lt;/i&gt; I'm using diffuse priors for the &lt;a href="http://fivethirtyeight.blogs.nytimes.com/glossary/"&gt;house effects&lt;/a&gt; but I could probably switch to using the posteriors for each polling firm from the 2006 election, if I ever get around to modeling it.&lt;br /&gt;
&lt;br /&gt;
The thing that worries the most is that polling firms tend to be highly variable, for example, in 2006 the most accurate pollsters were Reforma and GEA-ISA, but in the last elections they did not perform so well. Oh well, we'll see what happens.&lt;br /&gt;
&lt;br /&gt;
To recap from previous blogs&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;My data comes from the &lt;a href="http://www.adnpolitico.com/encuestas"&gt;poll of polls by ADN Político.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I added a couple of polls conducted by Indemerc and corrected some missing polls from El Universal - Buendía y Laredo &lt;/li&gt;
&lt;li&gt;I'm using weekly averages of the GEA-ISA daily tracking poll because it has some weird periodical artifacts&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
References&lt;br /&gt;
&lt;br /&gt;
Pooling the Polls Over an Election Campaign,&lt;a href="http://www.tandf.co.uk/journals/titles/10361146.asp"&gt; Australian Journal of Political Science&lt;/a&gt;, 2005 V40(4):499-517</content><link rel="replies" type="application/atom+xml" href="http://blog.diegovalle.net/feeds/5732073207981637999/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://blog.diegovalle.net/2012/06/poll-of-polls-june-20.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5732073207981637999?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3280550716273637581/posts/default/5732073207981637999?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DiegoVallesFoodWineBlog/~3/0wttImvTX4s/poll-of-polls-june-20.html" title="Poll of polls - June 20" /><author><name>Diego Valle-Jones</name><uri>https://plus.google.com/112417668983107842349</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh6.googleusercontent.com/-CLGUmzOvozE/AAAAAAAAAAI/AAAAAAAAF_A/jYbEp-jkCno/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-cyYb8U7dn60/T-KCTLJwUZI/AAAAAAAAFWA/BHYsTRpQZ6k/s72-c/surface6.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.diegovalle.net/2012/06/poll-of-polls-june-20.html</feedburner:origLink></entry></feed>
