Also called “varying intercept model with no predictors” (Gelman and Hill, 2016, Chapter 12). Allows intercepts to randomly vary across countries:
Display code
## Varying intercept model with no predictors:m00<-lmer(Endorse_BCL ~1+ (1| Country), data = ds)summary(m00)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: Endorse_BCL ~ 1 + (1 | Country)
Data: ds
REML criterion at convergence: 12523
Scaled residuals:
Min 1Q Median 3Q Max
-2.911 -0.565 0.256 0.715 1.686
Random effects:
Groups Name Variance Std.Dev.
Country (Intercept) 0.196 0.443
Residual 2.442 1.563
Number of obs: 3349, groups: Country, 9
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 5.035 0.153 8.071 33 0.00000000068 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Random effects:
Variance for Intercept = 0.196. This is the variance of the means across level 1 categories (countries).
Display code
tab_model(m00)
Endorse_BCL
Predictors
Estimates
CI
p
(Intercept)
5.04
4.74 – 5.33
<0.001
Random Effects
σ2
2.44
τ00Country
0.20
ICC
0.07
N Country
9
Observations
3349
Marginal R2 / Conditional R2
0.000 / 0.074
We can see that ICC = 0.07. Lower ICC = low variance explained across groups. In this case, most of the variability is at individual-level (not group level). There is very little differing patterns between countries.
Random intercept model
Also called “varying intercept model with individual-level predictors” (Gelman and Hill, 2016, Chapter 12).
Display code
## Varying intercept models with individual-level predictors:m01 <-lmer(Endorse_BCL~IG_fusion+IG_identification+OG_bonds+Empathic_concern+ Perspective_taking+Age+Female+Married+Wealth_level+ (1| Country), data = ds)summary(m01)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula:
Endorse_BCL ~ IG_fusion + IG_identification + OG_bonds + Empathic_concern +
Perspective_taking + Age + Female + Married + Wealth_level +
(1 | Country)
Data: ds
REML criterion at convergence: 8154
Scaled residuals:
Min 1Q Median 3Q Max
-3.996 -0.538 0.123 0.654 3.798
Random effects:
Groups Name Variance Std.Dev.
Country (Intercept) 0.0326 0.181
Residual 1.4478 1.203
Number of obs: 2523, groups: Country, 8
Fixed effects:
Estimate Std. Error df t value
(Intercept) 1.109929 0.187006 250.177358 5.94
IG_fusion 0.109494 0.030774 2511.738528 3.56
IG_identification 0.367759 0.030388 2512.387934 12.10
OG_bonds 0.024270 0.014670 2509.199425 1.65
Empathic_concern 0.009422 0.027499 2438.639161 0.34
Perspective_taking 0.247633 0.029740 2443.966919 8.33
Age 0.000364 0.002243 2512.793510 0.16
Female 0.001309 0.049590 2506.138158 0.03
Married 0.007210 0.055315 2509.822416 0.13
Wealth_level 0.077174 0.031997 2412.283088 2.41
Pr(>|t|)
(Intercept) 0.0000000097 ***
IG_fusion 0.00038 ***
IG_identification < 0.0000000000000002 ***
OG_bonds 0.09816 .
Empathic_concern 0.73189
Perspective_taking < 0.0000000000000002 ***
Age 0.87119
Female 0.97895
Married 0.89630
Wealth_level 0.01594 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) IG_fsn IG_dnt OG_bnd Empth_ Prspc_ Age Female Marrid
IG_fusion -0.027
IG_idntfctn -0.063 -0.825
OG_bonds -0.236 -0.075 0.117
Empthc_cncr -0.338 -0.015 -0.076 0.028
Prspctv_tkn -0.263 -0.124 -0.091 -0.085 -0.398
Age -0.263 -0.026 0.028 0.033 -0.045 -0.078
Female -0.093 -0.026 0.008 0.051 -0.053 -0.005 0.069
Married 0.097 -0.009 0.014 -0.053 -0.066 -0.017 -0.422 0.007
Wealth_levl -0.489 0.052 -0.052 -0.042 0.132 0.043 0.032 0.018 0.003
Display code
tab_model(m01)
Endorse_BCL
Predictors
Estimates
CI
p
(Intercept)
1.11
0.74 – 1.48
<0.001
IG fusion
0.11
0.05 – 0.17
<0.001
IG identification
0.37
0.31 – 0.43
<0.001
OG bonds
0.02
-0.00 – 0.05
0.098
Empathic concern
0.01
-0.04 – 0.06
0.732
Perspective taking
0.25
0.19 – 0.31
<0.001
Age
0.00
-0.00 – 0.00
0.871
Female
0.00
-0.10 – 0.10
0.979
Married
0.01
-0.10 – 0.12
0.896
Wealth level
0.08
0.01 – 0.14
0.016
Random Effects
σ2
1.45
τ00Country
0.03
ICC
0.02
N Country
8
Observations
2523
Marginal R2 / Conditional R2
0.363 / 0.377
Here, marginal R2 is much higher compared to previous model. Adding individual-level predictors significantly increases explanatory power of the model. Again, evidence that most of the variation is at individual-level differences.
Display code
## Change class of all models so we can use stargazer():class(m00) <-"lmerMod"class(m01) <-"lmerMod"## Tabulated results:stargazer(m00, m01,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")
Display code
htmltools::includeHTML("table1.html")
Dependent variable:
Endorse_BCL
(1)
(2)
IG_fusion
0.110***
(0.031)
IG_identification
0.370***
(0.030)
OG_bonds
0.024
(0.015)
Empathic_concern
0.009
(0.027)
Perspective_taking
0.250***
(0.030)
Age
0.0004
(0.002)
Female
0.001
(0.050)
Married
0.007
(0.055)
Wealth_level
0.077*
(0.032)
Constant
5.000***
1.100***
(0.150)
(0.190)
Observations
3,349
2,523
Log Likelihood
-6,262.000
-4,077.000
Akaike Inf. Crit.
12,529.000
8,178.000
Bayesian Inf. Crit.
12,547.000
8,248.000
Note:
*p<0.05; **p<0.01; ***p<0.001
Histogram: Endorsement of BCL
Display code
summary(df01$Endorse_BCL)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.0 4.3 5.7 5.1 6.3 7.0
## Varying intercept model with no predictors:m02<-lmer(Endorse_BBL ~1+ (1| Country), data = ds)summary(m02)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: Endorse_BBL ~ 1 + (1 | Country)
Data: ds
REML criterion at convergence: 13200
Scaled residuals:
Min 1Q Median 3Q Max
-2.431 -0.596 0.185 0.763 1.792
Random effects:
Groups Name Variance Std.Dev.
Country (Intercept) 0.203 0.451
Residual 2.990 1.729
Number of obs: 3349, groups: Country, 9
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 4.762 0.156 8.419 30.5 0.00000000065 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Display code
tab_model(m02)
Endorse_BBL
Predictors
Estimates
CI
p
(Intercept)
4.76
4.46 – 5.07
<0.001
Random Effects
σ2
2.99
τ00Country
0.20
ICC
0.06
N Country
9
Observations
3349
Marginal R2 / Conditional R2
0.000 / 0.064
Random intercept model
Display code
## Varying intercept models with individual-level predictors:m03 <-lmer(Endorse_BBL~IG_fusion+IG_identification+OG_bonds+Empathic_concern+ Perspective_taking+Age+Female+Married+Wealth_level+ (1| Country), data = ds)summary(m03)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula:
Endorse_BBL ~ IG_fusion + IG_identification + OG_bonds + Empathic_concern +
Perspective_taking + Age + Female + Married + Wealth_level +
(1 | Country)
Data: ds
REML criterion at convergence: 9325
Scaled residuals:
Min 1Q Median 3Q Max
-3.671 -0.641 0.149 0.709 3.197
Random effects:
Groups Name Variance Std.Dev.
Country (Intercept) 0.131 0.362
Residual 2.312 1.520
Number of obs: 2520, groups: Country, 8
Fixed effects:
Estimate Std. Error df t value
(Intercept) 3.85805 0.25710 96.47321 15.01
IG_fusion 0.16349 0.03880 2506.98545 4.21
IG_identification 0.34222 0.03827 2507.83053 8.94
OG_bonds -0.06075 0.01858 2509.71894 -3.27
Empathic_concern -0.40816 0.03492 2501.53359 -11.69
Perspective_taking 0.06444 0.03773 2504.31918 1.71
Age -0.00697 0.00283 2508.03488 -2.46
Female -0.07487 0.06277 2509.99094 -1.19
Married -0.15589 0.06999 2509.62182 -2.23
Wealth_level 0.14831 0.04058 2502.90911 3.65
Pr(>|t|)
(Intercept) < 0.0000000000000002 ***
IG_fusion 0.000026 ***
IG_identification < 0.0000000000000002 ***
OG_bonds 0.00109 **
Empathic_concern < 0.0000000000000002 ***
Perspective_taking 0.08782 .
Age 0.01389 *
Female 0.23308
Married 0.02603 *
Wealth_level 0.00026 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) IG_fsn IG_dnt OG_bnd Empth_ Prspc_ Age Female Marrid
IG_fusion -0.021
IG_idntfctn -0.057 -0.825
OG_bonds -0.211 -0.074 0.114
Empthc_cncr -0.317 -0.016 -0.077 0.025
Prspctv_tkn -0.249 -0.126 -0.089 -0.087 -0.389
Age -0.241 -0.031 0.032 0.031 -0.045 -0.074
Female -0.082 -0.030 0.014 0.047 -0.058 -0.002 0.066
Married 0.083 -0.004 0.008 -0.049 -0.058 -0.018 -0.421 0.010
Wealth_levl -0.449 0.051 -0.053 -0.040 0.134 0.044 0.026 0.012 0.009
Display code
tab_model(m03)
Endorse_BBL
Predictors
Estimates
CI
p
(Intercept)
3.86
3.35 – 4.36
<0.001
IG fusion
0.16
0.09 – 0.24
<0.001
IG identification
0.34
0.27 – 0.42
<0.001
OG bonds
-0.06
-0.10 – -0.02
0.001
Empathic concern
-0.41
-0.48 – -0.34
<0.001
Perspective taking
0.06
-0.01 – 0.14
0.088
Age
-0.01
-0.01 – -0.00
0.014
Female
-0.07
-0.20 – 0.05
0.233
Married
-0.16
-0.29 – -0.02
0.026
Wealth level
0.15
0.07 – 0.23
<0.001
Random Effects
σ2
2.31
τ00Country
0.13
ICC
0.05
N Country
8
Observations
2520
Marginal R2 / Conditional R2
0.206 / 0.249
Display code
## Change class of all models so we can use stargazer():class(m02) <-"lmerMod"class(m03) <-"lmerMod"## Tabulated results:stargazer(m02, m03,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")
Display code
htmltools::includeHTML("table1.html")
Dependent variable:
Endorse_BBL
(1)
(2)
IG_fusion
0.160***
(0.039)
IG_identification
0.340***
(0.038)
OG_bonds
-0.061**
(0.019)
Empathic_concern
-0.410***
(0.035)
Perspective_taking
0.064
(0.038)
Age
-0.007*
(0.003)
Female
-0.075
(0.063)
Married
-0.160*
(0.070)
Wealth_level
0.150***
(0.041)
Constant
4.800***
3.900***
(0.160)
(0.260)
Observations
3,349
2,520
Log Likelihood
-6,600.000
-4,662.000
Akaike Inf. Crit.
13,206.000
9,349.000
Bayesian Inf. Crit.
13,224.000
9,419.000
Note:
*p<0.05; **p<0.01; ***p<0.001
Histogram: Endorsement of BBL
Display code
summary(df01$Endorse_BBL)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.0 3.3 5.0 4.7 6.0 7.0
## Change class of all models so we can use stargazer():class(m04) <-"lmerMod"class(m05) <-"lmerMod"## Tabulated results:stargazer(m04, m05,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")
## Change class of all models so we can use stargazer():class(m06) <-"lmerMod"class(m07) <-"lmerMod"## Tabulated results:stargazer(m06, m07,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")
## Change class of all models so we can use stargazer():class(m08) <-"lmerMod"class(m09) <-"lmerMod"## Tabulated results:stargazer(m08, m09,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")
Some countries/datasets have more variables than others. This makes it difficult to estimate all explanatory variables of interest (eg - perceived discrimination, negative/positive contact/etc)
No group-level predictors in the data. For eg: country-level variables that might explain the variation in DVs. Eg: country-level trust/religiosity scores, GDP, HDI, etc. Multi-level modeling is more informative if there are theoretically relevant group-level predictors.
Other DV/IV combinations
Other comments/suggestions?
Source Code
---title: "Full Dataset (8 + 4 Countries) <br> Multi-level Modeling"author: Gagan Atreyadate: todayformat: html: toc: true toc-location: left toc-depth: 4 theme: lumen fontsize: large code-fold: true code-tools: true code-summary: "Display code" code-overflow: wrapeditor: markdown: wrap: 72---```{r, error = F, message = F, warning = F}rm(list=ls())options(digits =2)## 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, gt, lme4, car, lmerTest, ggeffects, magrittr, broom, broom.mixed, backports, effects, interactions, plyr, sjPlot, modelsummary, patchwork)## Import latest BCL (8 countries) dataset:ds01 <-fread("~/Desktop/oxford/data/BCL/BCL02.csv")ds01 <-as.data.table(ds01)## Import latest Combined (4 countries) dataset:ds02 <-fread("~/Desktop/oxford/data/cleanedds/combinedds.csv")ds02 <-as.data.table(ds02)## List of variables needed from both datasets:list1 <-c("ID", "Country", "Endorse_BCL", "Endorse_BBL","IG_fusion", "IG_identification", "OG_bonds","Empathic_concern", "Perspective_taking", "Perceived_discrimination", "OG_hostility", "OG_cooperation", "Fight_OG","Age", "Female", "Married", "Wealth_level", "Event_positive_affect", "Event_negative_affect", "Event_episodic_recall", "Event_shared_perception", "Event_reflection", "Event_transformative_indiv", "Event_transformative_group")## Variable: IDds01$counter <-1:nrow(ds01)ds01$country2 <-ifelse(ds01$Country =="Bangladesh", "BAN",ifelse(ds01$Country =="Ghana", "GHA",ifelse(ds01$Country =="Malawi", "MWI",ifelse(ds01$Country =="Pakistan", "PAK01",ifelse(ds01$Country =="Sierra Leone", "SLE",ifelse(ds01$Country =="Tanzania", "TZA01",ifelse(ds01$Country =="Uganda", "UGA01",ifelse(ds01$Country =="USA", "USA", NA))))))))ds01$ID <-paste0(ds01$country2,ds01$counter)## Variable: Countryds01$Country <- ds01$Countryds02$Country <- ds02$Country## Variable: Endorse_BCLds01$Endorse_BCL <- ds01$Endorse_BCLds02$Endorse_BCL <- ds02$BCL## Variable: Endorse_BBLds01$Endorse_BBL <- ds01$Endorse_BBLds02$Endorse_BBL <- ds02$BBL## Variable: IG_fusionds01$IG_fusion <- ds01$IG_Fusionds02$IG_fusion <- ds02$Ingroup_fusion## Variable: IG_identificationds01$IG_identification <- ds01$IG_Identificationds02$IG_identification <- ds02$Ingroup_identification## Variable: OG_bondsds01$OG_bonds <- ds01$OG_Bondsds02$OG_bonds <- ds02$Outgroup_bonds## Variable: Empathic_concernds01$Empathic_concern <- ds01$Empathic_concernds02$Empathic_concern <- ds02$Empathic_concern## Variable: Perspective_takingds01$Perspective_taking <- ds01$Perspective_takingds02$Perspective_taking <- ds02$Perspective_taking## Variable: Perceived_discrimination: ## Only available in ds02 (4 country combined dataset):ds01$Perceived_discrimination <-NAds02$Perceived_discrimination <- ds02$Perceived_discrimination## Variable: OG_hostility: ## Only available in ds02 (4 country combined dataset):ds01$OG_hostility <-NAds02$OG_hostility <- ds02$OG_hostility## Variable: OG_cooperation: ## Only available in ds02 (4 country combined dataset):ds01$OG_cooperation <-NAds02$OG_cooperation <- ds02$OG_cooperation## Variable: Fight_OG: ## Only available in ds02 (4 country combined dataset):ds01$Fight_OG <-NAds02$Fight_OG <- ds02$Fight_OG## Variable: Age: ds01$Age <-as.numeric(ds01$Age)ds02$Age <-as.numeric(ds02$Age)## Variable: Female: ds01$Female <- ds01$Femaleds02$Female <-ifelse(ds02$gender =="Female", 1, 0)## Variable: Married:ds01$Married <- ds01$Marriedds02$Married <-ifelse(ds02$married =="Married", 1, 0)## Variable: Wealth_level## This variable needed a lot of work## For ds01 (8 country ds), wealth_level is divided 1, 2, 3, 4 based on ## quartiles of wealth_level responses which range from 0 to 100## For ds02 (4 country ds), wealth level is divided into 1, 2, 3,4 based on## SES responses (lower middle, middle, upper middle, upper)ds01$Wealth_level <-ifelse(ds01$wealth_level %in%c(0:25), 1,ifelse(ds01$wealth_level %in%c(26:50), 2,ifelse(ds01$wealth_level %in%c(51:75), 3,ifelse(ds01$wealth_level %in%c(76:100), 4, NA))))ds01$Wealth_level <-factor(ds01$Wealth_level, levels =c("1", "2", "3", "4"))ds01$Wealth_level <-as.numeric(ds01$Wealth_level)ds02$Wealth_level <-ifelse(ds02$ses =="Lower middle", 1,ifelse(ds02$ses =="Middle", 2,ifelse(ds02$ses =="Upper middle", 3,ifelse(ds02$ses =="Upper", 4, NA))))ds02$Wealth_level <-factor(ds02$Wealth_level, levels =c("1", "2", "3", "4"))ds02$Wealth_level <-as.numeric(ds02$Wealth_level)## Variable: Event_positive affectds01$Event_positive_affect <- ds01$event_positive_affectds02$Event_positive_affect <- ds02$Event_positive_affect## Variable: Event_negative affectds01$Event_negative_affect <- ds01$event_negative_affectds02$Event_negative_affect <- ds02$Event_negative_affect## Variable: Event_episodic recallds01$Event_episodic_recall <- ds01$event_episodic_recallds02$Event_episodic_recall <- ds02$Event_episodic_recall## Variable: Event_shared_perceptionds01$Event_shared_perception <- ds01$event_shared_perceptionds02$Event_shared_perception <- ds02$Event_shared_perception## Variable: Event_reflectionds01$Event_reflection <- ds01$event_event_reflectionds02$Event_reflection <- ds02$Event_event_reflection## Variable: Event_transformative_indivds01$Event_transformative_indiv <- ds01$event_transformative_indivds02$Event_transformative_indiv <- ds02$Event_transformative_indiv## Variable: Event_transformative_groupds01$Event_transformative_group <- ds01$event_transformative_groupds02$Event_transformative_group <- ds02$Event_transformative_group## Combine two datasets with needed variables onlyds01 <- ds01[, ..list1]ds02 <- ds02[, ..list1]ds <-rbind(ds01, ds02)## ## Remove all objects in R except ds:rm(list=ls()[!(ls() %in%c("ds"))])df01 <- ds %>%drop_na(Endorse_BCL, Endorse_BBL, Country)```# **Section 1. Outcome: Endorsement of BCL*****Note: *** Read Chapter 12 of [Gelman \& Hill (2016)](http://www.stat.columbia.edu/~gelman/arm/){target="blank"} for reference. ## Unconditional means modelAlso called "varying intercept model with no predictors" (Gelman and Hill, 2016, Chapter 12). Allows intercepts to randomly vary across countries:```{r, error = F, message = F, warning = F}## Varying intercept model with no predictors:m00<-lmer(Endorse_BCL ~1+ (1| Country), data = ds)summary(m00)```Random effects:Variance for Intercept = 0.196. This is the variance of the means across level 1 categories (countries).```{r, error = F, message = F, warning = F}tab_model(m00)```We can see that ICC = 0.07. Lower ICC = low variance explained across groups. In this case, most of the variability is at individual-level (not group level). There is very little differing patterns between countries. ## Random intercept modelAlso called "varying intercept model with individual-level predictors" (Gelman and Hill, 2016, Chapter 12).```{r, error = F, message = F, warning = F}## Varying intercept models with individual-level predictors:m01 <-lmer(Endorse_BCL~IG_fusion+IG_identification+OG_bonds+Empathic_concern+ Perspective_taking+Age+Female+Married+Wealth_level+ (1| Country), data = ds)summary(m01)tab_model(m01)```Here, marginal R^2^ is much higher compared to previous model. Adding individual-level predictors significantly increases explanatory power of the model. Again, evidence that most of the variation is at individual-level differences. ```{r, error = F, message = F, warning = F, results = "hide"}## Change class of all models so we can use stargazer():class(m00) <-"lmerMod"class(m01) <-"lmerMod"## Tabulated results:stargazer(m00, m01,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")``````{r}htmltools::includeHTML("table1.html")```## Histogram: Endorsement of BCL```{r, error = F, message = F, warning = F}summary(df01$Endorse_BCL)ggplot(data = df01, aes(x = Endorse_BCL)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+geom_textvline(label ="Mean = 5.10", xintercept =5.10, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="Frequency",x ="Endorse_BCL score", title ="Endorse_BCL")+theme_bw()ggplot(data = df01, aes(x = Endorse_BCL)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+labs(y ="Frequency",x ="Endorse_BCL score", title ="Endorse_BCL")+facet_wrap( ~ Country, nrow =3) +theme_bw()tbl01 <-aggregate(df01$Endorse_BCL, by=list(df01$Country),FUN=mean)tbl01$Country <- tbl01$Group.1tbl01$Endorse_BCL <- tbl01$xtbl01 <- tbl01[, 3:4]tbl01ggplot(data = df01, aes(x = Endorse_BCL, y = Country)) +geom_boxplot(color ="black",fill ="grey")+xlim(1, 7)+geom_textvline(label ="Mean = 5.10", xintercept =5.10, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="",x ="Endorse_BCL score", title ="Endorse_BCL")+theme_bw()```## Faceted plots: Endorse BCL vs Ingroup fusion```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BCL,x = IG_fusion)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="IG_fusion score",y ="Endorse_BCL score", title ="Endorse_BCL vs Ingroup fusion")+theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = IG_fusion, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="IG_fusion score",y ="Endorse_BCL score", title ="Endorse_BCL vs Ingroup fusion")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = IG_fusion)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="IG_fusion score",y ="Endorse_BCL score", title ="Endorse_BCL vs Ingroup fusion")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Endorse BCL vs Ingroup identification```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BCL,x = IG_identification))+xlim(1, 7)+ylim(1, 7)+geom_point() +stat_smooth(method="lm", fullrange=TRUE) +labs(x ="IG_identification score",y ="Endorse_BCL score", title ="Endorse_BCL vs Ingroup identification")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = IG_identification, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="IG_identification score",y ="Endorse_BCL score", title ="Endorse_BCL vs Ingroup identification")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = IG_identification))+xlim(1, 7)+ylim(1, 7)+geom_point() +stat_smooth(method="lm", fullrange=TRUE) +labs(x ="IG_identification score",y ="Endorse_BCL score", title ="Endorse_BCL vs Ingroup identification")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Endorse BCL vs Outgroup bonds```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BCL,x = OG_bonds)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="OG_bonds score",y ="Endorse_BCL score", title ="Endorse_BCL vs Outgroup bonds")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = OG_bonds, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="OG_bonds score",y ="Endorse_BCL score", title ="Endorse_BCL vs Outgroup bonds")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = OG_bonds)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="OG_bonds score",y ="Endorse_BCL score", title ="Endorse_BCL vs Outgroup bonds")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Endorse BCL vs Empathetic concern```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BCL,x = Empathic_concern)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="Empathic_concern score",y ="Endorse_BCL score", title ="Endorse_BCL vs Empathetic concern")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = Empathic_concern, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="Empathic_concern score",y ="Endorse_BCL score", title ="Endorse_BCL vs Empathetic concern")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = Empathic_concern)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="Empathic_concern score",y ="Endorse_BCL score", title ="Endorse_BCL vs Empathetic concern")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Endorse BCL vs Perspective taking```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BCL,x = Perspective_taking)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="Perspective_taking score",y ="Endorse_BCL score", title ="Endorse_BCL vs Perspective taking")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = Perspective_taking, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="Perspective_taking score",y ="Endorse_BCL score", title ="Endorse_BCL vs Perspective taking")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BCL,x = Perspective_taking)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="Perspective_taking score",y ="Endorse_BCL score", title ="Endorse_BCL vs Perspective taking")+facet_wrap( ~ Country, nrow =3) +theme_bw()```# **Section 2. Outcome: Endorsement of BBL**## Unconditional means model```{r, error = F, message = F, warning = F}## Varying intercept model with no predictors:m02<-lmer(Endorse_BBL ~1+ (1| Country), data = ds)summary(m02)tab_model(m02)```## Random intercept model```{r, error = F, message = F, warning = F}## Varying intercept models with individual-level predictors:m03 <-lmer(Endorse_BBL~IG_fusion+IG_identification+OG_bonds+Empathic_concern+ Perspective_taking+Age+Female+Married+Wealth_level+ (1| Country), data = ds)summary(m03)tab_model(m03)``````{r, error = F, message = F, warning = F, results = "hide"}## Change class of all models so we can use stargazer():class(m02) <-"lmerMod"class(m03) <-"lmerMod"## Tabulated results:stargazer(m02, m03,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")``````{r}htmltools::includeHTML("table1.html")```## Histogram: Endorsement of BBL```{r, error = F, message = F, warning = F}summary(df01$Endorse_BBL)ggplot(data = df01, aes(x = Endorse_BBL)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+geom_textvline(label ="Mean = 4.70", xintercept =4.70, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="Frequency",x ="Endorse_BBL score", title ="Endorse_BBL")+theme_bw()ggplot(data = df01, aes(x = Endorse_BBL)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+labs(y ="Frequency",x ="Endorse_BBL score", title ="Endorse_BBL")+facet_wrap( ~ Country, nrow =3) +theme_bw()tbl02 <-aggregate(df01$Endorse_BBL, by=list(df01$Country),FUN=mean)tbl02$Country <- tbl02$Group.1tbl02$Endorse_BBL <- tbl02$xtbl02 <- tbl02[, 3:4]tbl02ggplot(data = df01, aes(x = Endorse_BBL, y = Country)) +geom_boxplot(color ="black",fill ="grey")+xlim(1, 7)+geom_textvline(label ="Mean = 4.70", xintercept =4.70, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="",x ="Endorse_BBL score", title ="Endorse_BBL")+theme_bw()```## Faceted plots: Endorse BBL vs Ingroup fusion```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BBL,x = IG_fusion)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="IG_fusion score",y ="Endorse_BBL score", title ="Endorse_BBL vs Ingroup fusion")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = IG_fusion, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="IG_fusion score",y ="Endorse_BBL score", title ="Endorse_BBL vs Ingroup fusion")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = IG_fusion)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="IG_fusion score",y ="Endorse_BBL score", title ="Endorse_BBL vs Ingroup fusion")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Endorse BBL vs Ingroup identification```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BBL,x = IG_identification)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="IG_identification score",y ="Endorse_BBL score", title ="Endorse_BBL vs Ingroup identification")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = IG_identification, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="IG_identification score",y ="Endorse_BBL score", title ="Endorse_BBL vs Ingroup identification")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = IG_identification)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="IG_identification score",y ="Endorse_BBL score", title ="Endorse_BBL vs Ingroup identification")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Endorse BBL vs Outgroup bonds```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BBL,x = OG_bonds)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="OG_bonds score",y ="Endorse_BBL score", title ="Endorse_BBL vs Outgroup bonds")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = OG_bonds, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="OG_bonds score",y ="Endorse_BBL score", title ="Endorse_BBL vs Outgroup bonds")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = OG_bonds)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(x ="OG_bonds score",y ="Endorse_BBL score", title ="Endorse_BBL vs Outgroup bonds")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Endorse BBL vs Empathetic concern```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BBL,x = Empathic_concern)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE)+ylim(1, 7)+labs(x ="Empathic_concern score",y ="Endorse_BBL score", title ="Endorse_BBL vs Empathetic concern")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = Empathic_concern, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="Empathic concern",y ="Endorse_BBL score", title ="Endorse BBL vs Empathic concern")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = Empathic_concern)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE)+ylim(1, 7)+labs(x ="Empathic_concern score",y ="Endorse_BBL score", title ="Endorse_BBL vs Empathetic concern")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Endorse BBL vs Perspective taking```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = Endorse_BBL,x = Perspective_taking))+xlim(1, 7)+ylim(1, 7)+geom_point() +stat_smooth(method="lm", fullrange=TRUE) +labs(x ="Perspective_taking score",y ="Endorse_BBL score", title ="Endorse_BBL vs Perspective taking")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = Perspective_taking, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(x ="Perspective_taking score",y ="Empathic_concern score", title ="Empathic_concern vs Perspective taking")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = Endorse_BBL,x = Perspective_taking))+xlim(1, 7)+ylim(1, 7)+geom_point() +stat_smooth(method="lm", fullrange=TRUE) +labs(x ="Perspective_taking score",y ="Endorse_BBL score", title ="Endorse_BBL vs Perspective taking")+facet_wrap( ~ Country, nrow =3) +theme_bw()```# **Section 3. Combined MLM results: BCL/BBL vs Group fusion/identification**```{r, error = F, message = F, warning = F, results = "hide"}## Tabulated results:stargazer(m00, m01, m02, m03,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")``````{r}htmltools::includeHTML("table1.html")```# **Section 4. Outcome: Ingroup fusion**## Unconditional means model```{r, error = F, message = F, warning = F}## Varying intercept model with no predictors:m04 <-lmer(IG_fusion ~1+ (1| Country), data = ds)summary(m04)tab_model(m04)```## Random intercept model```{r, error = F, message = F, warning = F}## Varying intercept models with individual-level predictors:m05 <-lmer(IG_fusion~Event_positive_affect+Event_negative_affect+ Event_episodic_recall+Event_shared_perception+Event_reflection+ Event_transformative_indiv+Event_transformative_group+Age+Female+ Married+Wealth_level+ (1| Country), data = ds)summary(m05)tab_model(m05)``````{r, error = F, message = F, warning = F, results = "hide"}## Change class of all models so we can use stargazer():class(m04) <-"lmerMod"class(m05) <-"lmerMod"## Tabulated results:stargazer(m04, m05,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")``````{r}htmltools::includeHTML("table1.html")```## Histogram: Ingroup fusion```{r, error = F, message = F, warning = F}df01 <- ds %>%drop_na(IG_fusion, IG_identification)summary(df01$IG_fusion)ggplot(data = df01, aes(x = IG_fusion)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+geom_textvline(label ="Mean = 5.40", xintercept =5.40, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="Frequency",x ="IG_fusion score", title ="IG_fusion")+theme_bw()ggplot(data = df01, aes(x = IG_fusion)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+labs(y ="Frequency",x ="IG_fusion score", title ="IG_fusion")+facet_wrap( ~ Country, nrow =3) +theme_bw()tbl02 <-aggregate(df01$IG_fusion, by=list(df01$Country),FUN=mean)tbl02$Country <- tbl02$Group.1tbl02$IG_fusion <- tbl02$xtbl02 <- tbl02[, 3:4]tbl02ggplot(data = df01, aes(x = IG_fusion, y = Country)) +geom_boxplot(color ="black",fill ="grey")+xlim(1, 7)+geom_textvline(label ="Mean = 5.40", xintercept =5.40, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="",x ="IG_fusion score", title ="IG_fusion")+theme_bw()```## Faceted plots: Ingroup fusion vs Positive affect about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_fusion,x = Event_positive_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_positive_affect score", title ="IG_fusion vs Event_positive_affect")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_positive_affect, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_fusion score",x ="Event_positive_affect score", title ="IG_fusion vs Event_positive_affect")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_positive_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_positive_affect score", title ="IG_fusion vs Event_positive_affect")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup fusion vs Negative affect about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_fusion,x = Event_negative_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_negative_affect score", title ="IG_fusion vs Event_negative_affect")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_negative_affect, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_fusion score",x ="Event_negative_affect score", title ="IG_fusion vs Event_negative_affect")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_negative_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_negative_affect score", title ="IG_fusion vs Event_negative_affect")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup fusion vs Episodic recall about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_fusion,x = Event_episodic_recall)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_episodic_recall score", title ="IG_fusion vs Event_episodic_recall")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_episodic_recall, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_fusion score",x ="Event_episodic_recall score", title ="IG_fusion vs Event_episodic_recall")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_episodic_recall)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_episodic_recall score", title ="IG_fusion vs Event_episodic_recall")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup fusion vs Shared perception about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_fusion,x = Event_shared_perception)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_shared_perception score", title ="IG_fusion vs Event_shared_perception")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_shared_perception, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_fusion score",x ="Event_shared_perception score", title ="IG_fusion vs Event_shared_perception")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_shared_perception)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_shared_perception score", title ="IG_fusion vs Event_shared_perception")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup fusion vs Reflection of event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_fusion,x = Event_reflection)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_reflection score", title ="IG_fusion vs Event_reflection")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_reflection, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_fusion score",x ="Event_reflection score", title ="IG_fusion vs Event_reflection")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_reflection)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_reflection score", title ="IG_fusion vs Event_reflection")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup fusion vs Transformative event for individual```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_fusion,x = Event_transformative_indiv)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_transformative_individual score", title ="IG_fusion vs Event_transformative_individual")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_transformative_indiv, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_fusion score",x ="Event_transformative_individual score", title ="IG_fusion vs Event_transformative_individual")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_transformative_indiv)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_transformative_individual score", title ="IG_fusion vs Event_transformative_individual")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup fusion vs Transformative event for group```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_fusion,x = Event_transformative_group)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_transformative_group score", title ="IG_fusion vs Event_transformative_group")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_transformative_group, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_fusion score",x ="Event_transformative_group score", title ="IG_fusion vs Event_transformative_group")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_fusion,x = Event_transformative_group)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_fusion score",x ="Event_transformative_group score", title ="IG_fusion vs Event_transformative_group")+facet_wrap( ~ Country, nrow =3) +theme_bw()```# **Section 5. Outcome: Ingroup identification**## Unconditional means model```{r, error = F, message = F, warning = F}## Varying intercept model with no predictors:m06 <-lmer(IG_identification ~1+ (1| Country), data = ds)summary(m06)tab_model(m06)```## Random intercept model```{r, error = F, message = F, warning = F}## Varying intercept models with individual-level predictors:m07 <-lmer(IG_identification~Event_positive_affect+Event_negative_affect+ Event_episodic_recall+Event_shared_perception+Event_reflection+ Event_transformative_indiv+Event_transformative_group+Age+Female+ Married+Wealth_level+ (1| Country), data = ds)summary(m07)tab_model(m07)``````{r, error = F, message = F, warning = F, results = "hide"}## Change class of all models so we can use stargazer():class(m06) <-"lmerMod"class(m07) <-"lmerMod"## Tabulated results:stargazer(m06, m07,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")``````{r}htmltools::includeHTML("table1.html")```## Histogram: Ingroup identification```{r, error = F, message = F, warning = F}df01 <- ds %>%drop_na(IG_identification)summary(df01$IG_identification)ggplot(data = df01, aes(x = IG_identification)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+geom_textvline(label ="Mean = 5.40", xintercept =5.40, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="Frequency",x ="IG_identification score", title ="IG_identification")+theme_bw()ggplot(data = df01, aes(x = IG_identification)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+labs(y ="Frequency",x ="IG_identification score", title ="IG_identification")+facet_wrap( ~ Country, nrow =3) +theme_bw()tbl02 <-aggregate(df01$IG_identification, by=list(df01$Country),FUN=mean)tbl02$Country <- tbl02$Group.1tbl02$IG_identification <- tbl02$xtbl02 <- tbl02[, 3:4]tbl02ggplot(data = df01, aes(x = IG_identification, y = Country)) +geom_boxplot(color ="black",fill ="grey")+xlim(1, 7)+geom_textvline(label ="Mean = 5.40", xintercept =5.40, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="",x ="IG_identification score", title ="IG_identification")+theme_bw()```## Faceted plots: Ingroup identification vs Positive affect about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_identification,x = Event_positive_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_positive_affect score", title ="IG_identification vs Event_positive_affect")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_positive_affect, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_identification score",x ="Event_positive_affect score", title ="IG_identification vs Event_positive_affect")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_positive_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_positive_affect score", title ="IG_identification vs Event_positive_affect")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup identification vs Negative affect about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_identification,x = Event_negative_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_negative_affect score", title ="IG_identification vs Event_negative_affect")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_negative_affect, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_identification score",x ="Event_negative_affect score", title ="IG_identification vs Event_negative_affect")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_negative_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_negative_affect score", title ="IG_identification vs Event_negative_affect")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup identification vs Episodic recall about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_identification,x = Event_episodic_recall)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_episodic_recall score", title ="IG_identification vs Event_episodic_recall")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_episodic_recall, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_identification score",x ="Event_episodic_recall score", title ="IG_identification vs Event_episodic_recall")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_episodic_recall)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_episodic_recall score", title ="IG_identification vs Event_episodic_recall")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup identification vs Shared perception about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_identification,x = Event_shared_perception)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_shared_perception score", title ="IG_identification vs Event_shared_perception")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_shared_perception, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_identification score",x ="Event_shared_perception score", title ="IG_identification vs Event_shared_perception")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_shared_perception)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_shared_perception score", title ="IG_identification vs Event_shared_perception")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup identification vs Reflection of event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_identification,x = Event_reflection)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_reflection score", title ="IG_identification vs Event_reflection")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_reflection, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_identification score",x ="Event_reflection score", title ="IG_identification vs Event_reflection")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_reflection)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_reflection score", title ="IG_identification vs Event_reflection")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup identification vs Transformative event for individual```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_identification,x = Event_transformative_indiv)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_transformative_individual score", title ="IG_identification vs Event_transformative_individual")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_transformative_indiv, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_identification score",x ="Event_transformative_individual score", title ="IG_identification vs Event_transformative_individual")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_transformative_indiv)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_transformative_individual score", title ="IG_identification vs Event_transformative_individual")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Ingroup identification vs Transformative event for group```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = IG_identification,x = Event_transformative_group)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_transformative_group score", title ="IG_identification vs Event_transformative_group")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_transformative_group, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="IG_identification score",x ="Event_transformative_group score", title ="IG_identification vs Event_transformative_group")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = IG_identification,x = Event_transformative_group)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="IG_identification score",x ="Event_transformative_group score", title ="IG_identification vs Event_transformative_group")+facet_wrap( ~ Country, nrow =3) +theme_bw()```# **Section 6. Outcome: Outgroup bonds**## Unconditional means model```{r, error = F, message = F, warning = F}## Varying intercept model with no predictors:m08 <-lmer(OG_bonds ~1+ (1| Country), data = ds)summary(m08)tab_model(m08)```## Random intercept model```{r, error = F, message = F, warning = F}## Varying intercept models with individual-level predictors:m09 <-lmer(OG_bonds~Event_positive_affect+Event_negative_affect+ Event_episodic_recall+Event_shared_perception+Event_reflection+ Event_transformative_indiv+Event_transformative_group+Age+Female+ Married+Wealth_level+ (1| Country), data = ds)summary(m09)tab_model(m09)``````{r, error = F, message = F, warning = F, results = "hide"}## Change class of all models so we can use stargazer():class(m08) <-"lmerMod"class(m09) <-"lmerMod"## Tabulated results:stargazer(m08, m09,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")``````{r}htmltools::includeHTML("table1.html")```## Histogram: Outgroup bonds```{r, error = F, message = F, warning = F}df02 <- ds %>%drop_na(OG_bonds)summary(df02$OG_bonds)ggplot(data = df02, aes(x = OG_bonds)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+geom_textvline(label ="Mean = 3.30", xintercept =3.30, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="Frequency",x ="OG_bonds score", title ="OG_bonds")+theme_bw()ggplot(data = df01, aes(x = OG_bonds)) +geom_histogram(color ="black",bins =20)+xlim(1, 7)+labs(y ="Frequency",x ="OG_bonds score", title ="OG_bonds")+facet_wrap( ~ Country, nrow =3) +theme_bw()tbl02 <-aggregate(df02$OG_bonds, by=list(df02$Country),FUN=mean)tbl02$Country <- tbl02$Group.1tbl02$OG_bonds <- tbl02$xtbl02 <- tbl02[, 3:4]tbl02ggplot(data = df01, aes(x = OG_bonds, y = Country)) +geom_boxplot(color ="black",fill ="grey")+xlim(1, 7)+geom_textvline(label ="Mean = 3.30", xintercept =3.30, vjust =1.1, lwd =1.05, linetype =2)+labs(y ="",x ="OG_bonds score", title ="OG_bonds")+theme_bw()```## Faceted plots: Outgroup bonds vs Positive affect about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = OG_bonds,x = Event_positive_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_positive_affect score", title ="OG_bonds vs Event_positive_affect")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_positive_affect, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="OG_bonds score",x ="Event_positive_affect score", title ="OG_bonds vs Event_positive_affect")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_positive_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_positive_affect score", title ="OG_bonds vs Event_positive_affect")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Outgroup bonds vs Negative affect about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = OG_bonds,x = Event_negative_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_negative_affect score", title ="OG_bonds vs Event_negative_affect")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_negative_affect, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="OG_bonds score",x ="Event_negative_affect score", title ="OG_bonds vs Event_negative_affect")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_negative_affect)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_negative_affect score", title ="OG_bonds vs Event_negative_affect")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Outgroup bonds vs Episodic recall about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = OG_bonds,x = Event_episodic_recall)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_episodic_recall score", title ="OG_bonds vs Event_episodic_recall")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_episodic_recall, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="OG_bonds score",x ="Event_episodic_recall score", title ="OG_bonds vs Event_episodic_recall")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_episodic_recall)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_episodic_recall score", title ="OG_bonds vs Event_episodic_recall")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Outgroup bonds vs Shared perception about event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = OG_bonds,x = Event_shared_perception)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_shared_perception score", title ="OG_bonds vs Event_shared_perception")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_shared_perception, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="OG_bonds score",x ="Event_shared_perception score", title ="OG_bonds vs Event_shared_perception")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_shared_perception)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_shared_perception score", title ="OG_bonds vs Event_shared_perception")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Outgroup bonds vs Reflection of event```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = OG_bonds,x = Event_reflection)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_reflection score", title ="OG_bonds vs Event_reflection")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_reflection, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="OG_bonds score",x ="Event_reflection score", title ="OG_bonds vs Event_reflection")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_reflection)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_reflection score", title ="OG_bonds vs Event_reflection")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Outgroup bonds vs Transformative event for individual```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = OG_bonds,x = Event_transformative_indiv)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_transformative_individual score", title ="OG_bonds vs Event_transformative_individual")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_transformative_indiv, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="OG_bonds score",x ="Event_transformative_individual score", title ="OG_bonds vs Event_transformative_individual")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_transformative_indiv)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_transformative_individual score", title ="OG_bonds vs Event_transformative_individual")+facet_wrap( ~ Country, nrow =3) +theme_bw()```## Faceted plots: Outgroup bonds vs Transformative event for group```{r, error = F, message = F, warning = F}ggplot(data = ds, aes(y = OG_bonds,x = Event_transformative_group)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_transformative_group score", title ="OG_bonds vs Event_transformative_group")+# facet_wrap( ~ Country, nrow = 3) +theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_transformative_group, col = Country, linetype = Country)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", se = F) +labs(y ="OG_bonds score",x ="Event_transformative_group score", title ="OG_bonds vs Event_transformative_group")+scale_color_colorblind()+theme_bw()ggplot(data = ds, aes(y = OG_bonds,x = Event_transformative_group)) +geom_point()+xlim(1, 7)+ylim(1, 7)+stat_smooth(method="lm", fullrange=TRUE) +labs(y ="OG_bonds score",x ="Event_transformative_group score", title ="OG_bonds vs Event_transformative_group")+facet_wrap( ~ Country, nrow =3) +theme_bw()```# **Section 7. Combined MLM results: Group fusion/identification vs Imagistic items**```{r, error = F, message = F, warning = F, results = "hide"}## Tabulated results:stargazer(m04, m05, m06, m07, m08, m09,type ="html", star.cutoffs =c(0.05, 0.01, 0.001),out ="table1.html")``````{r}htmltools::includeHTML("table1.html")## Write final dataset file:# fwrite(ds, file = "~/Desktop/oxford/data/BCL/BCL02.csv")```# **Section 8. Coefficient plots**```{r, error = F, message = F, warning = F}bg <-list(geom_point(aes(y = term, x = estimate),alpha = .25, size =15, color ='red'))```## Outcome: Endorsement of BCL```{r, error = F, message = F, warning = F}mp01 <-modelplot(m01,coef_omit ='SD (Observations)',coef_rename =TRUE) +aes(color =ifelse(p.value <0.05, "Significant", "Not significant")) +scale_color_manual(values =c("red", "blue", "black"))+# xlim(-3, 3)+labs(title ="Endorsement of BCL", x ="Coefficient estimates with 95% CI")+geom_vline(xintercept =0, linetype =2)mp01cfp01 <-modelplot(m01,coef_omit ='SD (Observations)',coef_rename =TRUE, background = bg)+aes(color =ifelse(p.value <0.05, "Significant", "Not significant"))+scale_color_manual(values =c("red", "blue"))+# xlim(-3, 3)+labs(title ="Endorsement of BCL", x ="Coefficient estimates with95% CI")+geom_vline(xintercept =0, linetype =2)cfp01```## Outcome: Endorsement of BBL```{r, error = F, message = F, warning = F}mp03 <-modelplot(m03,coef_omit ='SD (Observations)',coef_rename =TRUE) +aes(color =ifelse(p.value <0.05, "Significant", "Not significant")) +scale_color_manual(values =c("red", "blue", "black"))+# xlim(-3, 3)+labs(title ="Endorsement of BBL", x ="Coefficient estimates with95% CI")+geom_vline(xintercept =0, linetype =2)mp03cfp03 <-modelplot(m03,coef_omit ='SD (Observations)',coef_rename =TRUE, background = bg)+aes(color =ifelse(p.value <0.05, "Significant", "Not significant"))+scale_color_manual(values =c("red", "blue"))+# xlim(-3, 3)+labs(title ="Endorsement of BBL", x ="Coefficient estimates with95% CI")+geom_vline(xintercept =0, linetype =2)cfp03```## Combined: Endorsement of BCL \& BBL```{r, error = F, message = F, warning = F}mp01a <- mp01 +theme(legend.position ="none")ol1 <- mp01a / mp03ol1```## Outcome: Ingroup fusion```{r, error = F, message = F, warning = F}mp05 <-modelplot(m05,coef_omit ='SD (Observations)',coef_rename =TRUE) +aes(color =ifelse(p.value <0.05, "Significant", "Not significant")) +scale_color_manual(values =c("red", "blue", "black"))+# xlim(-3, 3)+labs(title ="Ingroup fusion", x ="Coefficient estimates with95% CI")+geom_vline(xintercept =0, linetype =2)mp05cfp05 <-modelplot(m05,coef_omit ='SD (Observations)',coef_rename =TRUE, background = bg)+aes(color =ifelse(p.value <0.05, "Significant", "Not significant"))+scale_color_manual(values =c("red", "blue"))+# xlim(-3, 3)+labs(title ="Ingroup fusion", x ="Coefficient estimates with95% CI")+geom_vline(xintercept =0, linetype =2)cfp05```## Outcome: Ingroup identification```{r, error = F, message = F, warning = F}mp07 <-modelplot(m07,coef_omit ='SD (Observations)',coef_rename =TRUE) +aes(color =ifelse(p.value <0.05, "Significant", "Not significant")) +scale_color_manual(values =c("red", "blue", "black"))+# xlim(-3, 3)+labs(title ="Ingroup identification", x ="Coefficient estimates with95% CI")+geom_vline(xintercept =0, linetype =2)mp07cfp07 <-modelplot(m03,coef_omit ='SD (Observations)',coef_rename =TRUE, background = bg)+aes(color =ifelse(p.value <0.05, "Significant", "Not significant"))+scale_color_manual(values =c("red", "blue"))+# xlim(-3, 3)+labs(title ="Ingroup identification", x ="Coefficient estimates with95% CI")+geom_vline(xintercept =0, linetype =2)cfp07```## Combined: Ingroup Fusion \& Identification```{r, error = F, message = F, warning = F}mp05a <- mp05 +theme(legend.position ="none")ol2 <- mp05a / mp07ol2```## Outcome: Outcome bonds```{r, error = F, message = F, warning = F}mp09 <-modelplot(m09,coef_omit ='SD (Observations)',coef_rename =TRUE) +aes(color =ifelse(p.value <0.05, "Significant", "Not significant")) +scale_color_manual(values =c("red", "blue", "black"))+# xlim(-3, 3)+labs(title ="Outgroup bonds", x ="Coefficient estimates with95% CI")+geom_vline(xintercept =0, linetype =2)mp09cfp09 <-modelplot(m09,coef_omit ='SD (Observations)',coef_rename =TRUE, background = bg)+aes(color =ifelse(p.value <0.05, "Significant", "Not significant"))+scale_color_manual(values =c("red", "blue"))+# xlim(-3, 3)+labs(title ="Outgroup bonds", x ="Coefficient estimates with95% CI")+geom_vline(xintercept =0, linetype =2)cfp09```# **To Do**- Some countries/datasets have more variables than others. This makes it difficult to estimate all explanatory variables of interest (eg - perceived discrimination, negative/positive contact/etc)- No group-level predictors in the data. For eg: country-level variables that might explain the variation in DVs. Eg: country-level trust/religiosity scores, GDP, HDI, etc. Multi-level modeling is more informative if there are theoretically relevant group-level predictors. - Other DV/IV combinations- Other comments/suggestions?