Data Analysis and Visualization
Community Data: Combined Report

Author

Gagan Atreya

Published

July 28, 2023

Section 1. Demographics

Demographic variables in the analysis:

  • Age
  • Gender
  • Socio-economic status
  • Nature of employment
  • Religious affiliation
  • Marital status
  • Ethnicity
Display code
options(digits = 2)
rm(list=ls())

## Install "pacman" package if not installed
# (remove the # symbol from the line below):
# install.packages("pacman")

## Load R packages:
pacman::p_load(data.table, tidyverse, haven, labelled, vtable, 
               psych, scales, weights, clipr, forcats,
               stargazer, ggthemes, ggcharts, geomtextpath,
               corrplot, tm, readxl, patchwork, modelsummary)

## Import datasets:
## These are newer datasets with new variables created in the individual analyses:
dsgmb <- fread("/home/gagan/Desktop/oxford/data/cleanedds/dsgmb.csv")
dsgmb$Country <- "Gambia"
dsgmb$id <- 1:nrow(dsgmb)
dsgmb$ID <- paste0("GMB",dsgmb$id)

dspak <- fread("/home/gagan/Desktop/oxford/data/cleanedds/dspak.csv")
dspak$Country <- "Pakistan"
dspak$id <- 1:nrow(dspak)
dspak$ID <- paste0("PAK",dspak$id)

dstza <- fread("/home/gagan/Desktop/oxford/data/cleanedds/dstza.csv")
dstza$Country <- "Tanzania"
dstza$id <- 1:nrow(dstza)
dstza$ID <- paste0("TZA",dstza$id)

dsuga <- fread("/home/gagan/Desktop/oxford/data/cleanedds/dsuga.csv")
dsuga$Country <- "Uganda"
dsuga$id <- 1:nrow(dsuga)
dsuga$ID <- paste0("UGA",dsuga$id)

## Correct asterisk pattern for stargazer tables:
starpattern <- "<em>&#42;p&lt;0.05;&nbsp;&#42;&#42;p&lt;0.01;&nbsp;&#42;&#42;&#42;p&lt;0.001</em>"

## List of variables to retain from all datasets:
list1 <- c("ID", "Country", "age", "gender", 
           "ses", "jobnature", "religion", "married",
           "IGF01", "IGF02", "IGF03", "IGI01", "IGI02", "IGI03", 
           "OGF01", "OGF02", "OGF03", "OGI01", "OGI02", "OGI03",
           "ENDBCL01", "ENDBCL02", "ENDBCL03", "ENDBBL01", "ENDBBL02", "ENDBBL03",
           "EXPBCL01", "EXPBCL02", "EXPBCL03", "EXPBBL01", "EXPBBL02", "EXPBBL03", 
           "empathic_concern_01", "empathic_concern_02", "empathic_concern_03",
           "perspective_taking_01", "perspective_taking_02", 
           "perspective_taking_03", "perspective_taking_04", "history_discrimination",
           "og_hostility", "og_cooperation", "fight_outgroup", "imagistic",
           "event_positive_affect", "event_negative_affect", "event_episodic_recall",
           "event_shared_perception", "event_event_reflection", 
           "event_transformative_indiv", "event_transformative_group")

## Subset datasets to only the columns in the above list:
dsgmb1 <- dsgmb[, ..list1]
dspak1 <- dspak[, ..list1]
dstza1 <- dstza[, ..list1]
dsuga1 <- dsuga[, ..list1]

## Merged dataset with needed columns only
ds <- rbind(dsgmb1, dspak1, dstza1, dsuga1)

## Rename the "Event_" columns with title case:
ds01 <- ds[, 1:44]
ds02 <- ds[, !(2:44)]
colnames(ds02) <- stringr::str_to_title(colnames(ds02))
ds02$ID <- ds02$Id
ds02 <- ds02[, !1]
ds <- merge(ds01, ds02, by = "ID")
rm(ds01, ds02)

Variable: Sample size by Country

Display code
tbl01 <- table(ds$Country)

## Table of user language by country:
tbl01

  Gambia Pakistan Tanzania   Uganda 
     232      504      352      500 
Display code
## Sample size by country:

lp01 <- ds %>% 
  # drop_na(Country) %>%
  lollipop_chart(x = Country,
               line_color = "black",
               point_color = "black")+
  labs(y = "Frequency",
       x = "",
       title = "Sample size by country")+
  theme_bw()

lp01

Variable: Age

Display code
summary(ds$age)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
     18      26      34      37      45      92      60 
Display code
ds %>% drop_na(age)%>%
ggplot(aes(x = age))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 50)+
  geom_textvline(label = "Mean = 37.00", 
                 xintercept = 37.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Age", 
       y = "Frequency", 
       title = "Age distribution (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(age)%>%
ggplot(aes(x = age))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 50)+
#  geom_textvline(label = "Mean = 37.00", 
#                 xintercept = 37.00, 
#                 vjust = 1.1, 
#                 lwd = 1.05, 
#                 linetype = 2)+
  labs(x = "Age", 
       y = "Frequency", 
       title = "Age distribution by country")+
  facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Gender

Display code
ds$gender <- ifelse(ds$gender == "Male", "Male",
             ifelse(ds$gender == "Female", "Female", NA))

lp02 <- ds %>% 
  drop_na(gender, age, Country) %>%
lollipop_chart(x = gender,
               line_color = "black",
               point_color = "black")+
  labs(y = "Frequency",
       x = "",
       title = "Gender distribution (full sample)")+
#  facet_wrap(~Country, nrow = 2)+
  theme_bw()

lp02

Display code
bp01 <- ds %>% drop_na(gender, age) %>% 
  ggplot(aes(y = age, 
             x = gender))+
geom_boxplot(fill = "grey")+
  labs(y = "Age",
       x = "",
       title = "Age and gender distribution by country")+
  facet_wrap(~Country, nrow = 2)+
  coord_flip()+
  theme_bw()

bp01

Variable: Socio-economic status

Display code
ds$ses <- ifelse(ds$ses == "", NA, ds$ses)
table(ds$ses)

Lower middle       Middle        Upper Upper middle 
         508          822           24          170 
Display code
ds %>% drop_na(ses) %>%
lollipop_chart(x = ses,
               line_color = "black",
               point_color = "black")+
  labs(y = "Frequency",
       x = "",
       title = "Socioeconomic status (full sample)")+
  theme_bw()

Display code
ds %>% 
  drop_na(ses) %>%
  group_by(ses, Country) %>% 
  summarise(count = n()) %>% 
  ggplot(aes(ses, count)) + 
  geom_segment(aes(x=ses, 
                   xend=ses, 
                   y=0, 
                   yend=count))+ 
  geom_point()+
  labs(x = "", 
       y = "Frequency", 
       title = "Socioeconomic status by country")+
    facet_wrap(vars(Country), nrow = 2)+
  coord_flip()+
  theme_bw()

Variable: Nature of employment

Display code
ds$jobnature <- ifelse(ds$jobnature == "", NA, ds$jobnature)

#sentence case:
ds$jobnature <- gsub("(\\D)(\\D+)", "\\U\\1\\L\\2", ds$jobnature, perl = TRUE)

ds$jobnature <- ifelse(ds$jobnature == "Non-government/self-employed", 
                       "Non-government", ds$jobnature)

table(ds$jobnature)

    Government Non-government          Other        Retired  Self-employed 
           321            292              3              1            797 
       Student 
             6 
Display code
ds %>% drop_na(jobnature) %>%
lollipop_chart(x = jobnature,
               line_color = "black",
               point_color = "black")+
  labs(y = "Frequency",
       x = "",
       title = "Nature of employment (full sample)")+
  theme_bw()

Display code
ds %>% 
  drop_na(jobnature) %>%
  group_by(jobnature, Country) %>% 
  summarise(count = n()) %>% 
  ggplot(aes(jobnature, count)) + 
  geom_segment(aes(x=jobnature, 
                   xend=jobnature, 
                   y=0, 
                   yend=count))+ 
  geom_point()+
  labs(x = "", 
       y = "Frequency", 
       title = "Nature of employment by country")+
    facet_wrap(vars(Country), nrow = 2)+
  coord_flip()+
  theme_bw()

