American Safety Perceptions: A Sociodemographic Analysis

Perceived Community Safety and Trust

Author
Affiliation

Vivian Raposo

Published

October 30, 2025

Abstract
Violence persists as a threat to safety, health, and wellbeing of individuals in the United States. The 2025 Global Peace Index, an analysis of global trends of societal safety and security, ranks the US of 128th out of 161 nations evaluated (Vision of Humanity, 2024). High rates of violence and a lack of safety heavily influence perceptions of safety in the US. Exploring this, a convenient sample of 135 individuals aged 18 or older were recruited and surveyed on perceptions of safety and violence through tabling within Binghamton University and across Broome County. The Quatrics based survey fully assessed individual demographics, attitudes, and perceptions of safety and violence, funding of safety and violence interventions, exposure to violence, and lay beliefs. This report examines if perceived level of community safety and trust differs by racial identity, gender, social class, and political beliefs and what trends in safety perceptions exist within various sociodemographics if correlations emerge. Expectations of performing a multi-linear regression statistical analysis of collected data include a correlation in perceived safety within demographic categories. Modeling a remaining usable fifty three responses, participant data unexpectedly revealed insignificant correlations between sociodemographic categories and perceived safety/neighborhood trust or lack of safety/prominence of distrust within one’s community. This study provides a starting point for research evaluating if correlations in perceived safety and sociodemographic exist using a larger sample. If correlations do not exist even with a larger dataset this allows researchers to pivot and focus on other predictors of safety and fear that may require structural or social interventions in the US.
Keywords

Community safety/absence of safety, Community trust/distrust, Racialized group, Gender, Socioeconomic status, Political beliefs

1 RESULTS

1.1 Import

Import Data and Filter Responses

library(readxl)
library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
alldata <- read_excel("10.20.2025.data.team1.clean.xlsx", col_names = TRUE)

alldata[alldata == -99] <- NA
alldata[alldata == -50] <- NA

#explanation:Data collected using the surveying platform, qualtrics was exported to excel. The file was uploaded into positcloud and values -50 and -99 indicating a question was not answered were filtered out and replaced with the value NA. 
#source: The Quantitative Playbook for Public Health Research in R. (McCarty, 2025) 

1.2 Transform

Select Data

library(dplyr)
selectdata <- alldata %>% 
  select(POLITICAL_BELIEFS, GENDER, SOCIALSTATUS, RACIALIZED,COMM_FEEL, COMM_HELP, COMM_NEIGHBORS, NOTCOMM_UNSAFE, NOTCOMM_RELY,  NOTCOMM_DISTRUST)

#explanation: Select dataset created to isolate variables and data used in multi linear regression. Select data includes measured sociodemographics and each statement (6 total- 3 COMM and 3 NONCOMM) measuring level of trust and safety using likert scale response options.
#source: The Quantitative Playbook for Public Health Research in R. (McCarty, 2025) 

Filter independent continuous variables

selectdata <- selectdata %>% filter(!is.na(POLITICAL_BELIEFS)) %>%
  mutate(
    POLITICAL_BELIEFS == case_when(
    POLITICAL_BELIEFS == 1~ "Far left",
    POLITICAL_BELIEFS == 2 ~ "Very liberal",
    POLITICAL_BELIEFS == 3 ~ "Liberal",
    POLITICAL_BELIEFS == 4 ~ "Moderate",
    POLITICAL_BELIEFS == 5 ~ "Conservative",
    POLITICAL_BELIEFS == 6 ~ "Very conservative",
    POLITICAL_BELIEFS == 7 ~ "Far-right"
  )
  )

#explanation: Assigning values 0-6 for Far left to far right political beliefs removes rows where politial beliefs data is missing (NA) and provides clear categorical variable labels for MLR modeling.
#source: R for Data Science (2e), 16 Factors: https://r4ds.hadley.nz/factors.html
#Factor Social Status 
selectdata <- selectdata %>% filter(!is.na(SOCIALSTATUS)) %>%
  mutate(
  SOCIALSTATUS == case_when(
   SOCIALSTATUS== 1 ~ "1-Lowest Social Status",
   SOCIALSTATUS == 2 ~ "2",
   SOCIALSTATUS == 3 ~ "3",
   SOCIALSTATUS == 4 ~ "4",
   SOCIALSTATUS == 5 ~ "5-Moderate Social Status",
   SOCIALSTATUS == 6 ~ "6", 
   SOCIALSTATUS == 7 ~ "7", 
   SOCIALSTATUS == 8 ~ "8",
   SOCIALSTATUS == 9 ~ "9", 
   SOCIALSTATUS == 10 ~ "10-Highest Social Status"
  )
  )
#explanation: Assigning values 1-10 for low to high perceived socioeconomic status removes rows where SES data is missing (NA) and provides clear categorical variable labels for MLR modeling. 
#source: R for Data Science (2e), 16 Factors: https://r4ds.hadley.nz/factors.html

