Description:

I am using a data set from a survey about guns from kaggle. I am looking to see if US region, gender, political affiliation, and people’s opinions on whether or not gun control will reduce mass shootings will have an effect on one’s support for civilians owning guns. It is a common stereotype that males namely from the Southeast US region who are typically politically right wing believe that everyone should be able to buy guns whenever they want because it is our Second Amendment right. I am looking to see what the data has to say about this. According to https://www.factcheck.org/2018/02/nra-chiefs-bogus-background-check-claims/, the NRA still opposes background checks even though its members support background checks https://www.politifact.com/ohio/statements/2018/feb/27/tim-ryan/after-parkland-shooting-ohio-congressman-said-70-8/ .

Reading in the data:

library(radiant.data)
library(tidyverse)
library(dplyr)
library(magrittr)
library(readr)
guncontrol <- read_csv("C:/Users/abbys/Downloads/gun_control.csv")
Parsed with column specification:
cols(
  gender = col_character(),
  age = col_character(),
  region = col_character(),
  political_affiliation = col_character(),
  `should_background_checks_on_gun_buyers_be_more_extensive愼㸰` = col_character(),
  should_there_be_more_restrictions_on_who_can_buy_a_gun = col_character(),
  will_further_gun_control_reduce_the_possibilities_of_mass_shootings = col_character(),
  `should_civilians_be_allowed_to_own_guns愼㸰` = col_character()
)
head(guncontrol)
str(guncontrol)
Classes ‘spec_tbl_df’, ‘tbl_df’, ‘tbl’ and 'data.frame':    560 obs. of  8 variables:
 $ gender                                                             : chr  "Female" "Female" "Female" "Female" ...
 $ age                                                                : chr  "17 or younger" "17 or younger" "17 or younger" "17 or younger" ...
 $ region                                                             : chr  "East North Central (Illinois, Indiana, Michigan, Ohio, and Wisconsin)" "East South Central (Alabama, Kentucky, Mississippi, and Tennessee)" "East South Central (Alabama, Kentucky, Mississippi, and Tennessee)" "West North Central (Iowa, Kansas, Minnesota, Missouri, Nebraska, North Dakota, and South Dakota)" ...
 $ political_affiliation                                              : chr  "Libertarian Party" "Green Party" "Democratic Party" "Green Party" ...
 $ should_background_checks_on_gun_buyers_be_more_extensive           : chr  "No" "Yes" "Yes" "Yes" ...
 $ should_there_be_more_restrictions_on_who_can_buy_a_gun             : chr  "No" "Yes" "Yes" "Yes" ...
 $ will_further_gun_control_reduce_the_possibilities_of_mass_shootings: chr  "Yes" "Yes" "Yes" "Yes" ...
 $ should_civilians_be_allowed_to_own_guns                            : chr  "Yes" "Yes" "Yes" "No" ...
 - attr(*, "spec")=
  .. cols(
  ..   gender = col_character(),
  ..   age = col_character(),
  ..   region = col_character(),
  ..   political_affiliation = col_character(),
  ..   `should_background_checks_on_gun_buyers_be_more_extensive ` = col_character(),
  ..   should_there_be_more_restrictions_on_who_can_buy_a_gun = col_character(),
  ..   will_further_gun_control_reduce_the_possibilities_of_mass_shootings = col_character(),
  ..   `should_civilians_be_allowed_to_own_guns ` = col_character()
  .. )
dim(guncontrol)
[1] 560   8

There are 560 observations and 8 categories.

I recoded ‘should_civilians_be_allowed_to_own_guns’ to be my binary dependent variable and renaming it as ‘civilians_owning_guns’. I am also recoding ‘will_further_gun_control_reduce_the_possibilities_of_mass_shootings’ to shorten its name to ‘gun_control_reduce_massshootings’ (just for my convenience):

guncontrol <- gun_control %>% 
  rename(`civilians_own_guns`=`should_civilians_be_allowed_to_own_guns `,`gun_control_reduce_massshootings`=`will_further_gun_control_reduce_the_possibilities_of_mass_shootings`)%>% 
   mutate(civilians_own_guns = sjmisc::rec(civilians_own_guns, rec = "No=0; Yes=1"))
head(guncontrol)

Recoding categories in variables:

