The data clearly supports your opinion

Argument 1

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 ' ' 1

Residual standard error: 54680 on 141 degrees of freedom
Multiple R-squared:  0.000139,  Adjusted R-squared:  -0.006952 
F-statistic: 0.01961 on 1 and 141 DF,  p-value: 0.8888

Firearms 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 ' ' 1

Residual standard error: 54330 on 140 degrees of freedom
Multiple R-squared:  0.01973,   Adjusted R-squared:  0.005731 
F-statistic: 1.409 on 2 and 140 DF,  p-value: 0.2478

Even after controlling for GDP (PPP) per capita, firearms are still not statistically significant.

Conclusion: the effect of firearms on homicide, if it exists, must be small.

Argument 2

Number of firearms and homicide rate are not normally distributed, as evidenced by the following Q-Q plots:

Transform both variables by taking the log. After that, Q-Q plots look better:

Fit linear regression weighted by population to the transformed variables:


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 ' ' 1

Residual standard error: 7805 on 141 degrees of freedom
Multiple R-squared:  0.0346,    Adjusted R-squared:  0.02775 
F-statistic: 5.053 on 1 and 141 DF,  p-value: 0.02614

Firearms are statistically significant and have positive coefficient in the regression.

Conclusion: more firearms means more homicide.

Argument 3

Fit linear regression weighted by number of homicides. Homicides are rare, therefore variance of homicide rate estimates is primarily driven by number of homicides rather than by population. There is no cirular reasoning here - we’re predicting homicide rate rather than absolute 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 ' ' 1

Residual standard error: 196800 on 69 degrees of freedom
Multiple R-squared:  0.1864,    Adjusted R-squared:  0.1746 
F-statistic: 15.81 on 1 and 69 DF,  p-value: 0.0001701

Firearms are statistically significant and have negative coefficient in the regression.

Conclusion: in developed countries, more firearms means less homicide.

Data Sources

Data

                     country homicides_per_100000 population        gdp_ppp firearms_per_100