Filter Dependent Response Variables

selectdata <- selectdata %>% filter(!is.na(COMM_FEEL)) %>%
  mutate(
    COMM_FEEL == case_when(
    COMM_FEEL == 1 ~ "Strongly Disagree",
    COMM_FEEL== 2 ~ "Disagree",
    COMM_FEEL == 3 ~ "Slightly Disagree",
    COMM_FEEL== 4 ~ "Slightly Agree",
    COMM_FEEL == 5 ~ "Agree",
    COMM_FEEL == 6 ~ "Strongly Agree",
  )
  )
#explanation: Assigning values 1-6 for low to high level of agreement with the corresponding statment (COMM_FEEL: "My neighborhood feels like a community"). This helps clearly filter  missing data and provides clear categorical variable labels for MLR modeling. 
#source: R for Data Science (2e), 16 Factors: https://r4ds.hadley.nz/factors.html
selectdata <- selectdata %>% filter(!is.na(COMM_HELP)) %>%
  mutate(
    COMM_HELP == case_when(
    COMM_HELP == 1 ~ "Strongly Disagree",
    COMM_HELP== 2 ~ "Disagree",
    COMM_HELP == 3 ~ "Slightly Disagree",
    COMM_HELP== 4 ~ "Slightly Agree",
    COMM_HELP == 5 ~ "Agree",
    COMM_HELP == 6 ~ "Strongly Agree",
  )
  )
#explanation: Assigning values 1-6 for low to high level of agreement with the corresponding statment (COMM_HELP: "Most people in this neighborhood are willing to help you if you need it" ). This helps clearly filter  missing data and provides clear categorical variable labels for MLR modeling. 
#source: R for Data Science (2e), 16 Factors: https://r4ds.hadley.nz/factors.html
selectdata <- selectdata %>% filter(!is.na(COMM_NEIGHBORS)) %>%
  mutate(
    COMM_NEIGHBORS == case_when(
    COMM_NEIGHBORS == 1 ~ "Strongly Disagree",
    COMM_NEIGHBORS== 2 ~ "Disagree",
    COMM_NEIGHBORS == 3 ~ "Slightly Disagree",
    COMM_NEIGHBORS== 4 ~ "Slightly Agree",
    COMM_NEIGHBORS == 5 ~ "Agree",
    COMM_NEIGHBORS == 6 ~ "Strongly Agree",
  )
  )
#explanation: Assigning values 1-6 for low to high level of agreement with the corresponding statment (COMM_HELP: "Most people in this neighborhood are willing to help you if you need it"). This helps clearly filter  missing data and provides clear categorical variable labels for MLR modeling. 
#source: R for Data Science (2e), 16 Factors: https://r4ds.hadley.nz/factors.html
selectdata <- selectdata %>% filter(!is.na(NOTCOMM_UNSAFE)) %>%
  mutate(
    NOTCOMM_UNSAFE == case_when(
    NOTCOMM_UNSAFE == 1 ~ "Strongly Disagree",
    NOTCOMM_UNSAFE== 2 ~ "Disagree",
    NOTCOMM_UNSAFE == 3 ~ "Slightly Disagree",
    NOTCOMM_UNSAFE== 4 ~ "Slightly Agree",
    NOTCOMM_UNSAFE == 5 ~ "Agree",
    NOTCOMM_UNSAFE == 6 ~ "Strongly Agree",
  )
  )
#explanation: Assigning values 1-6 for low to high level of agreement with the corresponding statment (NONCOMM_UNSAFE: "I do not feel safe in my neighborhood "). This helps clearly filter  missing data and provides clear categorical variable labels for MLR modeling. 
#source: R for Data Science (2e), 16 Factors: https://r4ds.hadley.nz/factors.html
#Factor NOTCOMM_RELY
 selectdata <- selectdata %>% filter(!is.na(NOTCOMM_UNSAFE)) %>%
  mutate(
    NOTCOMM_RELY == case_when(
    NOTCOMM_RELY == 1 ~ "Strongly Disagree",
    NOTCOMM_RELY== 2 ~ "Disagree",
    NOTCOMM_RELY == 3 ~ "Slightly Disagree",
    NOTCOMM_RELY == 4 ~ "Slightly Agree",
    NOTCOMM_RELY == 5 ~ "Agree",
    NOTCOMM_RELY == 6 ~ "Strongly Agree",
  )
  )