guncontrol$region=recode(guncontrol$region,
"East North Central (Illinois, Indiana, Michigan, Ohio, and Wisconsin)"="Midwest",
"East South Central (Alabama, Kentucky, Mississippi, and Tennessee)"="Southeast",
"West North Central (Iowa, Kansas, Minnesota, Missouri, Nebraska, North Dakota, and South Dakota)"="Midwest",
"Mid-Atlantic (New Jersey, New York, and Pennsylvania)"="Northeast",
"New England (Connecticut, Maine, Massachusetts, New Hampshire, Rhode Island, and Vermont)"="Northeast",
"Pacific (Alaska, California, Hawaii, Oregon, and Washington)"="West",
"South Atlantic (Delaware, Florida, Georgia, Maryland, North Carolina, South Carolina, Virginia, District of Columbia, and West Virginia)"="Southeast",
"West South Central (Arkansas, Louisiana, Oklahoma, and Texas)"="Southwest",
"Mountain (Arizona, Colorado, Idaho, Montana, Nevada, New Mexico, Utah, and Wyoming)"="Southwest")
guncontrol$political_affiliation=recode(guncontrol$political_affiliation,"Green Party"="Left-Wing","Democratic Party"="Left-Wing", "Republican Party"="Right-Wing","Constitution Party"="Right-Wing")
str(guncontrol)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame':   560 obs. of  8 variables:
 $ gender                                                   : chr  "Female" "Female" "Female" "Female" ...
 $ age                                                      : chr  "17 or younger" "17 or younger" "17 or younger" "17 or younger" ...
 $ region                                                   : chr  "Midwest" "Southeast" "Southeast" "Midwest" ...
 $ political_affiliation                                    : chr  "Libertarian Party" "Left-Wing" "Left-Wing" "Left-Wing" ...
 $ should_background_checks_on_gun_buyers_be_more_extensive : chr  "No" "Yes" "Yes" "Yes" ...
 $ should_there_be_more_restrictions_on_who_can_buy_a_gun   : chr  "No" "Yes" "Yes" "Yes" ...
 $ gun_control_reduce_massshootings                         : chr  "Yes" "Yes" "Yes" "Yes" ...
 $ civilians_own_guns                                       : num  1 1 1 0 0 1 1 1 1 0 ...

Model 1 - Gender

m0 <- glm(civilians_own_guns ~ gender, family = binomial, data = guncontrol)
summary(m0)

Call:
glm(formula = civilians_own_guns ~ gender, family = binomial, 
    data = guncontrol)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.8399   0.6378   0.6378   0.7585   0.7585  

Coefficients:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   1.0986     0.1400   7.846 4.31e-15 ***
genderMale    0.3907     0.2067   1.890   0.0588 .  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 584.52  on 559  degrees of freedom
Residual deviance: 580.92  on 558  degrees of freedom
AIC: 584.92

Number of Fisher Scoring iterations: 4

Model 2 - Adding region and political affiliation to the model

m1 <- glm(civilians_own_guns ~ gender+region+political_affiliation, family = binomial, data = guncontrol)
summary(m1)

Call:
glm(formula = civilians_own_guns ~ gender + region + political_affiliation, 
    family = binomial, data = guncontrol)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-2.2323   0.4157   0.5795   0.7191   1.0921  

Coefficients:
                                       Estimate Std. Error z value Pr(>|z|)    
(Intercept)                              0.9902     0.2739   3.615 0.000301 ***
genderMale                               0.3733     0.2134   1.749 0.080228 .  
regionNortheast                         -0.7863     0.3262  -2.410 0.015937 *  
regionSoutheast                          0.3981     0.3260   1.221 0.221927    
regionSouthwest                          0.0553     0.3614   0.153 0.878385    
regionWest                              -0.4325     0.3613  -1.197 0.231357    
political_affiliationLibertarian Party   0.3356     0.3975   0.844 0.398494    
political_affiliationRight-Wing          0.6436     0.2425   2.654 0.007961 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 584.52  on 559  degrees of freedom
Residual deviance: 555.03  on 552  degrees of freedom
AIC: 571.03

Number of Fisher Scoring iterations: 4

Model 3 - Adding gun_control_reduce_massshootings as an interaction with political_affiliation:

Our nation is currently politically polarized. I think it would be interesting to see how gun_control_reduce_massshootings interacts with political_affiliation.

m2 <- glm(civilians_own_guns ~ gender+region+political_affiliation*gun_control_reduce_massshootings, family = binomial, data = guncontrol)
summary(m2)

Call:
glm(formula = civilians_own_guns ~ gender + region + political_affiliation * 
    gun_control_reduce_massshootings, family = binomial, data = guncontrol)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-2.9049   0.1664   0.4536   0.7726   1.2054  

Coefficients:
                                                                           Estimate Std. Error z value Pr(>|z|)    