1                Afghanistan                  6.5   29726803    57473689811              4.4
2                    Albania                  5.1    2900489    27981946252              8.6
3                    Algeria                  1.4   37439427   502937371131              7.6
4                     Angola                 10.8   22685632              0             17.3
5                  Argentina                  7.0   42095224              0             10.2
6                    Armenia                  2.2    2978339    22035101326             12.5
7                  Australia                  1.1   22728254   979558023390             15.0
8                    Austria                  1.0    8429991   378088354544             30.4
9                 Azerbaijan                  2.2    9295784   150344872492              3.5
10                   Bahamas                 29.7     372388     8648379510              5.3
11                Bangladesh                  2.6  155257387   429055450182              0.5
12                  Barbados                  7.8     281580     4411222957              7.8
13                   Belarus                  3.6    9464000   162879596713              7.3
14                   Belgium                  1.7   11128246   459785570514             17.2
15                    Belize                 45.1     336707     2733682254             10.0
16                     Benin                  6.3   10049792    18350608451              1.4
17                    Bhutan                  3.8     743711     5390490978              3.5
18                   Bolivia                 12.1   10238762    60378682117              2.8
19    Bosnia and Herzegovina                  1.6    3828419    35871851726             17.3
20                    Brazil                 26.5  202401584  3080598391714              8.0
21                  Bulgaria                  1.9    7305888   116641261815              6.2
22              Burkina Faso                  0.7   16590813    25664955309              1.1
23                   Burundi                  4.7   10124572     7387878936              1.2
24                Cabo Verde                 11.1     500870     3132402917              5.4
25                  Cameroon                  2.8   21659488    58786137853              2.8
26                    Canada                  1.6   34754312  1469441272598             30.8
27  Central African Republic                 13.6    4619500     4291389079              1.0
28                      Chad                  9.4   12715465    25386331049              1.1
29                     Chile                  3.1   17388437   368340067789             10.7
30                     China                  0.8 1350695000 15147732172364              4.9
31                  Colombia                 30.7   46881018   565053014246              5.9
32                   Comoros                  8.0     733661     1011778388              1.8
33                     Congo                 10.5    4286188    24861693076              2.7
34                Costa Rica                  8.4    4654148    64381320881              9.9
35             Côte d'Ivoire                 12.4   21102641    59138290441              2.4
36                   Croatia                  1.2    4267558    90103577142             21.7
37                    Cyprus                  2.0    1129303    28124471336             36.4
38            Czech Republic                  1.0   10510785   300939794171             16.3
39                      DPRK                  4.7   24763353              0              0.6
40                     Congo                 13.5   70291160    45836065765              1.4
41                   Denmark                  0.7    5591572   243569213747             12.0
42                  Djibouti                  7.0     853069     2500247239              2.8
43        Dominican Republic                 22.0   10155036   119165850359              5.1
44                   Ecuador                 12.4   15419493   162021913158              1.3
45               El Salvador                 41.5    6072233    47704961183              5.8
46         Equatorial Guinea                  3.6     773729    29713759224             19.9
47                   Eritrea                  7.8    4892233              0              0.5
48                   Estonia                  4.9    1322696    33402707310              9.2
49                  Ethiopia                  8.1   92191211   115801785214              0.4
50                      Fiji                  3.0     874158     6718116315              0.5
51                   Finland                  1.6    5413971   217692078041             45.3
52                    France                  1.2   65639975  2445463259385             31.2
53                     Gabon                  9.4    1613489    28898919790             14.0
54                    Gambia                  9.6    1807108     2888561526              0.8
55                   Germany                  0.7   80425823  3506641955571             30.3
56                    Greece                  1.5   11092771   278085247530             22.5
57                 Guatemala                 34.6   15368759   107247768582             13.1
58                    Guinea                  9.0   11628767    14175308962              1.2
59             Guinea-Bissau                 10.3    1714620     2354937861              1.6
60                    Guyana                 17.5     758410     4901321313             14.6
61                     Haiti                 10.2   10288828    16599415572              0.6
62                  Honduras                 91.0    7736131    35818018094              6.2
63                   Hungary                  1.4    9920362   223766790703              5.5
64                   Iceland                  0.3     320716    12988375547             30.3
65                     India                  3.5 1263589639  6252659013279              4.2
66                 Indonesia                  0.6  248037853  2343796853305              0.5
67                      Iran                  4.8   76156975  1282942956414              7.3
68                   Ireland                  1.2    4586897   210031721225              8.6
69                    Israel                  1.7    7910500   252538837177              7.3
70                     Italy                  0.9   59539717  2114541653658             11.9
71                   Jamaica                 39.1    2707805    23168389163              8.1
72                     Japan                  0.3  127561489  4540944805895              0.6
73                    Jordan                  2.4    6318000    72933787659             11.5
74                Kazakhstan                  9.0   16791425   367593276627              1.3
75                     Kenya                  6.5   42542978   115620561511              6.4
76                    Kosovo                  4.9    1805200    15411689979             19.5
77                    Kuwait                  1.9    3419581   268287695231             24.8
78                       Lao                  7.2    6473050    29639067434              1.2
79                    Latvia                  4.8    2034319    42291242695             19.0
80                   Lebanon                  4.2    4440728    74919852759             21.0
81                   Liberia                  3.3    4190155     3285716931              1.6
82                     Libya                  2.5    6283403   144300306966             15.5
83                 Lithuania                  6.8    2987773    72001647509              0.7
84                    Malawi                  1.8   15700436    11979877674              0.7
85                  Maldives                  3.0     385000     4376769905              6.5
86                      Mali                 11.2   16112333    24339267752              1.1
87                     Malta                  2.8     419455    11860592735             11.9
88                Mauritania                 11.4    3777067    13409540152              1.6
89                    Mexico                 21.5  122070963  1967366758397             15.0
90                  Mongolia                  7.2    2808339    28042513769              1.9
91                Montenegro                  2.7     620601     8520641718             23.1
92                   Morocco                  1.2   32984190   233872326203              5.0
93                   Myanmar                  2.5   52543841              0              4.0
94                   Namibia                 17.5    2291645    20665956414             12.6
95               Netherlands                  0.9   16754962   777074774133              3.9
96               New Zealand                  0.9    4408100   145168597607             22.6
97                 Nicaragua                 11.3    5877034    26250476362              7.7
98                     Niger                  4.7   17635782    15569666617              0.7
99                   Nigeria                 10.3  168240403   909312073482              1.5
100                   Norway                  0.5    5018573   333049428144             31.3
101                 Pakistan                  7.8  177392252   790969340036             11.6
102                   Panama                 17.2    3743761    68226128114             21.7
103                 Paraguay                  9.7    6379162    47484890737             17.0
104                     Peru                  9.6   30158768   333118476305             18.8
105              Philippines                  8.8   96017322   590529699970              4.7
106                   Poland                  1.0   38063164   888379405857              1.3
107                 Portugal                  1.1   10514844   283905003633              8.5
108                    Qatar                  8.1    2015624   272833772102             19.2
109        Republic of Korea                  0.8   50004441  1601229237842              1.1
110                  Moldova                  6.7    3559519    15039023521              7.1
111                  Romania                  1.7   20058035   369472222527              0.7
112       Russian Federation                  9.2  143201676  3445923030943              8.9
113             Saudi Arabia                  6.2   29496047  1466149749002             35.0
114                  Senegal                  8.1   13780108    30636635377              2.0
115                   Serbia                  1.2    7199077    92189416159             37.8
116             Sierra Leone                  1.8    6043157     9533885456              0.6
117                Singapore                  0.2    5312400   408991572889              0.5
118                 Slovenia                  0.7    2057159    58497379765             13.5
119                  Somalia                  5.6   10033630              0              9.1
120             South Africa                 30.7   52341695   659331766441             12.7
121                    Spain                  0.8   46773055  1514892949436             10.4
122                Sri Lanka                  3.2   20328000   207501328659              1.5
123                    Sudan                  6.5   37712420   146015564110              5.5
124                 Suriname                  9.3     528535     8303763649             13.4
125                   Sweden                  0.7    9519374   417609076968             31.6
126              Switzerland                  0.6    7996861   446683740874             45.7
127               Tajikistan                  1.3    7930929    18917091955              1.0
128                Macedonia                  1.4    2069270    24570713132             24.1
129                     Togo                  9.4    6745581     8885081687              1.0
130      Trinidad and Tobago                 28.3    1341579    40995979617              1.6
131                  Tunisia                  3.1   10777500   115574478893              0.1
132                   Turkey                  4.3   74099255  1348311030981             12.5
133             Turkmenistan                  4.3    5172941    65612131535              3.8
134                   Uganda                 11.7   35400620    60029340654              1.4
135     United Arab Emirates                  0.8    8952542   547401997472             22.1
136           United Kingdom                  1.0   63700300  2395634891520              6.2
137                 Tanzania                  8.2   48645709   108081966288              1.4
138            United States                  4.7  314112078 16163158000000             88.8
139                  Uruguay                  7.9    3396753    63757573886             31.8
140               Uzbekistan                  3.3   29774500   142589673528              1.5
141                Venezuela                 53.6   29854238   537961457365             10.7
142                    Yemen                  6.8   24882792    91416226977             54.8
143                 Zimbabwe                  7.5   14565482    24446028322              4.4

Source Code

https://github.com/guns-vs-homicide/guns-vs-homicide.github.io