#explanation: Assigning values 1-6 for low to high level of agreement with the corresponding statment (NONCOMM_RELY: "I cannot rely on my neighbors for help if I need it"). This helps clearly filter  missing data and provides clear categorical variable labels for MLR modeling. 
#source: R for Data Science (2e), 16 Factors: https://r4ds.hadley.nz/factors.html
#Factor NOTCOMM_DISTRUST
selectdata <- selectdata %>% filter(!is.na(NOTCOMM_DISTRUST)) %>%
  mutate(
    NOTCOMM_DISTRUST== case_when(
    NOTCOMM_DISTRUST == 1 ~ "Strongly Disagree",
    NOTCOMM_DISTRUST== 2 ~ "Disagree",
    NOTCOMM_DISTRUST == 3 ~ "Slightly Disagree",
    NOTCOMM_DISTRUST == 4 ~ "Slightly Agree",
    NOTCOMM_DISTRUST == 5 ~ "Agree",
    NOTCOMM_DISTRUST == 6 ~ "Strongly Agree",
  )
  )

#explanation: Assigning values 1-6 for low to high level of agreement with the corresponding statment (NONCOMM_DISTRUST: "I do not trust my neighbors"). This helps clearly filter  missing data and provides clear categorical variable labels for MLR modeling. 
#source: R for Data Science (2e), 16 Factors: https://r4ds.hadley.nz/factors.html

Creating Community Variables

selectdata <- selectdata %>%
  rowwise() %>%
  mutate(COMMUNITY = mean(c(COMM_FEEL, COMM_HELP, COMM_NEIGHBORS), na.rm = TRUE))

#explanation: Creating a new variable (COMMUNITY) by averaging each trust/safety measure (COMM_FEEL, COMM_HELP, COMM_TRUST) using a rowwise function. Creates one variable for each respondent that measures overall safety and neighborhood trust perception for MLR modeling with various sociodemographic variables. 
#source:https://cran.r-project.org/web/packages/dplyr/vignettes/rowwise.html
selectdata <- selectdata %>%
  rowwise() %>%
  mutate(NONCOMMUNITY = mean(c(NOTCOMM_UNSAFE, NOTCOMM_RELY, NOTCOMM_DISTRUST), na.rm = TRUE))

#explanation: Creating a new variable (NONCOMMUNITY) by averaging each trust/safety measure (NONCOMM_UNSAFE, NONCOMM_RELY, NONCOMM_DISTRUST) using a rowwise function. Creates one variable for each respondent that measures perceived lack of safety and neighborhood trust for MLR modeling with various sociodemographic variables.  

#source:https://cran.r-project.org/web/packages/dplyr/vignettes/rowwise.html 

Reverse Scoring

library(psych)
# Create keys for scoring
community_keys <- list(
  COMMUNITY = c("COMM_FEEL", "COMM_HELP", "COMM_NEIGHBORS", "NOTCOMM_UNSAFE", "NOTCOMM_RELY", "NOTCOMM_DISTRUST"))

#source: The Quantitative Playbook for Public Health Research in R. (McCarty, 2025) 
#explanation: Creates Community_keys object from community and non community measures
#Reverse scoring: - Sign in front of the NONCOMM items helps identify the scale and align community scoring 
community_keys_with_reverse <- list(
  COMMUNITY = c("COMM_FEEL", "COMM_HELP", "COMM_NEIGHBORS", "-NOTCOMM_UNSAFE", "-NOTCOMM_RELY", "-NOTCOMM_DISTRUST")
)
#source: The Quantitative Playbook for Public Health Research in R. (McCarty, 2025)
#explanation: Creates community scale by reverse coding not comm variables so higher scores for each indicate higher feelings of perceived safety and trust. Computes each respondents average score of perceived safety and trust.

Simplifying Gender and Race Variables

library(dplyr)
#| label: Simplifying-Racialized-group-variables

selectdata <- selectdata %>%
  mutate(
    RACE.4 = case_when(
      grepl(",", RACIALIZED) ~ "Mixed/Other", 
      RACIALIZED == "3" ~ "Black",
      RACIALIZED == "2" ~ "Asian",
      RACIALIZED == "7" ~ "White",
      RACIALIZED %in% c("1", "4","5","6", "8") ~ "Mixed/Other", 
      TRUE ~ NA_character_)
  )

#explanation: Simplifying the selections for racialized group variables, a new variable is created assigning muiltiple selections as 'Mixed/Other' and less commonly selected variables as "Mixed/Other". Highly selected groups were kept as their original variables (Black, Asian, White). This code is one step towards forming binary variables and labels for MLR modeling. 
#source: https://fripublichealth.quarto.pub/zerosum/
selectdata <- selectdata %>%
  mutate(
    POC = case_when(
      RACE.4== "Asian" ~ "1",
      RACE.4== "Black" ~ "1",
      RACE.4 == "White" ~ "0",
      RACE.4 == "Mixed/Other" ~ "1",
      TRUE ~ NA_character_
    )
  )

#explanation: Adding a POC column in the dataframe this code takes existing RACE.4 simpflied racialized group variables and creates a binary indicator assigning White = 0 and POC = 1 (POC including: Mixed/Other, Asian, and Black from RACE.4). This code helps fufill the binary requirement for categorical variables in MLR modeling.  
#source: https://fripublichealth.quarto.pub/zerosum/
selectdata <- selectdata %>%
  mutate(
    GENDER01 = case_when(
      GENDER== "0" ~ "0",
      GENDER== "1" ~ "1",
      GENDER == "2" ~ NA
    )
  )

