#Load packages

#load psych package
library(psych)

#load tidyverse package
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ ggplot2::%+%()   masks psych::%+%()
## ✖ ggplot2::alpha() masks psych::alpha()
## ✖ dplyr::filter()  masks stats::filter()
## ✖ dplyr::lag()     masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(viridis) # For color-blind-friendly palettes
## Loading required package: viridisLite

#Read in data

#read in SLYCE data
SLYCE <- read.csv("Survey-SLICE-cleaned-01.21.2025.csv")

#create key composites

#compute composite for critical reflection
SLYCE$c_ref <- (SLYCE$CR_1 + SLYCE$CR_2 + SLYCE$CR_3 + SLYCE$CR_4) /4
class(SLYCE$c_ref)
## [1] "numeric"
#compute composite for critical motivation
SLYCE$c_mot <- (SLYCE$CM_1 + SLYCE$CM_2 + SLYCE$CM_3 + SLYCE$CM_4) /4

#check descriptives for c_mot to ensure compsite looks good
describe(SLYCE$c_mot)
##    vars   n mean   sd median trimmed  mad min max range  skew kurtosis   se
## X1    1 821 3.85 0.94      4    3.95 1.11   1   5     4 -0.87     0.36 0.03
#compute composite for critical action
SLYCE$c_act <- (SLYCE$CA_1 + SLYCE$CA_2 + SLYCE$CA_3 + SLYCE$CA_4 + SLYCE$CA_5) /5


#Make composite for family encouragement and conversation
SLYCE$F_conv <- (SLYCE$DS_R1_f + SLYCE$DS_R4_f + SLYCE$IS_E1_f + SLYCE$IS_E2_f) /4


#Make composite for non-parental family sociopolitical action
SLYCE$F_sa <- (SLYCE$DS_A2_f + SLYCE$DS_A3_f + SLYCE$DS_A4_f + SLYCE$DS_A5_f + SLYCE$DS_A6_f) /5


#Make composite for non-parental family discouragement for sociopolitical action
SLYCE$F_disc <- (SLYCE$AD_1_f + SLYCE$AD_3_f + SLYCE$AD_6_f + SLYCE$AD_8_f) /4


#Create composite for educator conversations and encouragement for sociopolitical action
SLYCE$Ed_enc <- (SLYCE$DS_R1_t + SLYCE$DS_R4_t + SLYCE$DS_A1_t + SLYCE$DS_A3_t + SLYCE$DS_A5_t + SLYCE$DS_A6_t  + SLYCE$DS_A7_t + SLYCE$IS_E1_t + SLYCE$IS_E2_t + SLYCE$IS_E3_t + SLYCE$IS_E4_t) /11


#Create composite for educator discouragement for sociopolitical action
SLYCE$Ed_disc <- (SLYCE$AD_1_t + SLYCE$AD_3_t + SLYCE$AD_4_t + SLYCE$AD_5_t) /4



#Create composite for community member conversations and encouragement for sociopolitical action
SLYCE$Com_enc <- (SLYCE$DS_R1_c + SLYCE$DS_R4_c + SLYCE$DS_A3_c + SLYCE$DS_A5_c + SLYCE$DS_A6_c + SLYCE$DS_A7_c + SLYCE$IS_E3_c + SLYCE$IS_E4_c) /8



#Create composite for community member discouragement
SLYCE$Com_disc <- (SLYCE$AD_1_c + SLYCE$AD_2_c + SLYCE$AD_3_c + SLYCE$AD_4_c + SLYCE$AD_5_c + SLYCE$AD_6_c + SLYCE$AD_8_c) /7


#Create composite for ARAS interpersonal action subscale 
SLYCE$ARA_Int <- (SLYCE$ARA_IA_1 + SLYCE$ARA_IA_2 + SLYCE$ARA_IA_3 + SLYCE$ARA_IA_4 + SLYCE$ARA_IA_5 + SLYCE$ARA_IA_6 + SLYCE$ARA_IA_7) /7


#Create composite for ARAS communal action subscale 
SLYCE$ARA_Com <- (SLYCE$ARA_CA_1 + SLYCE$ARA_CA_2 + SLYCE$ARA_CA_3 + SLYCE$ARA_CA_4) /4


#make gen status variable a factor
class(SLYCE$gen_status)
## [1] "character"
SLYCE$gen_status <- as.factor(SLYCE$gen_status)

#See descriptives for key study variables

