<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/family-violence-and-economic-deprivation-in-new-zealand/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://ellisp.github.io/blog/2017/07/02/family-violence"> Peter's stats stuff - R</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>New Zealand’s Family Violence Death Review Committee recently released their <a rel="nofollow" href="https://www.hqsc.govt.nz/assets/FVDRC/Publications/FVDRC_2017_10_final_web.pdf" target="_blank">Fifth Report Data: January 2009 to December 2015</a>, some grim reading on what it describes rightly as “the devastation of family violence”.</p>
<p>I was interested by Figure 3 on page 21, which shows a bar chart of the number of offenders by two-classification ethnicity and the socio-economic deprivation of their area of residence. It showed only raw counts of offenders without reference to the size of the sub-populations in question. This potentially either hides or magnifies any interaction effect between these two factors. So I created my own version:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0103-interaction.svg"></p>
<p>We can see clearly that proportionately speaking, there is a much higher probability of someone being an offender in a family violence death in higher deprivation areas. The relationship with area deprivation is much stronger for Māori people. Māori living in the most deprived quintile are around four times as likely to become such offenders than Māori in the middle quintile; for non-Māori the ratio is a bit less than two. Māori and non-Māori living in the 60% least deprived areas (ie quintiles 1, 2 and 3) have similar (low) probabilities of becoming an offender.</p>
<p>I like my chart because it highlights not just the importance for understanding family violence of the deprivation of the area of residence and of being Māori, but the critical inflating effect of the <em>combination</em> of the two.</p>
<p>A quote from the foreword to the report makes a related point:</p>
<blockquote>
<p>“The over-representation of Māori among family violence deceased and offenders, as well as those<br>
from the most deprived neighbourhoods, illustrates that family violence is not distributed equally. For<br>
Māori, multiple intersecting disadvantages, both contemporary and historical, continue to contribute<br>
to the violence within whānau seen today. For those experiencing family violence and living in the<br>
most deprived neighbourhoods, including many Māori whānau, the health sector’s continued focus on<br>
improving equity in the quality and safety of services for all populations is paramount.”</p>
</blockquote>
<p><em>Professor Alan Merry, Chair, Health Quality &amp; Safety Commission, June 2017</em></p>
<p>Pulling together this chart was surprisingly fiddly and I had to draw on three different data sources:</p>
<ul>
<li>the offender numbers in the Committee’s report (which I couldn’t find as a table, so had to read off the bar chart)</li>
<li>The <a rel="nofollow" href="http://cphronline.massey.ac.nz/maps/maps_nz_dep_index.html" target="_blank">New Zealand index of deprivation</a></li>
<li>Stats NZ’s <a rel="nofollow" href="http://www.stats.govt.nz/Census/2013-census/data-tables/meshblock-dataset.aspx" target="_blank">2013 Census meshblock dataset</a>, which I’ve previously made available in pre-processed form in my <a rel="nofollow" href="https://github.com/ellisp/nzelect" target="_blank">nzcensus R package</a>.</li>
</ul>
<h2>Combining data</h2>
<p>Here’s R code that gets going with joining the New Zealand index of deprivation to Stats NZ’s census data as pre-packaged in <code>nzcensus</code> (by me, not by Stats NZ – use at your own risk). Only 1,867 area units are listed in the deprivation data, dropping 145 areas that are in the census data.</p>
<p>An apology in advance – some of the macrons in “Māori” are missing in what follows. Some upgrade somewhere has changed the handling of unicode characters on my machine and I haven’t had time to fix it before releasing this.</p>
<figure>
<pre><code data-lang="r"><span># Install nzcensus package, if necessary:
</span><span>devtools</span><span>::</span><span>install_github</span><span>(</span><span>&quot;ellisp/nzelect/pkg2&quot;</span><span>)</span><span>
</span><span>library</span><span>(</span><span>nzcensus</span><span>)</span><span>
</span><span>library</span><span>(</span><span>tidyverse</span><span>)</span><span>
</span><span>library</span><span>(</span><span>scales</span><span>)</span><span>
</span><span>library</span><span>(</span><span>forcats</span><span>)</span><span>
</span><span>library</span><span>(</span><span>testthat</span><span>)</span><span>
</span><span>library</span><span>(</span><span>gridExtra</span><span>)</span><span>
</span><span># Download the New Zealand Deprivation Index by area unit from Massey University
</span><span>nzdep</span><span> </span><span>&lt;-</span><span> </span><span>read.csv</span><span>(</span><span>&quot;http://cphronline.massey.ac.nz/data/csv?inline=true&amp;viewId=96&amp;viewName=New+Zealand+Index+of+Deprivation+Atlas&amp;geoId=15&amp;subsetId=&amp;instances=11701&quot;</span><span>,</span><span>
</span><span>stringsAsFactors</span><span> </span><span>=</span><span> </span><span>FALSE</span><span>)</span><span>
</span><span>names</span><span>(</span><span>nzdep</span><span>)</span><span> </span><span>&lt;-</span><span> </span><span>c</span><span>(</span><span>&quot;AU&quot;</span><span>,</span><span> </span><span>&quot;AU_NAM&quot;</span><span>,</span><span> </span><span>&quot;Dep&quot;</span><span>,</span><span> </span><span>&quot;X&quot;</span><span>)</span><span>
</span><span># check we have matches for all the area units:
</span><span>expect_equal</span><span>(</span><span>sum</span><span>(</span><span>nzdep</span><span>$</span><span>AU_NAM</span><span> </span><span>%in%</span><span> </span><span>AreaUnits2013</span><span>$</span><span>AU_NAM</span><span>),</span><span>
</span><span>nrow</span><span>(</span><span>nzdep</span><span>))</span><span>
</span><span># merge the deprivation index with the Area Unit data from the nzcensus package:
</span><span>d</span><span> </span><span>&lt;-</span><span> </span><span>nzdep</span><span> </span><span>%>%</span><span>
</span><span>select</span><span>(</span><span>-</span><span>X</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>left_join</span><span>(</span><span>AreaUnits2013</span><span>,</span><span> </span><span>by</span><span> </span><span>=</span><span> </span><span>&quot;AU_NAM&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Dep5</span><span> </span><span>=</span><span> </span><span>ceiling</span><span>(</span><span>Dep</span><span> </span><span>/</span><span> </span><span>2</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>denominator</span><span> </span><span>=</span><span> </span><span>ResidentPop2013</span><span>,</span><span>
</span><span>Maori</span><span> </span><span>=</span><span> </span><span>PropMaori2013</span><span> </span><span>*</span><span> </span><span>denominator</span><span>,</span><span>
</span><span>Maori</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>is.na</span><span>(</span><span>Maori</span><span>),</span><span> </span><span>0</span><span>,</span><span> </span><span>Maori</span><span>),</span><span>
</span><span>Pacific</span><span> </span><span>=</span><span> </span><span>PropPacific2013</span><span> </span><span>*</span><span> </span><span>denominator</span><span>,</span><span>
</span><span>Pacific</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>is.na</span><span>(</span><span>Pacific</span><span>),</span><span> </span><span>0</span><span>,</span><span> </span><span>Pacific</span><span>),</span><span>
</span><span>Other</span><span> </span><span>=</span><span> </span><span>denominator</span><span> </span><span>-</span><span> </span><span>Maori</span><span> </span><span>-</span><span> </span><span>Pacific</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>as_tibble</span><span>()</span></code></pre>
</figure>
<h2>Exploration</h2>
<p>My first step was to some exploration and reality-checking to see if I’ve obtained plausible results with my joining of data sets. I started with some basic examination of population totals by ethnicity and deprivation decile, and saw the expected pattern of increasing numbers of Māori and Pasifika in the lower decile areas:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0103-deprivation-ethnicity-barchart.svg"></p>
<p>From my understanding of the method of the deprivation index, there should be equal numbers of people in each decile of deprivation, meaning all the columns in the chart above should all be the same height. Clearly they’re not. I’ll file that one down to investigate later. I did try constructing my own populations with both “Resident Population” and “Population on Census night”, which didn’t make any noticeable difference.</p>
<p>Of more interest, here’s a comparison of the deprivation index with some of the census variables. We see that the more deprived area units also have lower incomes, more smokers, more people of Pacific origin, and less people with partners:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0103-boxplots.svg"></p>
<p>It’s generally agreed that marital or partnering status is correlated with health, income and happiness, with causality probably going in both directions. I hadn’t expected this individual-level effect to show up so clearly when aggregated to area units as it does in the graphic above.</p>
<p>Here’s the code for those exploratory plots:</p>
<figure>
<pre><code data-lang="r"><span>#-----------------exploratory graphics----------------------
</span><span>d</span><span> </span><span>%>%</span><span>
</span><span>group_by</span><span>(</span><span>Dep</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>Maori</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>Maori</span><span>),</span><span>
</span><span>Pacific</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>Pacific</span><span>),</span><span>
</span><span>Other</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>Other</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>Ethnicity</span><span>,</span><span> </span><span>Value</span><span>,</span><span> </span><span>-</span><span>Dep</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Ethnicity</span><span> </span><span>=</span><span> </span><span>fct_relevel</span><span>(</span><span>Ethnicity</span><span>,</span><span> </span><span>&quot;Other&quot;</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>as.factor</span><span>(</span><span>Dep</span><span>),</span><span> </span><span>weight</span><span> </span><span>=</span><span> </span><span>Value</span><span>,</span><span> </span><span>fill</span><span> </span><span>=</span><span> </span><span>Ethnicity</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_bar</span><span>(</span><span>position</span><span> </span><span>=</span><span> </span><span>&quot;stack&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_y_continuous</span><span>(</span><span>&quot;Usual resident population&quot;</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>comma</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>(</span><span>&quot;Massey Uni deprivation decile\n(higher numbers indicates living in a more deprived area)&quot;</span><span>),</span><span>
</span><span>fill</span><span> </span><span>=</span><span> </span><span>&quot;&quot;</span><span>)</span><span>
</span><span>#' convenience function, just for this post, which draws
#' area unit box plots of a census variable by deprivation index
</span><span>bp</span><span> </span><span>&lt;-</span><span> </span><span>function</span><span>(</span><span>variable</span><span>,</span><span> </span><span>ylab</span><span> </span><span>=</span><span> </span><span>NULL</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>percent</span><span>,</span><span> </span><span>title</span><span> </span><span>=</span><span> </span><span>&quot;&quot;</span><span>,</span><span>
</span><span>xlab</span><span> </span><span>=</span><span> </span><span>&quot;Massey Uni deprivation decile\n(higher numbers indicates living in a more deprived area)&quot;</span><span>){</span><span>
</span><span>if</span><span>(</span><span>is.null</span><span>(</span><span>ylab</span><span>)){</span><span>
</span><span>ylab</span><span> </span><span>&lt;-</span><span> </span><span>gsub</span><span>(</span><span>&quot;Prop&quot;</span><span>,</span><span> </span><span>&quot;Proportion &quot;</span><span>,</span><span> </span><span>variable</span><span>)</span><span>
</span><span>ylab</span><span> </span><span>&lt;-</span><span> </span><span>gsub</span><span>(</span><span>&quot;2013&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>ylab</span><span>)</span><span>
</span><span>}</span><span>
</span><span>d</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>DepF</span><span> </span><span>=</span><span> </span><span>as.factor</span><span>(</span><span>Dep</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes_string</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;DepF&quot;</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>variable</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_boxplot</span><span>()</span><span> </span><span>+</span><span>
</span><span>scale_y_continuous</span><span>(</span><span>ylab</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>label</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>xlab</span><span>)</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>title</span><span>)</span><span>
</span><span>}</span><span>
</span><span>grid.arrange</span><span>(</span><span>
</span><span>bp</span><span>(</span><span>&quot;PropPacific2013&quot;</span><span>,</span><span> </span><span>xlab</span><span> </span><span>=</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>title</span><span> </span><span>=</span><span> </span><span>&quot;Data by area unit from the New Zealand census 2013&quot;</span><span>),</span><span>
</span><span>bp</span><span>(</span><span>&quot;PropSmoker2013&quot;</span><span>,</span><span> </span><span>xlab</span><span> </span><span>=</span><span> </span><span>&quot;&quot;</span><span>),</span><span>
</span><span>bp</span><span>(</span><span>&quot;PropManagers2013&quot;</span><span>),</span><span>
</span><span>bp</span><span>(</span><span>&quot;MedianIncome2013&quot;</span><span>,</span><span> </span><span>&quot;Median Income&quot;</span><span>,</span><span> </span><span>dollar</span><span>)</span><span>
</span><span>)</span></code></pre>
</figure>
<h2>Modelling</h2>
<p>Finally, I needed to combine my area unit data with the family violence deaths aggregate data in the Committee’s report to create the graphic I started this post with, illustrating the strength of the combined effect of being Māori and living in a deprived area:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0103-interaction.svg"></p>
<p>I did some statistical modelling too, using a generalized linear model with a binomial response, taking the liberty of treating deprivation quintile as a continuous explanatory variable. For those interested in such things, the results show evidence of the interaction effect. The full model with the interaction is superior in terms of AIC (54 compared to 60), having residual deviance that matches the degrees of freedom, and a p-value showing “statistical significance” for what it’s worth.</p>
<div>
<pre><code>glm(formula = as.matrix(d2[, c(&quot;Offenders&quot;, &quot;NonOffenders&quot;)]) ~ 
    Ethnicity * Dep5, family = binomial, data = d2)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.7477  -0.3859  -0.1435   0.4975   0.9886  

Coefficients:
                     Estimate Std. Error z value Pr(>|z|)    
(Intercept)         -11.38628    0.27361 -41.615  &lt; 2e-16 ***
EthnicityMaori       -0.78663    0.78752  -0.999    0.318    
Dep5                  0.28560    0.07298   3.913 9.11e-05 ***
EthnicityMaori:Dep5   0.43892    0.17473   2.512    0.012 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 121.6809  on 9  degrees of freedom
Residual deviance:   6.7239  on 6  degrees of freedom
AIC: 54.372
</code></pre>
</div>
<p>Here’s the R code for merging the census data with the family violence data, drawing the chart and doing that statistical modelling.</p>
<figure>
<pre><code data-lang="r"><span>#==================family violence deaths==================
# Data from Figure 3, page 21 of &quot;Family Violence Death Review Committee&quot; Report 5
</span><span>
</span><span>fv</span><span> </span><span>&lt;-</span><span> </span><span>data_frame</span><span>(</span><span>
</span><span>Dep5</span><span> </span><span>=</span><span> </span><span>rep</span><span>(</span><span>1</span><span>:</span><span>5</span><span>,</span><span> </span><span>2</span><span>),</span><span>
</span><span>Ethnicity</span><span> </span><span>=</span><span> </span><span>rep</span><span>(</span><span>c</span><span>(</span><span>&quot;Maori&quot;</span><span>,</span><span> </span><span>&quot;NonMaori&quot;</span><span>),</span><span> </span><span>each</span><span> </span><span>=</span><span> </span><span>5</span><span>),</span><span>
</span><span>Offenders</span><span> </span><span>=</span><span> </span><span>c</span><span>(</span><span>0</span><span>,</span><span> </span><span>1</span><span>,</span><span> </span><span>4</span><span>,</span><span> </span><span>17</span><span>,</span><span> </span><span>46</span><span>,</span><span> </span><span>13</span><span>,</span><span> </span><span>14</span><span>,</span><span> </span><span>22</span><span>,</span><span> </span><span>18</span><span>,</span><span> </span><span>37</span><span>)</span><span>
</span><span>)</span><span>
</span><span># check if got roughly equal to what it should be
</span><span>expect_equal</span><span>(</span><span>sum</span><span>(</span><span>fv</span><span>$</span><span>Offenders</span><span>),</span><span> </span><span>195</span><span> </span><span>-</span><span> </span><span>9</span><span> </span><span>-</span><span> </span><span>5</span><span> </span><span>-</span><span> </span><span>9</span><span>)</span><span> </span><span>fv</span><span> </span><span>%>%</span><span>
</span><span>group_by</span><span>(</span><span>Ethnicity</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>Offenders</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>Offenders</span><span>))</span><span>
</span><span>d</span><span>2</span><span> </span><span>&lt;-</span><span> </span><span>d</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>NonMaori</span><span> </span><span>=</span><span> </span><span>Pacific</span><span> </span><span>+</span><span> </span><span>Other</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>select</span><span>(</span><span>NonMaori</span><span>,</span><span> </span><span>Maori</span><span>,</span><span> </span><span>Dep5</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>Ethnicity</span><span>,</span><span> </span><span>Population</span><span>,</span><span> </span><span>-</span><span>Dep5</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>group_by</span><span>(</span><span>Dep5</span><span>,</span><span> </span><span>Ethnicity</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>Population</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>Population</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>left_join</span><span>(</span><span>fv</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>NonOffenders</span><span> </span><span>=</span><span> </span><span>round</span><span>(</span><span>Population</span><span> </span><span>-</span><span> </span><span>Offenders</span><span>),</span><span>
</span><span>Proportion</span><span> </span><span>=</span><span> </span><span>Offenders</span><span> </span><span>/</span><span> </span><span>Population</span><span>,</span><span>
</span><span>Ethnicity</span><span> </span><span>=</span><span> </span><span>fct_relevel</span><span>(</span><span>Ethnicity</span><span>,</span><span> </span><span>&quot;NonMaori&quot;</span><span>))</span><span>
</span><span>mod_saturated</span><span> </span><span>&lt;-</span><span> </span><span>glm</span><span>(</span><span>as.matrix</span><span>(</span><span>d</span><span>2</span><span>[</span><span> </span><span>,</span><span> </span><span>c</span><span>(</span><span>&quot;Offenders&quot;</span><span>,</span><span> </span><span>&quot;NonOffenders&quot;</span><span>)])</span><span> </span><span>~</span><span> </span><span>Ethnicity</span><span> </span><span>*</span><span> </span><span>Dep5</span><span>,</span><span> </span><span>family</span><span> </span><span>=</span><span> </span><span>binomial</span><span>,</span><span> </span><span>data</span><span> </span><span>=</span><span> </span><span>d</span><span>2</span><span>)</span><span> </span><span>mod_simple</span><span> </span><span>&lt;-</span><span> </span><span>glm</span><span>(</span><span>as.matrix</span><span>(</span><span>d</span><span>2</span><span>[</span><span> </span><span>,</span><span> </span><span>c</span><span>(</span><span>&quot;Offenders&quot;</span><span>,</span><span> </span><span>&quot;NonOffenders&quot;</span><span>)])</span><span> </span><span>~</span><span> </span><span>Ethnicity</span><span> </span><span>+</span><span> </span><span>Dep5</span><span>,</span><span> </span><span>family</span><span> </span><span>=</span><span> </span><span>binomial</span><span>,</span><span> </span><span>data</span><span> </span><span>=</span><span> </span><span>d</span><span>2</span><span>)</span><span> </span><span>summary</span><span>(</span><span>mod_simple</span><span>)</span><span>
</span><span>summary</span><span>(</span><span>mod_saturated</span><span>)</span><span>
</span><span>anova</span><span>(</span><span>mod_saturated</span><span>)</span><span>
</span><span>d</span><span>2</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>Dep5</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>Proportion</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>Ethnicity</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_point</span><span>(</span><span>aes</span><span>(</span><span>size</span><span> </span><span>=</span><span> </span><span>Population</span><span>),</span><span> </span><span>alpha</span><span> </span><span>=</span><span> </span><span>0.5</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_smooth</span><span>(</span><span>method</span><span> </span><span>=</span><span> </span><span>&quot;loess&quot;</span><span>,</span><span> </span><span>se</span><span> </span><span>=</span><span> </span><span>FALSE</span><span>,</span><span> </span><span>span</span><span> </span><span>=</span><span> </span><span>2</span><span>,</span><span> </span><span>alpha</span><span> </span><span>=</span><span> </span><span>0.5</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_point</span><span>(</span><span>aes</span><span>(</span><span>size</span><span> </span><span>=</span><span> </span><span>Population</span><span>),</span><span> </span><span>shape</span><span> </span><span>=</span><span> </span><span>1</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;black&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_y_continuous</span><span>(</span><span>&quot;Proportion of area sub-population that\nwas an offender in family violence deaths&quot;</span><span>,</span><span>
</span><span>label</span><span> </span><span>=</span><span> </span><span>percent</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_size_area</span><span>(</span><span>max_size</span><span> </span><span>=</span><span> </span><span>10</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>comma</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;Deprivation quintile (higher means more deprived)&quot;</span><span>,</span><span>
</span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;&quot;</span><span>,</span><span>
</span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Source: Stats NZ census 2013 meshblock data, Massey University 2013 NZ Deprivation Index,
Family Violence Death Review Committee Fifth Report; analysis at https://ellisp.github.io.&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;Offenders in family violence deaths New Zealand 2009-15&quot;</span><span>,</span><span>
</span><span>&quot;By deprivation of area and ethnicity (n=172)&quot;</span><span>)</span></code></pre>
</figure>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://ellisp.github.io/blog/2017/07/02/family-violence"> Peter's stats stuff - R</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/32j0q5VDoL8" height="1"></a></div>