#explanation: Creating a new variable (GENDER 01) recodes existing gender variables to include Female = 0 and Male = 1 allowing MLR to interpet gender as a numeric predictor. Other gender selections (Nonbinary, genderfluid, genderqueer (2)) were removed from the dataset for the purpose of the binary predictor and only being selected for by a single particpant in surveying. 
#source: https://fripublichealth.quarto.pub/zerosum/

1.3 Visualize (pt 1)

Trust/Safety & Distrust/Lack of Safety variables: Histogram & Normal Distribution

#Check Normal distribution for regression test 
library(ggplot2) 

Attaching package: 'ggplot2'
The following objects are masked from 'package:psych':

    %+%, alpha
#Histogram for COMMUNITY 
COMMUNITY_DISTPLOT <- ggplot(selectdata, mapping = aes(x = COMMUNITY)) + 
  geom_histogram(binwidth = .5, fill ="darkgreen", color = "black") + theme_bw()

# Print and save to the plots folder
print(COMMUNITY_DISTPLOT)

COMMUNITY variables centered distribution between 4 and 5 on the likert response with a slight skew to the left. The historgram is relatively symmetric and evenly distributed.

Figure 1.1. Distribution of COMMUNITY
ggsave("plots/COMMUNITY_DISTPLOT.png", 
       plot = COMMUNITY_DISTPLOT,
       width = 10, height = 8, dpi = 300)

#explanation: Visualizing a plot for the dependent variable COMMUNITY  to check for mostly normal distribution (roughly bell shaped and no extreme outliers) required to continue with MLR. Relative normality indicates variables are usable in a muiltilinear regression model and do not require transformation. 
#source: https://posit.cloud/learn/recipes/visualize/VisualizeA5, https://ggplot2.tidyverse.org/reference/ggtheme.html
#Check Normal distribution for regression test 
library(ggplot2)

#Histogram for NOTCOMMUNITY
NONCOMMUNITY_DISTPLOT <- ggplot(selectdata, mapping = aes(x = NONCOMMUNITY)) + 
  geom_histogram(binwidth = .5, fill = "darkred", color = "black")+ theme_bw()

# Print and save to the plots folder
print(NONCOMMUNITY_DISTPLOT)

NONCOMMUNITY variables centered distribution between 2 and 3 on the likert response scale with a majority of scores between 1 and 3. The historgram is relatively symmetric and evenly distributed.

Figures 1.1. Distribution of NONCOMMUNITY
ggsave("plots/NONCOMMUNITY_DISTPLOT.png", 
       plot = NONCOMMUNITY_DISTPLOT,
       width = 10, height = 8, dpi = 300)

#explanation: Visualizing a plot for the dependent variable NONCOMMUNITY to check for mostly normal distribution (roughly bell shaped and no extreme outliers) required to continue with MLR. Relative normality indicates variables are usable in a muiltilinear regression model and do not require transformation. 
#source: https://posit.cloud/learn/recipes/visualize/VisualizeA5, https://ggplot2.tidyverse.org/reference/ggtheme.html

1.4 Visualize (pt 2)

Exploring predictor and outcome variable relationships: Scatter plot & Fitted Linear Regression

#Political Beliefs vs COMMUNITY with 3rd Gender Variable: change color dots
POLITICAL_COMM_SCAT <- ggplot(selectdata, aes(x = POLITICAL_BELIEFS, y = COMMUNITY, color = GENDER01))+
  geom_smooth(method = "lm") +
  geom_point(position = position_jitter(width=0.2)) +
   scale_color_manual(
    values = c("0" = "hotpink", "1" = "darkblue"),
    labels = c("0" = "Female", "1" = "Male")
  ) +  scale_x_continuous(breaks = 1:7, limits = c(1,7)) + scale_y_continuous(breaks = 0:6, limits = c(0,6)) +
  theme_bw() +
  labs(
    x = "Political Beliefs",
    y = "Trust/Safety Score (COMMUNITY)",
    color = "Gender"
    )

# Print and save to the plots folder
print(POLITICAL_COMM_SCAT)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 4 rows containing missing values or values outside the scale range
(`geom_point()`).

Political beliefs ranging from one to seven indicate no strong correlation between COMMUNITY and political beliefs. Both male and female line of best fit are flat with no extreme trend.

