Fit linear regression weighted by population.

Call:lm(formula = d$homicides_per_100000 ~ d$firearms_per_100, weights = d$population)Weighted Residuals: Min 1Q Median 3Q Max -176815 -11915 -1625 10797 296963 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.586611 0.777875 7.182 3.63e-11 ***d$firearms_per_100 0.004989 0.035629 0.140 0.889 —Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ‘ 1Residual standard error: 54680 on 141 degrees of freedomMultiple R-squared: 0.000139, Adjusted R-squared: -0.006952 F-statistic: 0.01961 on 1 and 141 DF, p-value: 0.8888Firearms are not statistically significant.

Gross domestic product (at purchasing power parity) per capita can be a strong confounding variable, so fit another regression.

Call:lm(formula = d$homicides_per_100000 ~ d$firearms_per_100 + d$gdp_ppp_per_capita, weights = d$population)Weighted Residuals: Min 1Q Median 3Q Max -176118 -8873 -1370 10367 301062 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.548e+00 9.632e-01 6.798 2.82e-10 ***d$firearms_per_100 6.500e-02 5.040e-02 1.290 0.1993 d$gdp_ppp_per_capita -1.136e-04 6.794e-05 -1.673 0.0966 . —Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ‘ 1Residual standard error: 54330 on 140 degrees of freedomMultiple R-squared: 0.01973, Adjusted R-squared: 0.005731 F-statistic: 1.409 on 2 and 140 DF, p-value: 0.2478Even after controlling for GDP (PPP) per capita, firearms are still not statistically significant, therefore **the effect of firearms on homicide, if it exists, must be small**.

Number of firearms and homicide rate are not normally distributed. Transform them by taking the log, then fit linear regression weighted by population:

Call:lm(formula = log(d$homicides_per_100000) ~ log(d$firearms_per_100), weights = d$population)Weighted Residuals: Min 1Q Median 3Q Max -46680 -1515 1040 3956 30481 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.7630 0.1577 4.838 3.4e-06 ***log(d$firearms_per_100) 0.1787 0.0795 2.248 0.0261 * —Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ‘ 1Residual standard error: 7805 on 141 degrees of freedomMultiple R-squared: 0.0346, Adjusted R-squared: 0.02775 F-statistic: 5.053 on 1 and 141 DF, p-value: 0.02614Firearms are statistically significant and have positive coefficient in the regression, therefore **more firearms means more homicide**.

Fit linear regression weighted by number of homicides. Exclude countries with gross domestic product (at purchasing power parity) per capita lower than the median because we are primarily interested in developed countries.

Call:lm(formula = s$homicides_per_100000 ~ s$firearms_per_100, weights = s$population * s$homicides_per_100000)Weighted Residuals: Min 1Q Median 3Q Max -580852 -120505 -62910 -33140 1155015 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 27.55908 1.85457 14.860 < 2e-16 ***s$firearms_per_100 -0.26474 0.06658 -3.976 0.00017 ***—Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1Residual standard error: 196800 on 69 degrees of freedomMultiple R-squared: 0.1864, Adjusted R-squared: 0.1746 F-statistic: 15.81 on 1 and 69 DF, p-value: 0.0001701Firearms are statistically significant and have negative coefficient in the regression, therefore in developed countries **more firearms means less homicide**.

View the original article here