#describe c_ref
describe(SLYCE$c_ref)
##    vars   n mean   sd median trimmed  mad min max range  skew kurtosis   se
## X1    1 822  3.5 1.02   3.75    3.56 1.11   1   5     4 -0.53    -0.29 0.04
#descriptives for C_mot
describe(SLYCE$c_mot)
##    vars   n mean   sd median trimmed  mad min max range  skew kurtosis   se
## X1    1 821 3.85 0.94      4    3.95 1.11   1   5     4 -0.87     0.36 0.03
#check descriptives for c_act 
describe(SLYCE$c_act)
##    vars   n mean  sd median trimmed  mad min max range skew kurtosis   se
## X1    1 821 2.09 1.1    1.8    1.96 1.19   1   5     4 0.64    -0.74 0.04
#Descriptives for family spd discussion
describe(SLYCE$F_conv)
##    vars   n mean   sd median trimmed  mad min max range  skew kurtosis   se
## X1    1 821 3.62 1.28   3.75    3.66 1.11   1   6     5 -0.22    -0.46 0.04
#Descriptives for family sa encouragement
describe(SLYCE$F_sa)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 820 2.66 1.32    2.6    2.57 1.78   1   6     5 0.33    -0.77 0.05
#Descriptives for family discouragement
describe(SLYCE$F_disc)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 821 3.02 1.39      3    2.97 1.48   1   6     5 0.11    -0.89 0.05
#Descriptives for educator encouragement
describe(SLYCE$Ed_enc)
##    vars   n mean  sd median trimmed  mad min max range  skew kurtosis   se
## X1    1 819 3.57 1.2   3.64    3.61 1.21   1   6     5 -0.21    -0.31 0.04
#Descriptives for educator discouragement
describe(SLYCE$Ed_disc)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 821 2.97 1.39      3    2.92 1.48   1   6     5 0.13    -0.88 0.05
#descriptives for community member convos encouragement
describe(SLYCE$Com_enc)
##    vars   n mean   sd median trimmed  mad min max range  skew kurtosis   se
## X1    1 820 3.35 1.21   3.38    3.35 1.11   1   6     5 -0.05    -0.37 0.04
#descriptives for community member discouragement
describe(SLYCE$Com_disc)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 820 3.07 1.33   3.14    3.03 1.27   1   6     5 0.07     -0.7 0.05

#Let’s look st descriptives by immigration status

#Cr descriptives by immugration status
describeBy(SLYCE$c_ref, SLYCE$gen_status, mat = TRUE)
##     item            group1 vars   n     mean        sd median  trimmed     mad
## X11    1  First Generation    1 127 3.316929 1.0599345   3.50 3.378641 1.11195
## X12    2 Second Generation    1 361 3.644044 0.9581662   3.75 3.713668 1.11195
## X13    3  Third Generation    1 305 3.449180 1.0335050   3.50 3.500000 1.11195
##     min max range       skew    kurtosis         se
## X11   1   5     4 -0.4686011 -0.41579233 0.09405398
## X12   1   5     4 -0.6283104 -0.02398135 0.05042980
## X13   1   5     4 -0.4365541 -0.47326910 0.05917832
#CM descriptives by immugration status
describeBy(SLYCE$c_mot, SLYCE$gen_status, mat = TRUE)
##     item            group1 vars   n     mean        sd median  trimmed     mad
## X11    1  First Generation    1 126 3.674603 1.0383977  3.875 3.769608 1.11195
## X12    2 Second Generation    1 361 3.973684 0.8734113  4.250 4.064879 0.74130
## X13    3  Third Generation    1 305 3.821311 0.9461426  4.000 3.914286 0.74130
##     min max range       skew   kurtosis         se
## X11   1   5     4 -0.6901494 -0.1982780 0.09250782
## X12   1   5     4 -0.9093320  0.5069410 0.04596901
## X13   1   5     4 -0.8509155  0.2032412 0.05417597
#CM descriptives by immugration status
describeBy(SLYCE$c_act, SLYCE$gen_status, mat = TRUE)
##     item            group1 vars   n     mean       sd median  trimmed     mad
## X11    1  First Generation    1 126 2.419048 1.087067    2.6 2.366667 1.18608
## X12    2 Second Generation    1 362 2.018232 1.095647    1.6 1.879310 0.88956
## X13    3  Third Generation    1 304 2.044079 1.103863    1.6 1.908197 0.88956
##     min max range      skew   kurtosis         se
## X11   1   5     4 0.1684810 -0.9589183 0.09684361
## X12   1   5     4 0.7674605 -0.5505675 0.05758593
## X13   1   5     4 0.7073168 -0.7046907 0.06331086
describeBy(SLYCE$F_conv, SLYCE$gen_status, mat = TRUE)
##     item            group1 vars   n     mean       sd median  trimmed     mad
## X11    1  First Generation    1 125 3.502000 1.312738   3.75 3.529703 1.48260
## X12    2 Second Generation    1 362 3.642265 1.229878   3.75 3.678448 1.11195
## X13    3  Third Generation    1 305 3.668033 1.337037   3.75 3.712245 1.48260
##     min max range       skew   kurtosis         se
## X11   1   6     5 -0.1868219 -0.6285720 0.11741490
## X12   1   6     5 -0.2448270 -0.2950770 0.06464094
## X13   1   6     5 -0.2180326 -0.5994695 0.07655850