Figure 2.1. Scatter plot and linear regression of political beliefs and COMMUNITY variables. Displays a bivariate relationship with third gender variable.
ggsave("plots/POLITICAL_COMM_SCAT.png", 
       plot = POLITICAL_COMM_SCAT,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_point()`).
#explanation: Predictor (political beliefs) and outcome (trust/safety score) variables are plotted and fitted to a simple linear regression line grouped by the binary gender variable (GENDER01). This visually explores and allows checking linear nature of the variables, observation of gender differences, and visually testing whether the poltiical beliefs predict trust/perceived safety. 

#source: https://posit.cloud/learn/recipes/visualize/VisualizeA3,  https://rstudio-pubs-static.s3.amazonaws.com/337414_ef0db534b06a4232945a5b907cfa871a.html#adding-a-third-variable-in-geom-point, https://ggplot2.tidyverse.org/reference/scale_continuous.html
#|fig-alt: Political beliefs ranging from one to seven indicate no strong correlation between NONCOMMUNITY and political beliefs. The male best fit line indicates a slight downwards trend indicating lower level of distrust with increased status however no meaningful relationships exist. 


#Political Beliefs vs NON_COMM with 3rd Gender Variable: change color dots
POLITICAL_NONCOMM_SCAT <- ggplot(selectdata, aes(x = POLITICAL_BELIEFS, y = NONCOMMUNITY, color = GENDER01)) +
  geom_smooth(method = "lm") +
   scale_color_manual(
    values = c("0" = "hotpink", "1" = "darkblue"),
    labels = c("0" = "Female", "1" = "Male")
  )  + scale_x_continuous(breaks = 1:7, limits = c(1,7)) + scale_y_continuous(breaks = 0:6, limits = c(0,6)) +
  theme_bw() +
  
 geom_point(position = position_jitter(width=0.2)) + 
  labs(
    x = "Political Beliefs",
    y = "Distrust/Lack of Safety Score",
    color = "gender"
  )

# Print and save to the plots folder
print(POLITICAL_NONCOMM_SCAT)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 1 row containing missing values or values outside the scale range
(`geom_point()`).

Figure 2.2. Scatter plot and linear regression of political beliefs and NONCOMMUNITY variables. Displays a bivariate relationship with third gender variable.
ggsave("plots/POLITICAL_NONCOMM_SCAT.png", 
       plot = POLITICAL_NONCOMM_SCAT,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 1 row containing missing values or values outside the scale range
(`geom_point()`).
#explanation: Predictor (political beliefs) and outcome (distrust/lack of safety) variables are plotted and fitted to a simple linear regression line grouped by the binary gender variable (GENDER01). This visually explores and allows checking linear nature of the variables, observation of gender differences, and visually testing whether the poltiical beliefs predict distrust/perceived lack of safety. 
#source: https://posit.cloud/learn/recipes/visualize/VisualizeA3,  https://rstudio-pubs-static.s3.amazonaws.com/337414_ef0db534b06a4232945a5b907cfa871a.html#adding-a-third-variable-in-geom-point, https://ggplot2.tidyverse.org/reference/scale_continuous.html
#|fig-alt: Social status ranging from two to nine indicate plotted with COMMUNITY reveals an upward trend in line of best fit, indicating increased perceived social status correlating with increased feelings of safety and trust. 

#Social Status vs COMMUNITY with 3rd Gender Variable: change color dots 

SOCIAL_COMM_SCAT <- ggplot(selectdata, aes(x = SOCIALSTATUS, y = COMMUNITY, color = GENDER01)) + 
  geom_smooth(method = "lm") + 
  geom_point(position = position_jitter(width=0.2)) + scale_color_manual(
    values = c("0" = "hotpink", "1" = "darkblue"),
    labels = c("0" = "Female", "1" = "Male")
  ) +  scale_x_continuous(breaks = 2:9, limits = c(2,9)) + scale_y_continuous(breaks = 0:6, limits = c(0,6)) +
  theme_bw() +
  labs(
    x = "Social Status",
    y = "Trust/Safety ",
    color = "Gender"
  )

# Print and save to the plots folder
print(SOCIAL_COMM_SCAT)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_point()`).

Figure 2.3. Scatter plot and linear regression of political beliefs and COMMUNITY variables. Displays a bivariate relationship with third gender variable.
ggsave("plots/SOCIAL_COMM_SCAT.png", 
       plot = SOCIAL_COMM_SCAT,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_point()`).
#explanation: Predictor (social status) and outcome (trust/safety score) variables are plotted and fitted to a simple linear regression line grouped by the binary gender variable (GENDER01). This visually explores and allows checking linear nature of the variables, observation of gender differences, and visually testing whether social status predicts trust/ perceived safety. 

#source: https://posit.cloud/learn/recipes/visualize/VisualizeA3,  https://rstudio-pubs-static.s3.amazonaws.com/337414_ef0db534b06a4232945a5b907cfa871a.html#adding-a-third-variable-in-geom-point, https://ggplot2.tidyverse.org/reference/scale_continuous.html
#|fig-alt: Social status ranging from two to nine indicate plotted with NONCOMMUNITY reveals an slight downward trend in line of best fit, indicating increased perceived social status correlating with decreased feelings of lack of safety and distrust. 

#Social Status vs NONCOM_ALL with 3rd Gender Variable: change color dots 
SOCIAL_NONCOMM_SCAT <- ggplot(selectdata, aes(x = SOCIALSTATUS, y = NONCOMMUNITY, color = GENDER01)) +  
  geom_smooth(method = "lm") +
  geom_point(position = position_jitter(width=0.2)) + scale_color_manual(
    values = c("0" = "hotpink", "1" = "darkblue"),
    labels = c("0" = "Female", "1" = "Male")
  ) +scale_x_continuous(breaks = 2:9, limits = c(2,9)) + scale_y_continuous(breaks = 0:6, limits = c(0,6)) +
  theme_bw() +
  labs(
    x = "Social Status",
    y = "Distrust/Lack of Safety",
    color = "gender"
  )

# Print and save to the plots folder
print(SOCIAL_NONCOMM_SCAT)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_point()`).