Variable: Religious affiliation

Display code
ds$religion <- ifelse(ds$religion == "", NA, ds$religion)

ds$religion <- ifelse(ds$religion == "Christian (Catholic)", "Christian: Catholic", 
               ifelse(ds$religion == "Christian (Protestant)", "Christian: Protestant",
               ifelse(ds$religion == "Muslim (Shia)", "Muslim: Shia",
               ifelse(ds$religion == "Muslim (Sunni)", "Muslim: Sunni", ds$religion))))
table(ds$religion)

    Christian: Catholic        Christian: Other  Christian: Pentecostal 
                    497                      41                      33 
  Christian: Protestant                   Hindu           Muslim: Other 
                    219                      37                       3 
           Muslim: Shia           Muslim: Sunni                   Other 
                    187                     405                      89 
                   Sikh Spiritual not religious 
                      9                      14 
Display code
lp05 <- ds %>% drop_na(religion) %>%
lollipop_chart(x = religion,
               line_color = "black",
               point_color = "black")+
  labs(y = "Frequency",
       x = "",
       title = "Religious distribution (full sample)")+
  theme_bw()

lp05

Display code
ds %>% 
  drop_na(religion) %>%
  group_by(religion, Country) %>% 
  summarise(count = n()) %>% 
  ggplot(aes(religion, count)) + 
  geom_segment(aes(x=religion, 
                   xend=religion, 
                   y=0, 
                   yend=count))+ 
  geom_point()+
  labs(x = "", 
       y = "Frequency", 
       title = "Religious distribution by country")+
    facet_wrap(vars(Country), nrow = 2)+
  coord_flip()+
  theme_bw()

Variable: Marital status

Display code
ds$married <- ifelse(ds$married == "Not married", "Unmarried", ds$married)
ds$married <- ifelse(ds$married == "", NA, ds$married)

table(ds$married)

  Married     Other Unmarried 
      979        92       479 
Display code
## Marital status (full sample):

ds %>% 
  drop_na(married) %>%
  group_by(married) %>% 
  summarise(count = n()) %>% 
  ggplot(aes(married, count)) + 
  geom_segment(aes(x=married, xend=married, 
                   y=0, yend=count))+ 
  geom_point()+
  labs(x = "", 
       y = "Frequency", 
       title = "Marital status (full sample)")+
  coord_flip()+
  theme_bw()

Display code
## Marital status by country:
ds %>% 
  drop_na(married) %>%
  group_by(married, Country) %>% 
  summarise(count = n()) %>% 
  ggplot(aes(married, count)) + 
  geom_segment(aes(x=married, xend=married, 
                   y=0, yend=count))+ 
  geom_point()+
  labs(x = "", 
       y = "Frequency", 
       title = "Marital status by country")+
    facet_wrap(vars(Country), nrow = 2)+
  coord_flip()+
  theme_bw()

Variable: Ethnicity

Display code
## Gambia:
eth <- as.data.frame(table(dsgmb$Ethnicity))
eth$Var1 <- as.character(eth$Var1)
eth$ethnicity <- ifelse(eth$Freq < 2, "Other", eth$Var1)
l1 <- as.list(eth$ethnicity)

dsgmb2 <- dsgmb[, c("Ethnicity")]

dsgmb2$ethnicity <- ifelse(dsgmb2$Ethnicity %in% l1, dsgmb2$Ethnicity, "Other")
dsgmb2$ethnicity <- ifelse(dsgmb2$ethnicity == "Serere", "Serer",
                 ifelse(dsgmb2$ethnicity == "", NA, dsgmb2$ethnicity))

table(dsgmb2$ethnicity)

 Balanta     Fula     Jola Karonika Mandinka  Manjago    Other    Serer 
       3       31       45        3       74        5       11        4 
  Wollof 
      19 
Display code
ethgmb <- dsgmb2 %>% drop_na(ethnicity) %>%
lollipop_chart(x = ethnicity,
               line_color = "black",
               point_color = "black")+
  labs(y = "Frequency",
       x = "",
       title = "Ethnic distribution: Gambia")+
  theme_bw()

ethgmb

Display code
## Pakistan:
eth <- as.data.frame(table(dspak$Ethnicity))
eth$Var1 <- as.character(eth$Var1)
eth$ethnicity <- ifelse(eth$Freq < 7, "Other", eth$Var1)
l1 <- as.list(eth$ethnicity)

dspak2 <- dspak[, c("Ethnicity")]

dspak2$ethnicity <- ifelse(dspak2$Ethnicity %in% l1, dspak2$Ethnicity, "Other")
dspak2$ethnicity <- ifelse(dspak2$ethnicity == "Serere", "Serer",
                 ifelse(dspak2$ethnicity == "", NA, dspak2$ethnicity))

table(dspak2$ethnicity)

      Bhatti    Christain       Hazara         Jopu        Other      Punjabi 
          22           28            7           20          124          118 
      Rajput      Sadozai         Shia         Sikh       Sindhi        Sunni 
           9           10           20           10           14           29 
        Syed Urduspeaking 
          33           60 
Display code
ethpak <- dspak2 %>% drop_na(ethnicity) %>%
lollipop_chart(x = ethnicity,
               line_color = "black",
               point_color = "black")+
  labs(y = "Frequency",
       x = "",
       title = "Ethnic distribution: Pakistan")+
  theme_bw()

ethpak

Display code
## Tanzania:
eth <- as.data.frame(table(dstza$Ethnicity))
eth$Var1 <- as.character(eth$Var1)
eth$ethnicity <- ifelse(eth$Freq < 7, "Other", eth$Var1)
l1 <- as.list(eth$ethnicity)

dstza2 <- dstza[, c("Ethnicity")]

dstza2$ethnicity <- ifelse(dstza2$Ethnicity %in% l1, dstza2$Ethnicity, "Other")
dstza2$ethnicity <- ifelse(dstza2$ethnicity == "Serere", "Serer",
                 ifelse(dstza2$ethnicity == "", NA, dstza2$ethnicity))

table(dstza2$ethnicity)

 Maasai  Mchaga   Mgogo Mlugulu Mluguru  Mngoni   Mpare Msambaa Msukuma    Muha 
    122       9       8      11      15       8       9      11      10       7 
 Mzigua   Other 
      7     120 
Display code
ethtza <- dstza2 %>% drop_na(ethnicity) %>%
lollipop_chart(x = ethnicity,
               line_color = "black",
               point_color = "black")+
  labs(y = "Frequency",
       x = "",
       title = "Ethnic distribution: Tanzania")+
  theme_bw()

ethtza

Display code
## Uganda:
eth <- as.data.frame(table(dsuga$Ethnicity))
eth$Var1 <- as.character(eth$Var1)
eth$ethnicity <- ifelse(eth$Freq < 7, "Other", eth$Var1)
l1 <- as.list(eth$ethnicity)

dsuga2 <- dsuga[, c("Ethnicity")]

dsuga2$ethnicity <- ifelse(dsuga2$Ethnicity %in% l1, dsuga2$Ethnicity, "Other")
dsuga2$ethnicity <- ifelse(dsuga2$ethnicity == "Serere", "Serer",
                 ifelse(dsuga2$ethnicity == "", NA, dsuga2$ethnicity))

table(dsuga2$ethnicity)

     Adhola    Amudaama      Atesot       Bantu      Etesot       Gishu 
         18          12          69          11          74           8 
     Itesot   Japadhola japhadollah Japhadollah     Munyole      Musoga 
         32         107          24          30           7           8 
    Nilotic       Other 
         27          73 
Display code
ethuga <- dsuga2 %>% drop_na(ethnicity) %>%
lollipop_chart(x = ethnicity,
               line_color = "black",
               point_color = "black")+
  labs(y = "Frequency",
       x = "",
       title = "Ethnic distribution: Uganda")+
  theme_bw()