#Now let’s see some histrograms for the variables above

##Histogram for Critical Reflection

##Histogram for Critical Reflection
ggplot(SLYCE, aes(x = c_ref)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of c_ref Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for Critical Motivation

##Histogram for Critical Motivation
ggplot(SLYCE, aes(x = c_mot)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of c_mot Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for Critical Action

##Histogram for Critical Action
ggplot(SLYCE, aes(x = c_act)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of c_act Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for Interpersonal Action

##Histogram for Interpersonal Action
ggplot(SLYCE, aes(x = ARA_Int)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of ARA_Int Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for Communal Action

##Histogram for Communal Action
ggplot(SLYCE, aes(x = ARA_Com)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of ARA_Com Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for family encouraging convos

##Histogram for family encouraging convos
ggplot(SLYCE, aes(x = F_conv)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of f_conv Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for family family sociopoltiical action

##Histogram for Family socipolitical action
ggplot(SLYCE, aes(x = F_sa)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of f_sa Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for family family discouragement

##Histogram for Family discouragement
ggplot(SLYCE, aes(x = F_disc)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of f_disc Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for educator encouragement

##Histogram for Educator encouragement
ggplot(SLYCE, aes(x = Ed_enc)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of Ed_enc Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 4 rows containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for educator discouragement

##Histogram for Educator discouragement
ggplot(SLYCE, aes(x = Ed_disc)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of Ed_disc Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for community member encouragement

##Histogram for community member encouragement
ggplot(SLYCE, aes(x = Com_enc)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of Com_enc Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_count()`).

##Histogram for community member discouragement

##Histogram for community member discouragement
ggplot(SLYCE, aes(x = Com_disc)) +  
  geom_bar(fill = "steelblue", color = "black") +  # Bar plot with customized color
  labs(
    title = "Distribution of Com_disc Responses",
    x = "Likert Scale (1-6)",
    y = "Frequency"
  ) +  # Add axis labels and title
  theme_minimal() +  # Use a clean theme
  theme(
    text = element_text(size = 14),
    plot.title = element_text(hjust = 0.5)  # Center the title
  )
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_count()`).

#Box plots for variables

##Remove NAs on immigrant status so that box plots don;t have an empty box

SLYCE_clean <- SLYCE %>% filter(!is.na(gen_status))

##Box plot looking at critical reflection by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = c_ref)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Critical Reflection by GenStatus", x = "GenStatus", y = "c_ref") +
  theme_classic()
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at critical motivation by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = c_mot)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Critical Motivation by GenStatus", x = "GenStatus", y = "c_mot") +
  theme_classic()
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at critical action by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = c_act)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Critical Action by GenStatus", x = "GenStatus", y = "c_act") +
  theme_classic()
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at interperonal action by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = ARA_Int)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Interpersonal Action by GenStatus", x = "GenStatus", y = "ARA_Int") +
  theme_classic()
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at communal action by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = ARA_Com)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Interpersonal Action by GenStatus", x = "GenStatus", y = "ARA_Com") +
  theme_classic()
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at family encouragement by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = F_conv)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Family Encouragement by GenStatus", x = "GenStatus", y = "F_conv") +
  theme_classic()
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at family sociopolitical action by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = F_sa)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Family Sociopolitical Action by GenStatus", x = "GenStatus", y = "F_sa") +
  theme_classic()
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at family discouragement by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = F_disc)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Family Discouragement by GenStatus", x = "GenStatus", y = "F_disc") +
  theme_classic()
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at Educator Encouragement by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = Ed_enc)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Educator Encouragement by GenStatus", x = "GenStatus", y = "Ed_enc") +
  theme_classic()
## Warning: Removed 4 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 4 rows containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at Educator Discouragement by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = Ed_disc)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Educator Discouragement by GenStatus", x = "GenStatus", y = "Ed_disc") +
  theme_classic()
## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at Community Member Encouragement by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = Com_enc)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Community Member Encouragement by GenStatus", x = "GenStatus", y = "Com_enc") +
  theme_classic()
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_point()`).

##Box plot looking at Community Member Discouragement by Immigrant Status

ggplot(SLYCE_clean, aes(x = gen_status, y = Com_disc)) +
  geom_boxplot() + # Customize outliers
  geom_jitter(aes(color = gen_status), width = 0.25) + # Add jittered points
  scale_color_viridis_d(option = "D") + # Discrete viridis palette
  labs(title = "Box Plot for Community Member Discouragement by GenStatus", x = "GenStatus", y = "Com_disc") +
  theme_classic()
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_point()`).