Figure 2.4. Scatter plot and linear regression of social status and NONCOMMUNITY variables.Displays a bivariate relationship with third gender variable.
ggsave("plots/SOCIAL_NONCOMM_SCAT.png", 
       plot = SOCIAL_NONCOMM_SCAT,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 1 row containing missing values or values outside the scale range
(`geom_point()`).
#explanation: Predictor (social status) and outcome (distrust/lack of safety) variables are plotted and fitted to a simple linear regression line grouped by the binary gender variable (GENDER01). This visually explores and allows checking linear nature of the variables, observation of gender differences, and visually testing whether social status predicts distrust/ perceived lack of safety. 

#source: https://posit.cloud/learn/recipes/visualize/VisualizeA3,  https://rstudio-pubs-static.s3.amazonaws.com/337414_ef0db534b06a4232945a5b907cfa871a.html#adding-a-third-variable-in-geom-point, https://ggplot2.tidyverse.org/reference/scale_continuous.html 

Continuous predictor variables including political belief and social status were visualized along with community trust/safety and lack of safety/distrust variables to view relationships between variables and change within the dataset. Each predictor variable was also broken up by a third variable creating a multivariate scatterplot using gender. For the purpose of this dataset with only one participant identifying as nonbinary or gender non conforming, the third variable was coded to be binary, male and female. Visualizing political beliefs in comparison to community scores indicates there is no strong correlation between political beliefs and community trust/safety as the slopes for both genders are nearly flat (Figure 2.1).While not definitive, there is a slight upward slope for females indicating that as political beliefs trend towards conservatism, female community safety scores increase slightly. Similarly, plotting political beliefs with non community/ lack of safety and trust also reveals no meaningful relationship between political beliefs and perceived lack of safety and distrust (Figure 2.2). However in this plot, a slightly downwards trend occurs with males, indicating that as conservative belief increases with men there is a lower reported level of distrust/lack of safety. For both political belief plots the confidence intervals overlap indicating that gender differences could be due to random variation, negating any significance in male versus female perceptions.

However, plots visualizing social status in relation to community and non community variables revealed more variation. Figure 2.3 highlights a clear upward trend in males with increased perceived social status correlating with increased feelings of safety and trust. Alternatively females indicate nearly no correlation between increased social status and feelings of safety or possibly even a slight negative relationship as social status increases, feelings of safety decrease. Overall as perceived social status crosses the moderate threshold of social status (5-6/10) men report overall higher levels of perceived safety and trust than women with this gender gap increasing as social status increases. This correlates with Figure 2.4 showing political belief and perceived lack of safety and distrust. This plot indicates that males with higher social status report lower levels of distrust and lack of safety whereas perceived safety amongst women is not correlated with increased social status. While none of these correlations are significant due to overlapping confidence intervals, trends indicate that men with higher social status report higher feelings of safety and trust than lower income males and females of the same social status.

1.5 Model: Multiple Linear Regression

#Perform MLR for COMMUNITY 

#Look at observations
head(selectdata)
# A tibble: 6 × 16
# Rowwise: 
  POLITICAL_BELIEFS GENDER SOCIALSTATUS RACIALIZED COMM_FEEL COMM_HELP
              <dbl>  <dbl>        <dbl> <chr>          <dbl>     <dbl>
1                 4      0            6 2                  6         4
2                 4      0            3 4,7                4         5
3                 4      0            7 7                  4         4
4                 3      0            3 2,7                2         4
5                 1      0            3 3                  2         3
6                 4      1            6 4                  5         5
# ℹ 10 more variables: COMM_NEIGHBORS <dbl>, NOTCOMM_UNSAFE <dbl>,
#   NOTCOMM_RELY <dbl>, NOTCOMM_DISTRUST <dbl>, `==...` <lgl>, COMMUNITY <dbl>,
#   NONCOMMUNITY <dbl>, RACE.4 <chr>, POC <chr>, GENDER01 <chr>
#Create linear model of values in COMM ALL 
COMMUNITY.lm <- lm(COMMUNITY ~ POC + GENDER01 + POLITICAL_BELIEFS + SOCIALSTATUS, data = selectdata)

summary(COMMUNITY.lm)

Call:
lm(formula = COMMUNITY ~ POC + GENDER01 + POLITICAL_BELIEFS + 
    SOCIALSTATUS, data = selectdata)

Residuals:
     Min       1Q   Median       3Q      Max 
-2.63124 -0.55606  0.03467  0.64967  1.58468 

Coefficients:
                  Estimate Std. Error t value Pr(>|t|)    
(Intercept)        3.90594    0.61299   6.372 7.35e-08 ***
POC1               0.01291    0.27783   0.046    0.963    
GENDER011          0.08708    0.27694   0.314    0.755    
POLITICAL_BELIEFS  0.11035    0.11313   0.975    0.334    
SOCIALSTATUS       0.01760    0.07722   0.228    0.821    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.897 on 47 degrees of freedom
  (1 observation deleted due to missingness)
Multiple R-squared:  0.02781,   Adjusted R-squared:  -0.05493 
F-statistic: 0.3362 on 4 and 47 DF,  p-value: 0.8522
#explanation: Race,  Gender, Political beliefs, and Social status evaluated as independent predictors of community trust/perceived safety through a linear model. The response variable COMMUNITY is predicted from demographic and belief variables. 

#source: https://www.datacamp.com/tutorial/multiple-linear-regression-r-tutorial 

Data indicating community safety/trust (Figure 1.1) and distrust/lack of safety (Figure 1.2) were visualized as histograms and checked for normality before performing multiple linear regression tests. The distribution of the datasets were relatively normal without any extreme outliers or skew, therefore multiple linear regression multiple linear regressions were completed for both community safety/trust variables and non community safety and trust variables (Figures 1.1 and 1.2). The regression model evaluated correlations between racialized groups (POC vs White), gender (Male vs Female), social status, and political beliefs as predictors of perceived community safety and perceived lack of safety and presence of distrust. The multiple linear regression evaluating these demographics variables as predictors of community safety revealed no statistically significant differences in community safety by any of the demographic predictors. In terms of racialized groups, people of color (POC) scored 0.013 increase in perceived safety and community trust than white respondents, however this difference failed to be statistically significant with a p value of 0.96. Similarly, no evidence showed gender as an influence of community trust or safety as on average respondents identifying as male scored only 0.087 points higher on community safety scores with an insignificant p value of 0.76. As a predictor, political beliefs revealed insignificance as well with each one unit increase in conservative belief being associated with a 0.11 point increase in community safety/trust with an insignificant p value of 0.33. Additionally, as social status increased each unit revealed a 0.02 point increase in average safety score, however with a p value of 0.821 no clear evidence was shown indicating that higher social status correlates with stronger feelings of safety. With none of the demographic predictors being significant the model overall explained only 2.8% of variance in community safety scores and supports that racialized group, gender, political beliefs, and social status are not predictors of perceived community safety scores.

#Perform MLR for NONCOMMUNITY 

#Look at observations
head(selectdata)
# A tibble: 6 × 16
# Rowwise: 
  POLITICAL_BELIEFS GENDER SOCIALSTATUS RACIALIZED COMM_FEEL COMM_HELP
              <dbl>  <dbl>        <dbl> <chr>          <dbl>     <dbl>
1                 4      0            6 2                  6         4
2                 4      0            3 4,7                4         5
3                 4      0            7 7                  4         4
4                 3      0            3 2,7                2         4
5                 1      0            3 3                  2         3
6                 4      1            6 4                  5         5
# ℹ 10 more variables: COMM_NEIGHBORS <dbl>, NOTCOMM_UNSAFE <dbl>,
#   NOTCOMM_RELY <dbl>, NOTCOMM_DISTRUST <dbl>, `==...` <lgl>, COMMUNITY <dbl>,
#   NONCOMMUNITY <dbl>, RACE.4 <chr>, POC <chr>, GENDER01 <chr>
#Create linear model of values in NONCOMM ALL 
NONCOMMUNITY.lm <- lm(NONCOMMUNITY ~ POC + GENDER01 + POLITICAL_BELIEFS + SOCIALSTATUS, data = selectdata)

summary(NONCOMMUNITY.lm)

Call:
lm(formula = NONCOMMUNITY ~ POC + GENDER01 + POLITICAL_BELIEFS + 
    SOCIALSTATUS, data = selectdata)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.93892 -0.49784  0.02533  0.59418  1.86347 

Coefficients:
                  Estimate Std. Error t value Pr(>|t|)    
(Intercept)        3.10546    0.54745   5.673  8.4e-07 ***
POC1               0.13228    0.24813   0.533    0.596    
GENDER011         -0.31649    0.24733  -1.280    0.207    
POLITICAL_BELIEFS -0.03699    0.10104  -0.366    0.716    
SOCIALSTATUS      -0.07495    0.06896  -1.087    0.283    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.8011 on 47 degrees of freedom
  (1 observation deleted due to missingness)
Multiple R-squared:  0.09796,   Adjusted R-squared:  0.02119 
F-statistic: 1.276 on 4 and 47 DF,  p-value: 0.2928
#explanation: Race,  Gender, Political beliefs, and Social status evaluated as independent predictors of community trust/perceived safety through a linear model. 

#source: https://www.datacamp.com/tutorial/multiple-linear-regression-r-tutorial 

Similarly, evaluating these demographic variables as predictors of feelings of lack of safety revealed similar insignificant results. For instance difference ,as a predictor of feelings of distrust and lack of safety in one’s community being a person of color was only associated with a 0.13 point increase in scores while being nonsignificant with a p value of 0.6. In terms of gender, non-significant results (p= 2.1) revealed males scored on average only 0.32 points lower in feelings of lack of safety than females, indicating there may be a slight trend in females feeling slightly more unsafe in their communities. Political beliefs were revealed to not predict perceived lack of safety as each one unit increase in political belief corresponded to a 0.04 decrease in distrust with a high p value of 0.72. Similarly social status revealed only a 0.075 point decrease in perceived lack of safety per one unit increase in social status. With a p value of 0.28 the slight correlation between higher social status and lower feelings of distrust becomes insignificant.

1.6 Discussion

Findings & Existing Theory

Study data collected and modeled revealed no significant correlation between the measured sociodemographics and feelings of community trust and distrust or safety and lack of safety. The following conclusion results from a limited sample of randomly selected, consenting Binghamton University students and Broome County residents over the age of 18 over a month-long tabling period of data collection. Disproving original hypotheses that sociodemographic categories are predictors of higher or lower feelings of safety, trust, and distrust this data supports delving into alternative reasoning for what contributes to various perceptions of safety and feelings of trust. Unlike the lack of correlation found in this study,  some studies highlight that safety and crime predictors are correlated with sociodemographic categories, location, neighborhood stability, and social cohesion (Brisson & Roll, 2012). However other studies reaffirm a lack of definitive conclusions through national perception surveying that could not significantly determine if perceived environmental risk varied by gender and race due to mixed results (Flynn et al., 1994). Additionally, lack of correlation between demographic variables and community safety beliefs aligns with other studies investigating demographics and trust using socioecological approaches. These studies include multilevel analyses from the Project on Human Development in Chicago indicating that neighborhood, gender, home ownership, and mobility and socioeconomic status are not associated with perceived violence (Sampson et al., 1997). Similarly, other ecological studies investigating demographic trust in vaccine safety found little to no correlation between sociodemographic categories and trust levels (Lim & Moon, 2023). While original hypotheses were not supported, results highlighting that demographic variables are not significant predictors of safety beliefs, trust, perceived lack of safety, and distrust align with existing literature and are empirically supported by the multiple linear regression model.

Limitations & Implications

Limitations to this study may include sampling limitations, measurement and construct inconsistencies, and assumptions of utilizing a multiple linear regression model. The study may have been limited or skewed by the low number of individuals that continued to participate in the survey to completion. Individuals with more opinionated beliefs around safety and community trust may have decided to respond to the survey entirely or may have avoided completing the survey due to strong beliefs or feelings about phrasing or questions. This may have resulted in a more skewed dataset not representative of a wide range of beliefs. Additionally, respondents may have held response or social desirability bias when responding to the survey questions believing they were answering in a way that will be viewed favorably by others rather than indicating their true belief. The study may also have been limited by the constructs and selected measurements. Measures may have failed to capture the key concepts or left room for survey participants to form alternative interpretations of what each measure means. Finally, the assumptions of utilizing a multiple linear regression model may have limited the study data and conclusions that can be drawn from modeling as a linear model assumes a clear cut relationship between a predictor and the outcome. However, this may fail to incorporate levels of nuance that exist naturally in perceptions and beliefs from influences outside the evaluated demographics.

Beyond the limitations of this study, a lack of relationship between demographic variables as predictors of community safety beliefs, feelings of trust, and distrust indicates a need for further exploration of what predictors influence safety perceptions. A lack of correlation as demonstrated in this study may imply that other existing factors influencing feelings of safety and trust are underrepresented and unexplored in existing research. This may signal a pivot towards exploring new relationships outside of basic demographic categories that may influence an individual’s perceptions. Important next steps however may be to verify demographic variables are not significant predictors of safety and trust beliefs with a larger sample size and more validated measures. Beyond confirming the validity of study results, future research may require evaluation of more nuanced influences of safety perceptions such as familial beliefs, media content consumed, and level of education. Evaluating the driving factors of apathy, lack of  care, opinion, and thought related to safety and community trust may also require evaluation in order to devise measures that accurately unveil any existing differences in perceptions of safety and trust. Gaining a greater understanding of what key factors influence safety beliefs and perceptions of trust is key to effectively developing targeted interventions to increase safety and trust within communities.