(Intercept)                                                                 2.04998    0.43600   4.702 2.58e-06 ***
genderMale                                                                  0.38407    0.22215   1.729 0.083829 .  
regionNortheast                                                            -0.78916    0.34164  -2.310 0.020892 *  
regionSoutheast                                                             0.33268    0.33647   0.989 0.322782    
regionSouthwest                                                             0.06882    0.37397   0.184 0.853985    
regionWest                                                                 -0.40253    0.37310  -1.079 0.280650    
political_affiliationLibertarian Party                                     -0.16012    0.71516  -0.224 0.822838    
political_affiliationRight-Wing                                             1.77034    0.80265   2.206 0.027411 *  
gun_control_reduce_massshootingsYes                                        -1.32636    0.38564  -3.439 0.000583 ***
political_affiliationLibertarian Party:gun_control_reduce_massshootingsYes  0.31068    0.87605   0.355 0.722860    
political_affiliationRight-Wing:gun_control_reduce_massshootingsYes        -1.66511    0.84734  -1.965 0.049401 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 584.52  on 559  degrees of freedom
Residual deviance: 507.44  on 549  degrees of freedom
AIC: 529.44

Number of Fisher Scoring iterations: 6

Table of the models

The model with the best fit is the third one (m2), which is shown by looking at the smallest AIC and BIC numbers.

library(texreg)
htmlreg(list(m0, m1, m2), doctype = FALSE)
Statistical models
Model 1 Model 2 Model 3
(Intercept) 1.10*** 0.99*** 2.05***
(0.14) (0.27) (0.44)
genderMale 0.39 0.37 0.38
(0.21) (0.21) (0.22)
regionNortheast -0.79* -0.79*
(0.33) (0.34)
regionSoutheast 0.40 0.33
(0.33) (0.34)
regionSouthwest 0.06 0.07
(0.36) (0.37)
regionWest -0.43 -0.40
(0.36) (0.37)
political_affiliationLibertarian Party 0.34 -0.16
(0.40) (0.72)
political_affiliationRight-Wing 0.64** 1.77*
(0.24) (0.80)
gun_control_reduce_massshootingsYes -1.33***
(0.39)
political_affiliationLibertarian Party:gun_control_reduce_massshootingsYes 0.31
(0.88)
political_affiliationRight-Wing:gun_control_reduce_massshootingsYes -1.67*
(0.85)
AIC 584.92 571.03 529.44
BIC 593.58 605.65 577.04
Log Likelihood -290.46 -277.51 -253.72
Deviance 580.92 555.03 507.44
Num. obs. 560 560 560
p < 0.001, p < 0.01, p < 0.05

Some interpretations on the best fit model (m2):

In the third model, females (intercept, when gender=0) support civilians owning guns at a log odds of 2.04998. Males (when gender=1) have an increase in log odds by .38407 of supporting civilians owning guns (but this is only statistically significant at the .1 level). The Northeast region has a decrease in log odds for supporting civilians owning guns by 0.78916. People who are politically right wing have an increase in log odds by 1.77034 for supporting civilians owning guns. People who feel that gun control will reduce mass shootings have a decrease in log odds by 1.32636 in supporting civilians owning guns. People who belong to the interaction term of being politically right wing and believing that gun control will reduce mass shootings will have decreased log odds in supporting civilians owning guns by 1.66511.

Likelihood ratio test - Compare to Best Model Fit:

The third model has the smallest p value, making it the best fit model.

lmtest::lrtest(m0, m1, m2)
Likelihood ratio test

Model 1: civilians_own_guns ~ gender
Model 2: civilians_own_guns ~ gender + region + political_affiliation
Model 3: civilians_own_guns ~ gender + region + political_affiliation * 
    gun_control_reduce_massshootings
  #Df  LogLik Df  Chisq Pr(>Chisq)    
1   2 -290.46                         
2   8 -277.51  6 25.893  0.0002331 ***
3  11 -253.72  3 47.589  2.604e-10 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Interesting Visualizations:

visreg(m2, "gender", by= "political_affiliation", scale="response")

The probability of supporting civilians owning guns is highest with Libertarian males (highest with males across all political affiliations), whereas politically left wing females have the least support for civilians owning guns. This is not surprising, as women tend to be more liberal than men. As a whole, politically left wing people support civilians owning guns slightly less than right wing or libertarians.

visreg(m2, "gun_control_reduce_massshootings", by= "gender", scale="response")

Males who believe that gun control won’t reduce mass shootings have greater support for civilians owning guns than females do. The probability of having support for civilians owning guns is lowest with females who believe that gun control reduces mass shootings. Again, this is not surprising, since women have lower support for civilians owning guns than males as the previous plot shows.

library(visreg)
visreg(m2, "gun_control_reduce_massshootings", by= "political_affiliation",scale = "response") 

Politically right wing people who believe that gun control does not reduce mass shootings are more likely to support civilians owning guns than other political affiliations. Politically left wing people who believe that gun control reduces mass shootings are more likely to not support civilians owning guns than other political affiliations.

LS0tDQp0aXRsZTogIkhXIDQgLSB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