{"id":4594,"date":"2015-01-10T19:04:40","date_gmt":"2015-01-10T18:04:40","guid":{"rendered":"http:\/\/emilkirkegaard.dk\/en\/?p=4594"},"modified":"2015-03-06T01:17:50","modified_gmt":"2015-03-06T00:17:50","slug":"intelligence-income-inequality-and-prison-rates","status":"publish","type":"post","link":"https:\/\/emilkirkegaard.dk\/en\/2015\/01\/intelligence-income-inequality-and-prison-rates\/","title":{"rendered":"Intelligence, income inequality and prison rates: It&#8217;s complicated"},"content":{"rendered":"<p>There was some talk on Twitter around prison rates and inequality:<\/p>\n<div class=\"oceanwp-oembed-wrap clr\">\n<blockquote class=\"twitter-tweet\" data-width=\"550\" data-dnt=\"true\">\n<p lang=\"en\" dir=\"ltr\">I wonder why. &quot;Rates of imprisonment are higher in unequal countries <a href=\"http:\/\/t.co\/ibDN21PqZX\">http:\/\/t.co\/ibDN21PqZX<\/a>&quot; <a href=\"http:\/\/t.co\/EJy9vSCMFL\">http:\/\/t.co\/EJy9vSCMFL<\/a> MT <a href=\"https:\/\/twitter.com\/chartsandmaps?ref_src=twsrc%5Etfw\">@ChartsandMaps<\/a><\/p>\n<p>&mdash; JayMan (@JayMan471) <a href=\"https:\/\/twitter.com\/JayMan471\/status\/553912823215325184?ref_src=twsrc%5Etfw\">January 10, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/div>\n<p>And IQ and inequality:<\/p>\n<div class=\"oceanwp-oembed-wrap clr\">\n<blockquote class=\"twitter-tweet\" data-width=\"550\" data-dnt=\"true\">\n<p lang=\"en\" dir=\"ltr\">Here <a href=\"https:\/\/twitter.com\/JayMan471?ref_src=twsrc%5Etfw\">@JayMan471<\/a> i plotted it for you. rank-order r is higher and more proper (data not normal). <a href=\"http:\/\/t.co\/QzHDwxeIC4\">pic.twitter.com\/QzHDwxeIC4<\/a><\/p>\n<p>&mdash; Emil O W Kirkegaard (@KirkegaardEmil) <a href=\"https:\/\/twitter.com\/KirkegaardEmil\/status\/553937263953190912?ref_src=twsrc%5Etfw\">January 10, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/div>\n<p>But then what about prison data beyond those given above? I have downloaded the newest data from here <a href=\"http:\/\/www.prisonstudies.org\/highest-to-lowest\/prison-population-total?field_region_taxonomy_tid=All\">ICPS<\/a> (rate data, not totals).<\/p>\n<p>Now, what about all three variables?<\/p>\n<pre>#load <a href=\"https:\/\/osf.io\/zdcbq\/files\/\">mega20d<\/a> as the datafile\r\nineqprisoniq = subset(mega20d, select=c(\"Fact1_inequality\",\"LV2012estimatedIQ\",\"PrisonRatePer100000ICPS2015\"))\r\nrcorr(as.matrix(ineqprisoniq),type = \"spearman\")<\/pre>\n<blockquote>\n<pre id=\"rstudio_console_output\" class=\"GEWYW5YBFEB\" tabindex=\"0\">                            Fact1_inequality LV2012estimatedIQ PrisonRatePer100000ICPS2015\r\nFact1_inequality                        1.00             -0.51                        0.22\r\nLV2012estimatedIQ                      -0.51              1.00                        0.16\r\nPrisonRatePer100000ICPS2015             0.22              0.16                        1.00\r\n\r\nn\r\n                            Fact1_inequality LV2012estimatedIQ PrisonRatePer100000ICPS2015\r\nFact1_inequality                         275               119                         117\r\nLV2012estimatedIQ                        119               275                         193\r\nPrisonRatePer100000ICPS2015              117               193                         275<\/pre>\n<\/blockquote>\n<p>So IQ is slightly positively related to prison rates and so is equality. Positive? Isn&#8217;t it bad having people in prison? Well, if the alternative is having them dead&#8230; because the punishment for most crimes is death. Although one need not be excessive as the US is. Somewhere in the middle is perhaps best?<\/p>\n<p>What if we combine them into a model?<\/p>\n<pre>model = lm(PrisonRatePer100000ICPS2015 ~ Fact1_inequality+LV2012estimatedIQ,ineqprisoniq)\r\nsummary = summary(model)\r\nlibrary(QuantPsyc)\r\nlm.beta(model)\r\nprediction = as.data.frame(predict(model))\r\ncolnames(prediction) = \"Predicted\"\r\nineqprisoniq = merge.datasets(ineqprisoniq,prediction,1)\r\nscatterplot(PrisonRatePer100000ICPS2015 ~ Predicted, ineqprisoniq,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 smoother=FALSE,id.n=nrow(ineqprisoniq))<\/pre>\n<blockquote>\n<pre id=\"rstudio_console_output\" class=\"GEWYW5YBFEB\" tabindex=\"0\"><span class=\"GEWYW5YBJEB ace_keyword\">&gt; <\/span><span class=\"GEWYW5YBMDB ace_keyword\">summary\r\n<\/span>\r\nCall:\r\nlm(formula = PrisonRatePer100000ICPS2015 ~ Fact1_inequality + \r\n    LV2012estimatedIQ, data = ineqprisoniq)\r\n\r\nResiduals:\r\n    Min      1Q  Median      3Q     Max \r\n-153.61  -75.05  -31.53   44.62  507.34 \r\n\r\nCoefficients:\r\n                  Estimate Std. Error t value Pr(&gt;|t|)   \r\n(Intercept)       -116.451     88.464  -1.316  0.19069   \r\nFact1_inequality    31.348     11.872   2.640  0.00944 **\r\nLV2012estimatedIQ    3.227      1.027   3.142  0.00214 **\r\n---\r\nSignif. codes:  0 \u2018***\u2019 0.001 \u2018**\u2019 0.01 \u2018*\u2019 0.05 \u2018.\u2019 0.1 \u2018 \u2019 1\r\n\r\nResidual standard error: 113.6 on 114 degrees of freedom\r\n  (158 observations deleted due to missingness)\r\nMultiple R-squared:  0.09434,\t<strong>Adjusted R-squared:  0.07845<\/strong> \r\nF-statistic: 5.938 on 2 and 114 DF,  p-value: 0.003523\r\n\r\n<span class=\"GEWYW5YBJEB ace_keyword\">&gt; <\/span><span class=\"GEWYW5YBMDB ace_keyword\">lm.beta(model)\r\n<\/span><strong>Fact1_inequality LV2012estimatedIQ \r\n        0.2613563         0.3110241<\/strong><\/pre>\n<\/blockquote>\n<p id=\"rstudio_console_output\" class=\"GEWYW5YBFEB\" tabindex=\"0\"><span class=\"GEWYW5YBJEB ace_keyword\"><span class=\"Apple-style-span\">This is a pretty bad model (var%=8), but the directions held from before but were stronger. Standardized betas .25-.31. The R2 seems to be awkwardly low to me given the betas.<\/span><\/span><span class=\"GEWYW5YBMDB ace_keyword\"><br \/>\n<\/span><\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">More importantly, the residuals are clearly not normal as can be seen above. The QQ-plot is:<\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\"><a href=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/QQ_plot.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4595\" src=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/QQ_plot.png\" alt=\"QQ_plot\" width=\"660\" height=\"407\" \/><\/a><\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">It is concave, so data distribution isn&#8217;t normal. To get diagnostic plots, simply use &#8220;plot(model)&#8221;.<\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">Perhaps try using rank-order data:<\/p>\n<pre class=\"GEWYW5YBFEB\" tabindex=\"0\">ineqprisoniq = as.data.frame(apply(ineqprisoniq,2,rank,na.last=\"keep\")) #rank order the data<\/pre>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">And then rerunning model gives:<\/p>\n<blockquote>\n<pre id=\"rstudio_console_output\" class=\"GEWYW5YBFEB\" tabindex=\"0\"><span class=\"GEWYW5YBJEB ace_keyword\">&gt; <\/span><span class=\"GEWYW5YBMDB ace_keyword\">summary\r\n<\/span>\r\nCall:\r\nlm(formula = PrisonRatePer100000ICPS2015 ~ Fact1_inequality + \r\n    LV2012estimatedIQ, data = ineqprisoniq)\r\n\r\nResiduals:\r\n     <strong>Min       1Q   Median       3Q      Max \r\n-100.236  -46.753   -8.507   46.986  125.211<\/strong> \r\n\r\nCoefficients:\r\n                  Estimate Std. Error t value Pr(&gt;|t|)    \r\n(Intercept)        1.08557   18.32052   0.059    0.953    \r\nFact1_inequality   0.84766    0.16822   5.039 1.78e-06 ***\r\nLV2012estimatedIQ  0.50094    0.09494   5.276 6.35e-07 ***\r\n---\r\nSignif. codes:  0 \u2018***\u2019 0.001 \u2018**\u2019 0.01 \u2018*\u2019 0.05 \u2018.\u2019 0.1 \u2018 \u2019 1\r\n\r\nResidual standard error: 54.36 on 114 degrees of freedom\r\n  (158 observations deleted due to missingness)\r\nMultiple R-squared:  0.2376,\t<strong>Adjusted R-squared:  0.2242<\/strong> \r\nF-statistic: 17.76 on 2 and 114 DF,  p-value: 1.924e-07\r\n\r\n<span class=\"GEWYW5YBJEB ace_keyword\">&gt; <\/span><span class=\"GEWYW5YBMDB ace_keyword\">lm.beta(model)\r\n<\/span> <strong>Fact1_inequality LV2012estimatedIQ \r\n        0.4757562         0.4981808<\/strong><\/pre>\n<\/blockquote>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">Much better R2, directions the same but betas are stronger, and residuals look normalish from the above. QQ plot shows them not to be even now.<\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\"><a href=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/QQplot2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4596\" src=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/QQplot2.png\" alt=\"QQplot2\" width=\"660\" height=\"407\" \/><\/a><\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">Prediction plots based off the models:<\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\"><a href=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4597\" src=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison.png\" alt=\"prison\" width=\"660\" height=\"407\" \/><\/a> <a href=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison_rank.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4598\" src=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison_rank.png\" alt=\"prison_rank\" width=\"660\" height=\"407\" \/><\/a><\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">So is something strange going on with the IQ, inequality and prison rates? Perhaps something nonlinear. Let&#8217;s plot them by IQ bins:<\/p>\n<pre class=\"GEWYW5YBFEB\" tabindex=\"0\">bins = cut(unlist(ineqprisoniq[\"LV2012estimatedIQ\"]),5) #divide IQs into 5 bins\r\nineqprisoniq[\"IQ.bins\"] = bins\r\ndescribeBy(ineqprisoniq[\"PrisonRatePer100000ICPS2015\"],bins)\r\nlibrary(gplots)\r\nplotmeans(PrisonRatePer100000ICPS2015 ~ IQ.bins, ineqprisoniq,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 main = \"Prison rate by national IQ bins\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xlab = \"IQ bins (2012 data)\", ylab = \"Prison rate per 100000 (2014 data)\")<\/pre>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\"><a href=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison_IQ_bins.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4599\" src=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison_IQ_bins.png\" alt=\"prison_IQ_bins\" width=\"660\" height=\"407\" \/><\/a><\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">That looks like &#8220;bingo!&#8221; to me. We found the pattern.<\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">What about inequality? The trouble is that the inequality data is horribly skewed with almost all countries have a low and near identical inequality compared with the extremes. The above will (does not) work well. I tried with different bins numbers too. Results look something like this:<\/p>\n<pre class=\"GEWYW5YBFEB\" tabindex=\"0\">bins = cut(unlist(ineqprisoniq[\"Fact1_inequality\"]),5) #divide IQs into 5 bins\r\nineqprisoniq[\"inequality.bins\"] = bins\r\nplotmeans(PrisonRatePer100000ICPS2015 ~ inequality.bins, ineqprisoniq,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 main = \"Prison rate by national inequality bins\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xlab = \"inequality bins\", ylab = \"Prison rate per 100000 (2014 data)\")<\/pre>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\"><a href=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison_inequality.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4602\" src=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison_inequality.png\" alt=\"prison_inequality\" width=\"660\" height=\"407\" \/><\/a><\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">So basically, the most equal countries to the left have low rates, somewhat higher in the unequal countries within the main group and varying and on average lowish among the very unequal countries (African countries without much infrastructure?).<\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">Perhaps this is why the Equality Institute limited their analyses to the group on the left, otherwise they don&#8217;t get the nice clear pattern they want. One can see it a little bit if one uses a high number of bins and ignores the groups to the right. E.g. 10 bins:<\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\"><a href=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison_inequality_10bins.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4603\" src=\"http:\/\/emilkirkegaard.dk\/en\/wp-content\/uploads\/prison_inequality_10bins.png\" alt=\"prison_inequality_10bins\" width=\"660\" height=\"407\" \/><\/a><\/p>\n<p class=\"GEWYW5YBFEB\" tabindex=\"0\">Among the 3 first groups, there is a slight upward trend.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There was some talk on Twitter around prison rates and inequality: I wonder why. &quot;Rates of imprisonment are higher in unequal countries http:\/\/t.co\/ibDN21PqZX&quot; http:\/\/t.co\/EJy9vSCMFL MT @ChartsandMaps &mdash; JayMan (@JayMan471) January 10, 2015 And IQ and inequality: Here @JayMan471 i plotted it for you. rank-order r is higher and more proper (data not normal). pic.twitter.com\/QzHDwxeIC4 &mdash; [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1839,2591,1921],"tags":[1998,2065,2022],"class_list":["post-4594","post","type-post","status-publish","format-standard","hentry","category-psychometics","category-intelligence-iq-cognitive-ability","category-sociology","tag-crime","tag-inequality","tag-prison","entry"],"_links":{"self":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts\/4594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/comments?post=4594"}],"version-history":[{"count":3,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts\/4594\/revisions"}],"predecessor-version":[{"id":4601,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/posts\/4594\/revisions\/4601"}],"wp:attachment":[{"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/media?parent=4594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/categories?post=4594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emilkirkegaard.dk\/en\/wp-json\/wp\/v2\/tags?post=4594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}