ethuga

Section 2. Variables of interest

Variables of interest in the analysis:

  • Endorsement of Barrier Bound Leadership (BBL)
  • Endorsement of Barrier Crossing Leadership (BCL)
  • Ingroup fusion
  • Ingroup identification
  • Outgroup bonds (sum of outgroup fusion+identification)
  • Empathic concern
  • Perspective taking
  • Perceived history of discrimination
  • Imagistic items:
    • Event: Positive affect
    • Event: Negative affect
    • Event: Episodic recall
    • Event: Shared perception
    • Event: Reflection
    • Event: Transformative for individual
    • Event: Transformative for group
    • Imagistic event (sum of all above)

Variable: Endorsement of Barrier Bound Leadership (BBL)

Display code
ds$bbl <- (ds$ENDBBL01+ ds$ENDBBL02+ ds$ENDBBL03)/3
ds$bcl <- (ds$ENDBCL01+ ds$ENDBCL02+ ds$ENDBCL03)/3

summary(ds$bbl)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       3       5       4       6       7      75 
Display code
ds %>% drop_na(bbl)%>%
ggplot(aes(x = bbl))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
  geom_textvline(label = "Mean = 4.00", 
                 xintercept = 4.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Endorsement of BBL score", 
       y = "Frequency", 
       title = "Endorsement of BBL (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(bbl, Country)%>%
ggplot(aes(x = bbl))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
 labs(x = "Endorsement of BBL score", 
       y = "Frequency", 
       title = "Endorsement of BBL by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(bbl)%>%
ggplot(aes(x = bbl,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 4.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
 labs(x = "Endorsement of BBL score", 
       y = "Frequency", 
       title = "Endorsement of BBL by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Endorsement of Barrier Crossing Leadership (BCL)

Display code
summary(ds$bcl)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       5       6       6       6       7      71 
Display code
ds %>% drop_na(bcl)%>%
ggplot(aes(x = bcl))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
  geom_textvline(label = "Mean = 6.00", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Endorsement of BCL score", 
       y = "Frequency", 
       title = "Endorsement of BCL (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(bcl, Country)%>%
ggplot(aes(x = bcl))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
 labs(x = "Endorsement of BCL score", 
       y = "Frequency", 
       title = "Endorsement of BCL by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(bcl)%>%
ggplot(aes(x = bcl,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
 labs(x = "Endorsement of BCL score", 
       y = "Frequency", 
       title = "Endorsement of BCL by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Ingroup fusion

Display code
ds$igfusion <- (ds$IGF01+ds$IGF02+ds$IGF03)/3

summary(ds$igfusion)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       6       6       6       7       7      79 
Display code
ds %>% drop_na(igfusion)%>%
ggplot(aes(x = igfusion))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
  geom_textvline(label = "Mean = 6.00", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Ingroup fusion score", 
       y = "Frequency", 
       title = "Ingroup fusion (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(igfusion, Country)%>%
ggplot(aes(x = igfusion))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
 labs(x = "Ingroup fusion score", 
       y = "Frequency", 
       title = "Ingroup fusion by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(igfusion)%>%
ggplot(aes(x = igfusion,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Ingroup fusion score", 
       y = "Frequency", 
       title = "Ingroup fusion by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Ingroup identification

Display code
ds$IGI01 <- ifelse(ds$IGI01 %in% 1:7, ds$IGI01, NA)
ds$igidentification <- (ds$IGI01+ds$IGI02+ds$IGI03)/3

summary(ds$igidentification)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       6       6       6       7       7      83 
Display code
ds %>% drop_na(igidentification)%>%
ggplot(aes(x = igidentification))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
  geom_textvline(label = "Mean = 6.00", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Ingroup identification score", 
       y = "Frequency", 
       title = "Ingroup identification (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(igidentification, Country)%>%
ggplot(aes(x = igidentification))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
 labs(x = "Ingroup identification score", 
       y = "Frequency", 
       title = "Ingroup identification by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(igidentification)%>%
ggplot(aes(x = igidentification,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Ingroup identification score", 
       y = "Frequency", 
       title = "Ingroup identification by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Outgroup bonds

Display code
ds$ogbonds <- (ds$OGI01+ds$OGI02+ds$OGI03+
               ds$OGF01+ds$OGF02+ds$OGF03)/6

summary(ds$ogbonds)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       2       3       3       4       7     136 
Display code
ds %>% drop_na(ogbonds)%>%
ggplot(aes(x = ogbonds))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 35)+
  geom_textvline(label = "Mean = 3.00", 
                 xintercept = 3.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Outgroup bonds score", 
       y = "Frequency", 
       title = "Outgroup bonds (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(ogbonds, Country)%>%
ggplot(aes(x = ogbonds))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
 labs(x = "Outgroup bonds score", 
       y = "Frequency", 
       title = "Outgroup bonds by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(ogbonds)%>%
ggplot(aes(x = ogbonds,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 3.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
 labs(x = "Outgroup bonds score", 
       y = "Frequency", 
       title = "Outgroup bonds by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Empathic concern

Display code
ds$empathic_concern <- (ds$empathic_concern_01+ds$empathic_concern_02+
                        ds$empathic_concern_03)/3

summary(ds$empathic_concern)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       5       6       6       6       7      68 
Display code
ds %>% drop_na(empathic_concern)%>%
ggplot(aes(x = empathic_concern))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 35)+
  geom_textvline(label = "Mean = 6.00", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Empathic concern score", 
       y = "Frequency", 
       title = "Empathic concern (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(empathic_concern, Country)%>%
ggplot(aes(x = empathic_concern))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
 labs(x = "Empathic concern score", 
       y = "Frequency", 
       title = "Empathic concern by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(empathic_concern)%>%
ggplot(aes(x = empathic_concern,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
 labs(x = "Empathic concern score", 
       y = "Frequency", 
       title = "Empathic concern by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Perspective taking

Display code
ds$perspective_taking <- (ds$perspective_taking_01+ds$perspective_taking_02+
                          ds$perspective_taking_03+ds$perspective_taking_04)/4

summary(ds$perspective_taking)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       5       6       6       6       7      87 
Display code
ds %>% drop_na(perspective_taking)%>%
ggplot(aes(x = perspective_taking))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 35)+
  geom_textvline(label = "Mean = 6.00", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Perspective taking score", 
       y = "Frequency", 
       title = "Perspective taking (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(perspective_taking, Country)%>%
ggplot(aes(x = perspective_taking))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 25)+
 labs(x = "Perspective taking score", 
       y = "Frequency", 
       title = "Perspective taking by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(perspective_taking)%>%
ggplot(aes(x = perspective_taking,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
 labs(x = "Perspective taking score", 
       y = "Frequency", 
       title = "Perspective taking by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Perceived history of discrimination

Display code
summary(ds$history_discrimination)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       2       4       4       6       7      60 
Display code
ds %>% drop_na(history_discrimination)%>%
ggplot(aes(x = history_discrimination))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 10)+
  geom_textvline(label = "Mean = 4.00", 
                 xintercept = 4.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Perceived history of discrimination score", 
       y = "Frequency", 
       title = "Perceived history of discrimination (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(history_discrimination, Country)%>%
ggplot(aes(x = history_discrimination))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 10)+
 labs(x = "Perceived history of discrimination score", 
       y = "Frequency", 
       title = "Perceived history of discrimination by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(history_discrimination)%>%
ggplot(aes(x = history_discrimination,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 4.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+ 
  labs(x = "Perceived history of discrimination score", 
       y = "Frequency", 
       title = "Perceived history of discrimination by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Event: Positive Affect

Display code
summary(ds$Event_positive_affect)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       1       3       4       6       7      70 
Display code
ds %>% drop_na(Event_positive_affect)%>%
ggplot(aes(x = Event_positive_affect))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
  geom_textvline(label = "Mean = 4.00", 
                 xintercept = 4.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Event: Positive affect score", 
       y = "Frequency", 
       title = "Event: Positive affect (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(Event_positive_affect, Country)%>%
ggplot(aes(x = Event_positive_affect))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
 labs(x = "Event: Positive affect score", 
       y = "Frequency", 
       title = "Event: Positive affect by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(Event_positive_affect)%>%
ggplot(aes(x = Event_positive_affect,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 4.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+ 
  labs(x = "Event: Positive affect score", 
       y = "Frequency", 
       title = "Event: Positive affect by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Event: Negative Affect

Display code
summary(ds$Event_negative_affect)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       2       6       5       7       7      64 
Display code
ds %>% drop_na(Event_negative_affect)%>%
ggplot(aes(x = Event_negative_affect))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
  geom_textvline(label = "Mean = 5.00", 
                 xintercept = 5.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Event: Negative affect score", 
       y = "Frequency", 
       title = "Event: Negative affect (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(Event_negative_affect, Country)%>%
ggplot(aes(x = Event_negative_affect))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
 labs(x = "Event: Negative affect score", 
       y = "Frequency", 
       title = "Event: Negative affect by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(Event_negative_affect)%>%
ggplot(aes(x = Event_negative_affect,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 5.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+ 
  labs(x = "Event: Negative affect score", 
       y = "Frequency", 
       title = "Event: Negative affect by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Event: Episodic recall

Display code
summary(ds$Event_episodic_recall)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       6       6       6       7       7      77 
Display code
ds %>% drop_na(Event_episodic_recall)%>%
ggplot(aes(x = Event_episodic_recall))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
  geom_textvline(label = "Mean = 6.00", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Event: Episodic recall score", 
       y = "Frequency", 
       title = "Event: Episodic recall (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(Event_episodic_recall, Country)%>%
ggplot(aes(x = Event_episodic_recall))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
 labs(x = "Event: Episodic recall score", 
       y = "Frequency", 
       title = "Event: Episodic recall by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(Event_episodic_recall)%>%
ggplot(aes(x = Event_episodic_recall,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+ 
  labs(x = "Event: Episodic recall score", 
       y = "Frequency", 
       title = "Event: Episodic recall by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Event: Shared perception

Display code
summary(ds$Event_shared_perception)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       5       6       6       6       7      67 
Display code
ds %>% drop_na(Event_shared_perception)%>%
ggplot(aes(x = Event_shared_perception))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
  geom_textvline(label = "Mean = 6.00", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Event: Shared perception score", 
       y = "Frequency", 
       title = "Event: Shared perception (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(Event_shared_perception, Country)%>%
ggplot(aes(x = Event_shared_perception))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
 labs(x = "Event: Shared perception score", 
       y = "Frequency", 
       title = "Event: Shared perception by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(Event_shared_perception)%>%
ggplot(aes(x = Event_shared_perception,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+ 
  labs(x = "Event: Shared perception score", 
       y = "Frequency", 
       title = "Event: Shared perception by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Event: Reflection

Display code
ds$Event_reflection <- ds$Event_event_reflection
summary(ds$Event_reflection)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       4       6       5       6       7      77 
Display code
ds %>% drop_na(Event_reflection)%>%
ggplot(aes(x = Event_reflection))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
  geom_textvline(label = "Mean = 6.00", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Event: Reflection score", 
       y = "Frequency", 
       title = "Event: Reflection (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(Event_reflection, Country)%>%
ggplot(aes(x = Event_reflection))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
 labs(x = "Event: Reflection score", 
       y = "Frequency", 
       title = "Event: Reflection by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(Event_reflection)%>%
ggplot(aes(x = Event_reflection,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 6.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+ 
  labs(x = "Event: Reflection score", 
       y = "Frequency", 
       title = "Event: Reflection by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Event: Transformative for individual

Display code
summary(ds$Event_transformative_indiv)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       4       6       5       6       7      86 
Display code
ds %>% drop_na(Event_transformative_indiv)%>%
ggplot(aes(x = Event_transformative_indiv))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
  geom_textvline(label = "Mean = 5.00", 
                 xintercept = 5.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Event: Transformative for individual score", 
       y = "Frequency", 
       title = "Event: Transformative for individual (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(Event_transformative_indiv, Country)%>%
ggplot(aes(x = Event_transformative_indiv))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
 labs(x = "Event: Transformative for individual score", 
       y = "Frequency", 
       title = "Event: Transformative for individual by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(Event_transformative_indiv)%>%
ggplot(aes(x = Event_transformative_indiv,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 5.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+ 
  labs(x = "Event: Transformative for individual score", 
       y = "Frequency", 
       title = "Event: Transformative for individual by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Event: Transformative for group

Display code
summary(ds$Event_transformative_group)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      1       4       6       5       6       7      66 
Display code
ds %>% drop_na(Event_transformative_group)%>%
ggplot(aes(x = Event_transformative_group))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
  geom_textvline(label = "Mean = 5.00", 
                 xintercept = 5.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Event: Transformative for group score", 
       y = "Frequency", 
       title = "Event: Transformative for group (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(Event_transformative_group, Country)%>%
ggplot(aes(x = Event_transformative_group))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
 labs(x = "Event: Transformative for group score", 
       y = "Frequency", 
       title = "Event: Transformative for group by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(Event_transformative_group)%>%
ggplot(aes(x = Event_transformative_group,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 5.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+ 
  labs(x = "Event: Transformative for group score", 
       y = "Frequency", 
       title = "Event: Transformative for group by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Variable: Imagistic event (sum of all subscales)

Display code
ds$Event_imagistic <- ds$imagistic

summary(ds$Event_imagistic)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
      7      32      36      35      40      49     133 
Display code
ds %>% drop_na(Event_imagistic)%>%
ggplot(aes(x = Event_imagistic))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
  geom_textvline(label = "Mean = 35.00", 
                 xintercept = 35.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+
  labs(x = "Event: Imagistic score", 
       y = "Frequency", 
       title = "Event: Imagistic (full sample)")+
  theme_bw()

Display code
ds %>% drop_na(Event_imagistic, Country)%>%
ggplot(aes(x = Event_imagistic))+
  geom_histogram(color = "black",
                 fill = "gray",
                 bins = 15)+
 labs(x = "Event: Imagistic score", 
       y = "Frequency", 
       title = "Event: Imagistic by country")+
  facet_wrap(~Country)+
  theme_bw()

Display code
ds %>% drop_na(Event_imagistic)%>%
ggplot(aes(x = Event_imagistic,
           y = Country))+
  geom_boxplot(fill = "grey")+
  geom_textvline(label = " ", 
                 xintercept = 35.00, 
                 vjust = 1.1, 
                 lwd = 1.05, 
                 linetype = 2)+ 
  labs(x = "Event: Imagistic score", 
       y = "Frequency", 
       title = "Event: Imagistic by country")+
  #facet_wrap(~Country, nrow = 2)+
  theme_bw()

Section 3. Regression models: BBL/BCL vs group fusion/identification

Display code
## Create proper variables to use in regression models:

ds$BCL <- ds$bcl
ds$BBL <- ds$bbl
ds$Ingroup_fusion <- ds$igfusion
ds$Ingroup_identification <- ds$igidentification
ds$Outgroup_bonds <- ds$ogbonds
ds$Age <- ds$age
ds$`Gender: ` <- factor(ds$gender,
                     levels = c("Male", "Female"))
ds$`SES: ` <- factor(ds$ses,
                     levels = c("Lower middle", "Middle",
                                "Upper middle", "Upper"))
ds$Empathic_concern <- ds$empathic_concern
ds$Perspective_taking <- ds$perspective_taking
ds$Perceived_discrimination <- ds$history_discrimination
ds$OG_hostility <- ds$og_hostility
ds$OG_cooperation <- ds$og_cooperation
ds$Fight_OG <- ds$fight_outgroup

Regression models: full sample

Display code
## Two regression models predicting endorsement of BBL vs BCL:

lm01 <- lm(BBL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
           Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
           data = ds)

lm02 <- lm(BCL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
           Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
           data = ds)
Display code
stargazer(lm01, lm02, 
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
BBL BCL
(1) (2)
Ingroup_fusion 0.150* 0.110**
(0.059) (0.040)
Ingroup_identification -0.190** 0.150***
(0.063) (0.043)
Outgroup_bonds -0.140*** 0.078***
(0.031) (0.021)
Empathic_concern -0.250*** 0.030
(0.047) (0.032)
Perspective_taking 0.260*** 0.190***
(0.050) (0.035)
Perceived_discrimination -0.007 -0.033*
(0.024) (0.017)
Age 0.002 0.005*
(0.003) (0.002)
Gender:Female -0.130 -0.057
(0.091) (0.062)
SES:Middle -0.560*** 0.072
(0.100) (0.071)
SES:Upper middle -0.540*** 0.035
(0.160) (0.110)
SES:Upper -0.860* 0.630**
(0.350) (0.240)
Constant 5.400*** 2.500***
(0.450) (0.310)
Observations 1,324 1,329
R2 0.086 0.100
Adjusted R2 0.078 0.094
Residual Std. Error 1.600 (df = 1312) 1.100 (df = 1317)
F Statistic 11.000*** (df = 11; 1312) 14.000*** (df = 11; 1317)
Note: *p<0.05; **p<0.01; ***p<0.001

Regression models: individual countries

Display code
dsgmb <- ds[ds$Country=="Gambia",]
dspak <- ds[ds$Country=="Pakistan",]
dstza <- ds[ds$Country=="Tanzania",]
dsuga <- ds[ds$Country=="Uganda",]

## Eight regression models predicting endorsement of BBL vs BCL for four countries

lm_gmb_01 <- lm(BBL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `,
                data = dsgmb)

lm_gmb_02 <- lm(BCL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dsgmb)

lm_pak_01 <- lm(BBL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `,
                data = dspak)

lm_pak_02 <- lm(BCL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dspak)

lm_tza_01 <- lm(BBL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `,
                data = dstza)

lm_tza_02 <- lm(BCL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dstza)

lm_uga_01 <- lm(BBL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `,
                data = dsuga)

lm_uga_02 <- lm(BCL~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dsuga)

Gambia:

Display code
stargazer(lm_gmb_01, lm_gmb_02, 
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
BBL BCL
(1) (2)
Ingroup_fusion 0.054 0.210*
(0.160) (0.100)
Ingroup_identification 0.230 0.087
(0.170) (0.100)
Outgroup_bonds 0.260* 0.150*
(0.110) (0.063)
Empathic_concern -0.110 0.083
(0.170) (0.100)
Perspective_taking 0.150 0.180*
(0.150) (0.091)
Perceived_discrimination -0.190* 0.038
(0.095) (0.057)
Age -0.004 0.002
(0.010) (0.006)
Gender:Female 0.041 -0.024
(0.300) (0.180)
SES:Middle -0.840* 0.046
(0.340) (0.210)
SES:Upper middle -0.360 0.030
(0.430) (0.260)
SES:Upper -1.700* 0.590
(0.770) (0.480)
Constant 3.700* 1.900*
(1.400) (0.880)
Observations 163 165
R2 0.120 0.200
Adjusted R2 0.054 0.150
Residual Std. Error 1.600 (df = 151) 0.990 (df = 153)
F Statistic 1.800 (df = 11; 151) 3.600*** (df = 11; 153)
Note: *p<0.05; **p<0.01; ***p<0.001

Pakistan:

Display code
stargazer(lm_pak_01, lm_pak_02, 
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
BBL BCL
(1) (2)
Ingroup_fusion 0.110 0.200**
(0.074) (0.071)
Ingroup_identification -0.240** 0.120
(0.076) (0.074)
Outgroup_bonds 0.001 0.026
(0.043) (0.041)
Empathic_concern -0.230*** 0.043
(0.065) (0.063)
Perspective_taking 0.210** 0.110
(0.065) (0.063)
Perceived_discrimination 0.086* -0.082*
(0.035) (0.034)
Age -0.010* 0.013**
(0.005) (0.005)
Gender:Female -0.220 -0.012
(0.120) (0.110)
SES:Middle 0.230 0.470*
(0.220) (0.210)
SES:Upper middle 0.360 0.400
(0.250) (0.240)
SES:Upper 0.560 0.960*
(0.410) (0.400)
Constant 4.200*** 2.300***
(0.520) (0.500)
Observations 495 495
R2 0.110 0.120
Adjusted R2 0.093 0.100
Residual Std. Error (df = 483) 1.200 1.200
F Statistic (df = 11; 483) 5.600*** 6.200***
Note: *p<0.05; **p<0.01; ***p<0.001

Tanzania:

Display code
stargazer(lm_tza_01, lm_tza_02, 
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
BBL BCL
(1) (2)
Ingroup_fusion -0.043 0.250*
(0.120) (0.100)
Ingroup_identification -0.024 0.031
(0.120) (0.100)
Outgroup_bonds 0.043 0.160**
(0.056) (0.049)
Empathic_concern -0.044 -0.270***
(0.083) (0.074)
Perspective_taking 0.250* 0.370***
(0.110) (0.095)
Perceived_discrimination 0.047 -0.110**
(0.042) (0.037)
Age 0.009 -0.001
(0.007) (0.006)
Gender:Female -0.170 -0.066
(0.170) (0.150)
SES:Middle -0.280 0.160
(0.200) (0.180)
SES:Upper middle 0.140 0.037
(0.350) (0.300)
SES:Upper -0.530 0.900
(0.700) (0.620)
Constant 4.100*** 2.800**
(0.980) (0.870)
Observations 254 254
R2 0.054 0.190
Adjusted R2 0.011 0.160
Residual Std. Error (df = 242) 1.300 1.200
F Statistic (df = 11; 242) 1.300 5.300***
Note: *p<0.05; **p<0.01; ***p<0.001

Uganda:

Display code
stargazer(lm_uga_01, lm_uga_02, 
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
BBL BCL
(1) (2)
Ingroup_fusion 0.380** -0.040
(0.120) (0.063)
Ingroup_identification -0.490*** 0.370***
(0.130) (0.072)
Outgroup_bonds -0.250*** 0.004
(0.056) (0.031)
Empathic_concern 0.051 0.180***
(0.083) (0.045)
Perspective_taking -0.450*** 0.150**
(0.110) (0.058)
Perceived_discrimination 0.005 -0.031
(0.043) (0.024)
Age 0.001 0.001
(0.005) (0.003)
Gender:Female 0.067 -0.110
(0.160) (0.086)
SES:Middle 0.170 0.001
(0.170) (0.092)
SES:Upper middle 0.450 -0.320
(0.490) (0.270)
Constant 8.600*** 2.000***
(0.970) (0.530)
Observations 412 415
R2 0.150 0.180
Adjusted R2 0.130 0.160
Residual Std. Error 1.500 (df = 401) 0.840 (df = 404)
F Statistic 7.100*** (df = 10; 401) 8.700*** (df = 10; 404)
Note: *p<0.05; **p<0.01; ***p<0.001

Section 4. Coefficient plots for section 3

Coefficient plots: full sample

Display code
mp09 <- modelplot(lm01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Endorsement of BBL", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp10 <- modelplot(lm02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Endorsement of BCL", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp09 

Display code
mp10

Coefficient plots: individual countries

Display code
mp01 <- modelplot(lm_gmb_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "BBL: Gambia", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)


mp02 <- modelplot(lm_gmb_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "BCL: Gambia", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp03 <- modelplot(lm_pak_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "BBL: Pakistan", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)


mp04 <- modelplot(lm_pak_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "BCL: Pakistan", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp05 <- modelplot(lm_tza_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "BBL: Tanzania", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)


mp06 <- modelplot(lm_tza_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "BCL: Tanzania", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp07 <- modelplot(lm_uga_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "BBL: Uganda", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp08 <- modelplot(lm_uga_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "BCL: Uganda", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mpgam <- (mp01 / mp02)
mppak <- (mp03 / mp04)
mptza <- (mp05 / mp06)
mpuga <- (mp07 / mp08)

mpgam 

Display code
mppak 

Display code
mptza 

Display code
mpuga

Section 5. Regression models: Outgroup hostility/cooperation vs group fusion/identification

Regression models: full sample

Display code
## Three regression models predicting OG related variables:

lm01 <- lm(OG_hostility~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
           Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
           data = ds)

lm02 <- lm(OG_cooperation~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
           Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
           data = ds)

lm03 <- lm(Fight_OG~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
           Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
           data = ds)
Display code
stargazer(lm01, lm02, lm03,
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
OG_hostility OG_cooperation Fight_OG
(1) (2) (3)
Ingroup_fusion 0.091 0.019 -0.046
(0.051) (0.052) (0.061)
Ingroup_identification -0.099 0.270*** -0.120
(0.055) (0.056) (0.065)
Outgroup_bonds -0.120*** 0.470*** -0.040
(0.027) (0.027) (0.032)
Empathic_concern -0.220*** 0.210*** -0.460***
(0.041) (0.041) (0.048)
Perspective_taking -0.077 -0.130** 0.094
(0.044) (0.045) (0.053)
Perceived_discrimination 0.480*** -0.160*** 0.310***
(0.021) (0.021) (0.025)
Age -0.002 -0.002 0.002
(0.003) (0.003) (0.003)
Gender:Female -0.004 0.019 -0.160
(0.079) (0.081) (0.094)
SES:Middle 0.350*** -0.029 0.190
(0.090) (0.092) (0.110)
SES:Upper middle 0.400** 0.019 0.540***
(0.140) (0.140) (0.160)
SES:Upper 0.260 -0.220 0.240
(0.300) (0.310) (0.360)
Constant 3.300*** 2.100*** 4.400***
(0.390) (0.400) (0.470)
Observations 1,330 1,338 1,337
R2 0.350 0.240 0.200
Adjusted R2 0.340 0.230 0.200
Residual Std. Error 1.400 (df = 1318) 1.400 (df = 1326) 1.700 (df = 1325)
F Statistic 64.000*** (df = 11; 1318) 38.000*** (df = 11; 1326) 31.000*** (df = 11; 1325)
Note: *p<0.05; **p<0.01; ***p<0.001

Regression models: individual countries

Display code
## Twelve regression models predicting endorsement of BBL vs BCL for four countries

lm_gmb_01 <- lm(OG_hostility~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dsgmb)

lm_gmb_02 <- lm(OG_cooperation~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dsgmb)

lm_gmb_03 <- lm(Fight_OG~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dsgmb)

lm_pak_01 <- lm(OG_hostility~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dspak)

lm_pak_02 <- lm(OG_cooperation~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dspak)

lm_pak_03 <- lm(Fight_OG~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dspak)

lm_tza_01 <- lm(OG_hostility~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dstza)

lm_tza_02 <- lm(OG_cooperation~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dstza)

lm_tza_03 <- lm(Fight_OG~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dstza)

lm_uga_01 <- lm(OG_hostility~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dsuga)

lm_uga_02 <- lm(OG_cooperation~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dsuga)

lm_uga_03 <- lm(Fight_OG~Ingroup_fusion+Ingroup_identification+Outgroup_bonds+Empathic_concern+
                Perspective_taking+Perceived_discrimination+Age+`Gender: `+`SES: `, 
                data = dsuga)

Gambia:

Display code
stargazer(lm_gmb_01, lm_gmb_02, lm_gmb_03, 
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
OG_hostility OG_cooperation Fight_OG
(1) (2) (3)
Ingroup_fusion -0.009 -0.025 0.110
(0.150) (0.084) (0.180)
Ingroup_identification -0.022 0.100 -0.011
(0.150) (0.087) (0.180)
Outgroup_bonds 0.045 0.072 -0.031
(0.093) (0.052) (0.110)
Empathic_concern -0.120 0.089 0.056
(0.150) (0.086) (0.180)
Perspective_taking 0.200 -0.082 0.110
(0.130) (0.075) (0.160)
Perceived_discrimination -0.180* 0.130** -0.140
(0.083) (0.047) (0.099)
Age 0.005 0.007 0.018
(0.009) (0.005) (0.011)
Gender:Female -0.210 -0.410** -0.070
(0.270) (0.150) (0.330)
SES:Middle -0.360 -0.230 -0.360
(0.310) (0.180) (0.370)
SES:Upper middle 0.100 -0.081 -0.210
(0.390) (0.220) (0.460)
SES:Upper -0.400 -0.610 -1.800*
(0.710) (0.400) (0.840)
Constant 3.900** 2.200** 2.700
(1.300) (0.730) (1.600)
Observations 164 164 164
R2 0.062 0.190 0.061
Adjusted R2 -0.006 0.130 -0.007
Residual Std. Error (df = 152) 1.500 0.820 1.700
F Statistic (df = 11; 152) 0.910 3.300*** 0.900
Note: *p<0.05; **p<0.01; ***p<0.001

Pakistan:

Display code
stargazer(lm_pak_01, lm_pak_02, lm_pak_03,
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
OG_hostility OG_cooperation Fight_OG
(1) (2) (3)
Ingroup_fusion 0.150 -0.006 0.038
(0.078) (0.076) (0.085)
Ingroup_identification -0.130 0.390*** -0.260**
(0.081) (0.079) (0.088)
Outgroup_bonds -0.190*** 0.270*** 0.078
(0.045) (0.044) (0.049)
Empathic_concern -0.059 0.160* -0.460***
(0.069) (0.067) (0.075)
Perspective_taking -0.068 -0.170* 0.008
(0.069) (0.068) (0.076)
Perceived_discrimination 0.520*** -0.180*** 0.130**
(0.037) (0.036) (0.040)
Age -0.001 0.0003 -0.0002
(0.005) (0.005) (0.006)
Gender:Female 0.044 -0.350** 0.021
(0.120) (0.120) (0.130)
SES:Middle -0.110 -0.046 -0.059
(0.230) (0.230) (0.250)
SES:Upper middle -0.250 0.200 -0.026
(0.260) (0.260) (0.290)
SES:Upper 0.013 0.520 0.220
(0.430) (0.420) (0.480)
Constant 2.700*** 3.200*** 5.300***
(0.550) (0.530) (0.600)
Observations 495 495 495
R2 0.350 0.220 0.160
Adjusted R2 0.330 0.200 0.140
Residual Std. Error (df = 483) 1.300 1.300 1.400
F Statistic (df = 11; 483) 23.000*** 13.000*** 8.100***
Note: *p<0.05; **p<0.01; ***p<0.001

Tanzania:

Display code
stargazer(lm_tza_01, lm_tza_02, lm_tza_03,
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
OG_hostility OG_cooperation Fight_OG
(1) (2) (3)
Ingroup_fusion -0.130 0.290* 0.018
(0.120) (0.120) (0.150)
Ingroup_identification -0.110 0.071 -0.069
(0.120) (0.120) (0.150)
Outgroup_bonds 0.033 0.440*** 0.140*
(0.057) (0.056) (0.071)
Empathic_concern -0.340*** 0.026 -0.420***
(0.085) (0.084) (0.110)
Perspective_taking -0.068 0.083 -0.330*
(0.110) (0.110) (0.140)
Perceived_discrimination 0.570*** -0.110** 0.550***
(0.043) (0.042) (0.053)
Age 0.005 -0.003 0.001
(0.007) (0.007) (0.009)
Gender:Female 0.016 0.072 -0.120
(0.170) (0.170) (0.220)
SES:Middle 0.180 -0.400* -0.005
(0.200) (0.200) (0.250)
SES:Upper middle 0.270 -0.550 0.560
(0.350) (0.340) (0.430)
SES:Upper 0.330 -1.900** 0.480
(0.720) (0.710) (0.900)
Constant 4.800*** 2.000* 5.400***
(1.000) (0.990) (1.300)
Observations 259 261 262
R2 0.550 0.250 0.460
Adjusted R2 0.530 0.220 0.440
Residual Std. Error 1.400 (df = 247) 1.400 (df = 249) 1.700 (df = 250)
F Statistic 27.000*** (df = 11; 247) 7.700*** (df = 11; 249) 20.000*** (df = 11; 250)
Note: *p<0.05; **p<0.01; ***p<0.001

Uganda:

Display code
stargazer(lm_uga_01, lm_uga_02, lm_uga_03,
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
OG_hostility OG_cooperation Fight_OG
(1) (2) (3)
Ingroup_fusion 0.019 -0.290** -0.004
(0.097) (0.110) (0.099)
Ingroup_identification 0.036 0.360** -0.039
(0.110) (0.120) (0.110)
Outgroup_bonds -0.260*** 0.540*** -0.150**
(0.046) (0.053) (0.048)
Empathic_concern -0.150* 0.400*** -0.280***
(0.068) (0.077) (0.070)
Perspective_taking 0.074 0.200* 0.490***
(0.088) (0.100) (0.092)
Perceived_discrimination 0.510*** -0.093* 0.370***
(0.035) (0.041) (0.037)
Age -0.0004 -0.002 0.00000
(0.004) (0.005) (0.004)
Gender:Female -0.120 0.180 -0.180
(0.130) (0.150) (0.130)
SES:Middle 0.230 -0.046 0.170
(0.140) (0.160) (0.140)
SES:Upper middle 0.760 -0.530 1.100*
(0.420) (0.460) (0.420)
Constant 1.800* -0.230 0.240
(0.790) (0.910) (0.830)
Observations 412 418 416
R2 0.460 0.360 0.340
Adjusted R2 0.450 0.350 0.330
Residual Std. Error 1.300 (df = 401) 1.500 (df = 407) 1.300 (df = 405)
F Statistic 34.000*** (df = 10; 401) 23.000*** (df = 10; 407) 21.000*** (df = 10; 405)
Note: *p<0.05; **p<0.01; ***p<0.001

Section 6. Coefficient plots for section 5

Coefficient plots: full sample

Display code
mp09 <- modelplot(lm01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup hostility", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp10 <- modelplot(lm02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup cooperation", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)


mp11a <- modelplot(lm03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Fight outgroup", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp09 

Display code
mp10

Display code
mp11a

Coefficient plots: individual countries

Display code
mp11 <- modelplot(lm_gmb_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup hostility: Gambia", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp12 <- modelplot(lm_gmb_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup cooperation: Gambia", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp13 <- modelplot(lm_gmb_03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Fight outgroup: Gambia", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)


mp21 <- modelplot(lm_pak_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup hostility: Pakistan", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp22<- modelplot(lm_pak_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup cooperation: Pakistan", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp23 <- modelplot(lm_pak_03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Fight outgroup: Pakistan", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)


mp31 <- modelplot(lm_tza_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup hostility: Tanzania", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp32<- modelplot(lm_tza_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup cooperation: Tanzania", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp33 <- modelplot(lm_tza_03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Fight outgroup: Tanzania", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp41 <- modelplot(lm_uga_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup hostility: Uganda", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp42<- modelplot(lm_uga_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup cooperation: Uganda", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp43 <- modelplot(lm_uga_03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Fight outgroup: Uganda", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

Gambia:

Display code
mp11 

Display code
mp12 

Display code
mp13

Pakistan:

Display code
mp21 

Display code
mp22

Display code
mp23

Tanzania:

Display code
mp31

Display code
mp32

Display code
mp33

Uganda:

Display code
mp41

Display code
mp42

Display code
mp43

Section 7. Regression models: Group fusion/identification vs imagistic items

Regression models: full sample

Display code
## Three regression models predicting IG fusion/identification and OG bonds:

lm01 <- lm(Ingroup_fusion~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
           data = ds)

lm02 <- lm(Ingroup_identification~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
           data = ds)

lm03 <- lm(Outgroup_bonds~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
           data = ds)
Display code
stargazer(lm01, lm02, lm03,
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
Ingroup_fusion Ingroup_identification Outgroup_bonds
(1) (2) (3)
Event_positive_affect -0.011 -0.034* 0.020
(0.014) (0.013) (0.023)
Event_negative_affect -0.007 -0.017 0.090***
(0.014) (0.013) (0.023)
Event_episodic_recall 0.180*** 0.180*** -0.170***
(0.026) (0.025) (0.042)
Event_shared_perception 0.039 0.084*** -0.047
(0.021) (0.020) (0.035)
Event_reflection 0.040* -0.022 0.053
(0.020) (0.019) (0.034)
Event_transformative_indiv 0.047* 0.099*** 0.069*
(0.021) (0.020) (0.035)
Event_transformative_group 0.052* -0.012 0.094**
(0.020) (0.019) (0.033)
Age 0.005** 0.004* -0.005
(0.002) (0.002) (0.003)
Gender:Female 0.048 0.021 -0.024
(0.049) (0.047) (0.081)
SES:Middle -0.170** -0.094 0.470***
(0.057) (0.054) (0.093)
SES:Upper middle -0.240** -0.300*** 0.160
(0.085) (0.081) (0.140)
SES:Upper -0.130 -0.250 0.310
(0.200) (0.180) (0.310)
Constant 4.100*** 4.300*** 2.900***
(0.190) (0.180) (0.310)
Observations 1,388 1,385 1,342
R2 0.150 0.140 0.066
Adjusted R2 0.150 0.140 0.057
Residual Std. Error 0.900 (df = 1375) 0.860 (df = 1372) 1.500 (df = 1329)
F Statistic 21.000*** (df = 12; 1375) 19.000*** (df = 12; 1372) 7.800*** (df = 12; 1329)
Note: *p<0.05; **p<0.01; ***p<0.001

Regression models: individual countries

Display code
## Twelve regression models predicting endorsement of BBL vs BCL for four countries

lm_gmb_01 <- lm(Ingroup_fusion~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dsgmb)

lm_gmb_02 <- lm(Ingroup_identification~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dsgmb)

lm_gmb_03 <- lm(Outgroup_bonds~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dsgmb)

lm_pak_01 <- lm(Ingroup_fusion~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dspak)

lm_pak_02 <- lm(Ingroup_identification~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dspak)

lm_pak_03 <- lm(Outgroup_bonds~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dspak)

lm_tza_01 <- lm(Ingroup_fusion~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dstza)

lm_tza_02 <- lm(Ingroup_identification~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dstza)

lm_tza_03 <- lm(Outgroup_bonds~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dstza)

lm_uga_01 <- lm(Ingroup_fusion~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dsuga)

lm_uga_02 <- lm(Ingroup_identification~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dsuga)

lm_uga_03 <- lm(Outgroup_bonds~Event_positive_affect+Event_negative_affect+Event_episodic_recall+
             Event_shared_perception+Event_reflection+Event_transformative_indiv+
             Event_transformative_group+Age+`Gender: `+`SES: `, 
             data = dsuga)

Gambia:

Display code
stargazer(lm_gmb_01, lm_gmb_02, lm_gmb_03, 
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
Ingroup_fusion Ingroup_identification Outgroup_bonds
(1) (2) (3)
Event_positive_affect 0.030 0.100** 0.037
(0.039) (0.037) (0.062)
Event_negative_affect 0.068 0.078 0.093
(0.046) (0.044) (0.073)
Event_episodic_recall 0.150 0.130 -0.320**
(0.077) (0.073) (0.120)
Event_shared_perception 0.065 0.140 0.047
(0.081) (0.079) (0.130)
Event_reflection 0.017 -0.027 0.250**
(0.048) (0.046) (0.080)
Event_transformative_indiv 0.084 0.110* -0.120
(0.055) (0.052) (0.090)
Event_transformative_group 0.023 -0.097 0.046
(0.065) (0.063) (0.110)
Age -0.001 -0.009 -0.001
(0.006) (0.005) (0.009)
Gender:Female 0.039 -0.085 -0.620*
(0.160) (0.150) (0.260)
SES:Middle -0.260 0.026 -0.010
(0.190) (0.180) (0.310)
SES:Upper middle -0.160 -0.100 -0.650
(0.230) (0.220) (0.370)
SES:Upper 0.710 0.840* -0.270
(0.420) (0.410) (0.680)
Constant 3.900*** 4.100*** 3.400***
(0.510) (0.490) (0.820)
Observations 170 175 166
R2 0.190 0.210 0.220
Adjusted R2 0.130 0.150 0.160
Residual Std. Error 0.870 (df = 157) 0.850 (df = 162) 1.400 (df = 153)
F Statistic 3.000*** (df = 12; 157) 3.500*** (df = 12; 162) 3.600*** (df = 12; 153)
Note: *p<0.05; **p<0.01; ***p<0.001

Pakistan:

Display code
stargazer(lm_pak_01, lm_pak_02, lm_pak_03,
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
Ingroup_fusion Ingroup_identification Outgroup_bonds
(1) (2) (3)
Event_positive_affect 0.045 0.003 0.074
(0.038) (0.035) (0.049)
Event_negative_affect 0.032 0.030 0.069
(0.038) (0.036) (0.050)
Event_episodic_recall 0.130** 0.160*** -0.150*
(0.046) (0.045) (0.061)
Event_shared_perception 0.053 0.070 -0.062
(0.046) (0.043) (0.060)
Event_reflection 0.069 -0.018 -0.016
(0.041) (0.039) (0.054)
Event_transformative_indiv 0.048 0.120** 0.100
(0.047) (0.044) (0.062)
Event_transformative_group 0.130** 0.067 0.160**
(0.042) (0.040) (0.056)
Age 0.014*** 0.017*** -0.006
(0.004) (0.004) (0.005)
Gender:Female 0.120 0.086 -0.140
(0.092) (0.087) (0.120)
SES:Middle -0.730*** -0.510** 0.750***
(0.170) (0.160) (0.220)
SES:Upper middle -0.810*** -0.690*** 0.670**
(0.190) (0.180) (0.250)
SES:Upper -1.100*** -1.100*** 0.760
(0.320) (0.300) (0.410)
Constant 3.600*** 3.500*** 2.600***
(0.390) (0.370) (0.510)
Observations 499 498 498
R2 0.230 0.230 0.077
Adjusted R2 0.210 0.220 0.054
Residual Std. Error 1.000 (df = 486) 0.960 (df = 485) 1.300 (df = 485)
F Statistic 12.000*** (df = 12; 486) 12.000*** (df = 12; 485) 3.400*** (df = 12; 485)
Note: *p<0.05; **p<0.01; ***p<0.001

Tanzania:

Display code
stargazer(lm_tza_01, lm_tza_02, lm_tza_03,
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
Ingroup_fusion Ingroup_identification Outgroup_bonds
(1) (2) (3)
Event_positive_affect -0.038 -0.092*** 0.210***
(0.025) (0.024) (0.048)
Event_negative_affect 0.001 -0.056* 0.270***
(0.026) (0.025) (0.050)
Event_episodic_recall 0.130** 0.120* -0.170
(0.048) (0.046) (0.090)
Event_shared_perception -0.014 -0.001 -0.033
(0.039) (0.038) (0.074)
Event_reflection 0.005 -0.028 0.110
(0.038) (0.037) (0.076)
Event_transformative_indiv 0.033 0.042 0.012
(0.040) (0.039) (0.078)
Event_transformative_group -0.021 -0.063 0.073
(0.035) (0.034) (0.068)
Age 0.011** 0.001 0.002
(0.004) (0.004) (0.008)
Gender:Female 0.066 0.062 0.190
(0.100) (0.098) (0.200)
SES:Middle -0.100 0.014 0.400
(0.120) (0.120) (0.240)
SES:Upper middle -0.082 -0.031 0.330
(0.210) (0.200) (0.400)
SES:Upper -0.300 0.660 -0.800
(0.500) (0.490) (0.930)
Constant 5.200*** 6.200*** 1.000
(0.390) (0.380) (0.760)
Observations 280 280 255
R2 0.100 0.150 0.220
Adjusted R2 0.060 0.110 0.180
Residual Std. Error 0.840 (df = 267) 0.810 (df = 267) 1.600 (df = 242)
F Statistic 2.500** (df = 12; 267) 3.900*** (df = 12; 267) 5.600*** (df = 12; 242)
Note: *p<0.05; **p<0.01; ***p<0.001

Uganda:

Display code
stargazer(lm_uga_01, lm_uga_02, lm_uga_03,
          type = "html", 
          star.cutoffs = c(0.05, 0.01, 0.001),
          out = "table1.html",
          notes = starpattern, 
          notes.append = F)
Dependent variable:
Ingroup_fusion Ingroup_identification Outgroup_bonds
(1) (2) (3)
Event_positive_affect 0.025 -0.015 -0.120**
(0.023) (0.021) (0.045)
Event_negative_affect -0.015 -0.008 -0.058
(0.019) (0.017) (0.037)
Event_episodic_recall 0.290*** 0.190*** 0.190
(0.058) (0.052) (0.110)
Event_shared_perception 0.017 0.089** -0.017
(0.033) (0.030) (0.064)
Event_reflection 0.093 0.002 -0.036
(0.048) (0.043) (0.095)
Event_transformative_indiv 0.035 0.100** 0.120
(0.038) (0.034) (0.073)
Event_transformative_group 0.071* 0.017 -0.021
(0.034) (0.031) (0.066)
Age -0.002 -0.002 -0.003
(0.002) (0.002) (0.004)
Gender:Female 0.076 0.038 0.110
(0.071) (0.064) (0.140)
SES:Middle -0.087 0.017 0.100
(0.080) (0.072) (0.150)
SES:Upper middle -0.130 -0.140 -0.710
(0.200) (0.200) (0.400)
Constant 3.100*** 4.000*** 2.400**
(0.420) (0.380) (0.800)
Observations 439 432 423
R2 0.170 0.160 0.052
Adjusted R2 0.150 0.140 0.027
Residual Std. Error 0.730 (df = 427) 0.660 (df = 420) 1.400 (df = 411)
F Statistic 8.000*** (df = 11; 427) 7.300*** (df = 11; 420) 2.100* (df = 11; 411)
Note: *p<0.05; **p<0.01; ***p<0.001

Section 8. Coefficient plots for section 7

Coefficient plots: full sample

Display code
mp09 <- modelplot(lm01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup fusion", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp10 <- modelplot(lm02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup identification", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp11a <- modelplot(lm03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup bonds", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp09 

Display code
mp10

Display code
mp11a

Coefficient plots: individual countries

Display code
mp11 <- modelplot(lm_gmb_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup fusion: Gambia", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp12 <- modelplot(lm_gmb_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup identification: Gambia", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp13 <- modelplot(lm_gmb_03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup bonds: Gambia", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)


mp21 <- modelplot(lm_pak_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup fusion: Pakistan", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp22<- modelplot(lm_pak_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup identification: Pakistan", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp23 <- modelplot(lm_pak_03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup bonds: Pakistan", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)


mp31 <- modelplot(lm_tza_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup fusion: Tanzania", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp32<- modelplot(lm_tza_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup identification: Tanzania", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp33 <- modelplot(lm_tza_03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup bonds: Tanzania", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp41 <- modelplot(lm_uga_01, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup fusion: Uganda", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp42<- modelplot(lm_uga_02, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Ingroup identification: Uganda", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

mp43 <- modelplot(lm_uga_03, 
          coef_rename = TRUE,
          coef_omit = 'Interc') +
  aes(color = ifelse(p.value < 0.05, "Significant", "Not significant")) +
  scale_color_manual(values = c("red", "blue"))+
  labs(title = "Outgroup bonds: Uganda", 
       x = "OLS coefficients with 95% CI")+
  geom_vline(xintercept = 0, 
             linetype = 2)

Gambia:

Display code
mp11 

Display code
mp12 

Display code
mp13

Pakistan:

Display code
mp21 

Display code
mp22

Display code
mp23

Tanzania:

Display code
mp31

Display code
mp32

Display code
mp33

Uganda:

Display code
mp41

Display code
mp42

Display code
mp43