---
title: "BCL Cross-country Data <br> Multi-level Modeling"
author: Gagan Atreya
date: today
format:
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: wrap
editor:
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)
## Import latest BCL dataset:
ds <- fread ("~/Desktop/oxford/data/BCL/BCL01.csv" )
ds <- as.data.table (ds)
ds$ Empathic_concern <- ds$ empathic_concern
ds$ Perspective_taking <- ds$ perspective_taking
df01 <- ds %>% drop_na (Endorse_BCL, Endorse_BBL, Country)
```
# **Section 1. Outcome: Endorsement of BCL**
***Note: *** Read pg. 259 of [ Gelman \& Hill (2016) ](http://www.stat.columbia.edu/~gelman/arm/) {target="blank"} for reference. Additional instructions are also available at [ this online guide ](https://quantdev.ssri.psu.edu/tutorials/r-bootcamp-introduction-multilevel-model-and-interactions) {target="blank"}.
## Unconditional means model
Also called "varying intercept model with no predictors" (Gelman and Hill, 2016, Chapter 12).
```{r, error = F, message = F, warning = F}
## Varying intercept model with no predictors:
m00<- lmer (formula = Endorse_BCL ~ 1 + (1 | Country),
data = ds)
summary (m00)
```
## Random intercept models
Also 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 (formula = Endorse_BCL~ IG_Fusion+ IG_Identification+ OG_Bonds+ Empathic_concern+
Perspective_taking+ Age+ Female+ Married+ Wealth_level+
(1 | Country),
data = ds)
summary (m01)
```
```{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 = 4.70" ,
xintercept = 4.70 ,
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 = 2 ) +
theme_bw ()
tbl01 <- aggregate (df01$ Endorse_BCL,
by= list (df01$ Country),
FUN= mean)
tbl01$ Country <- tbl01$ Group.1
tbl01$ Endorse_BCL <- tbl01$ x
tbl01 <- tbl01[, 3 : 4 ]
tbl01
ggplot (data = df01,
aes (x = Endorse_BCL,
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_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" )+
# facet_wrap( ~ Country, nrow = 2)+
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 (formula = Endorse_BBL ~ 1 + (1 | Country),
data = ds)
summary (m02)
```
## Random intercept models
```{r, error = F, message = F, warning = F}
## Varying intercept models with individual-level predictors:
m03 <- lmer (formula = Endorse_BBL~ IG_Fusion+ IG_Identification+ OG_Bonds+ Empathic_concern+
Perspective_taking+ Age+ Female+ Married+ Wealth_level+
(1 | Country),
data = ds)
summary (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.90" ,
xintercept = 4.90 ,
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 = 2 ) +
theme_bw ()
tbl02 <- aggregate (df01$ Endorse_BBL,
by= list (df01$ Country),
FUN= mean)
tbl02$ Country <- tbl02$ Group.1
tbl02$ Endorse_BBL <- tbl02$ x
tbl02 <- tbl02[, 3 : 4 ]
tbl02
ggplot (data = df01,
aes (x = Endorse_BBL,
y = Country)) +
geom_boxplot (color = "black" ,
fill = "grey" )+
xlim (1 , 7 )+
geom_textvline (label = "Mean = 4.90" ,
xintercept = 4.90 ,
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 = 2) +
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 = 2 ) +
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_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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 (formula = IG_Fusion ~ 1 + (1 | Country),
data = ds)
summary (m04)
```
## Random intercept model
```{r, error = F, message = F, warning = F}
## Varying intercept models with individual-level predictors:
m05 <- lmer (formula = IG_Fusion~ event_positive_affect+ event_negative_affect+
event_episodic_recall+ event_shared_perception+ event_event_reflection+
event_transformative_indiv+ event_transformative_group+ Age+ Female+
Married+ Wealth_level+
(1 | Country), data = ds)
summary (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 = 4.80" ,
xintercept = 4.80 ,
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 = 2 ) +
theme_bw ()
tbl02 <- aggregate (df01$ IG_Fusion,
by= list (df01$ Country),
FUN= mean)
tbl02$ Country <- tbl02$ Group.1
tbl02$ IG_Fusion <- tbl02$ x
tbl02 <- tbl02[, 3 : 4 ]
tbl02
ggplot (data = df01,
aes (x = IG_Fusion,
y = Country)) +
geom_boxplot (color = "black" ,
fill = "grey" )+
xlim (1 , 7 )+
geom_textvline (label = "Mean = 4.80" ,
xintercept = 4.80 ,
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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_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 = 2) +
theme_bw ()
ggplot (data = ds,
aes (y = IG_Fusion,
x = event_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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 (formula = IG_Identification ~ 1 + (1 | Country),
data = ds)
summary (m06)
```
## Random intercept model
```{r, error = F, message = F, warning = F}
## Varying intercept models with individual-level predictors:
m07 <- lmer (formula = IG_Identification~ event_positive_affect+ event_negative_affect+
event_episodic_recall+ event_shared_perception+ event_event_reflection+
event_transformative_indiv+ event_transformative_group+ Age+ Female+
Married+ Wealth_level+
(1 | Country), data = ds)
summary (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 = 4.90" ,
xintercept = 4.90 ,
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 = 2 ) +
theme_bw ()
tbl02 <- aggregate (df01$ IG_Identification,
by= list (df01$ Country),
FUN= mean)
tbl02$ Country <- tbl02$ Group.1
tbl02$ IG_Identification <- tbl02$ x
tbl02 <- tbl02[, 3 : 4 ]
tbl02
ggplot (data = df01,
aes (x = IG_Identification,
y = Country)) +
geom_boxplot (color = "black" ,
fill = "grey" )+
xlim (1 , 7 )+
geom_textvline (label = "Mean = 4.90" ,
xintercept = 4.90 ,
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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_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 = 2) +
theme_bw ()
ggplot (data = ds,
aes (y = IG_Identification,
x = event_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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 (formula = OG_Bonds ~ 1 + (1 | Country),
data = ds)
summary (m08)
```
## Random intercept model
```{r, error = F, message = F, warning = F}
## Varying intercept models with individual-level predictors:
m09 <- lmer (formula = OG_Bonds~ event_positive_affect+ event_negative_affect+
event_episodic_recall+ event_shared_perception+ event_event_reflection+
event_transformative_indiv+ event_transformative_group+ Age+ Female+
Married+ Wealth_level+
(1 | Country), data = ds)
summary (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}
df01 <- ds %>% drop_na (OG_Bonds)
summary (df01$ OG_Bonds)
ggplot (data = df01,
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 = 2 ) +
theme_bw ()
tbl02 <- aggregate (df01$ OG_Bonds,
by= list (df01$ Country),
FUN= mean)
tbl02$ Country <- tbl02$ Group.1
tbl02$ OG_Bonds <- tbl02$ x
tbl02 <- tbl02[, 3 : 4 ]
tbl02
ggplot (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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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_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 = 2) +
theme_bw ()
ggplot (data = ds,
aes (y = OG_Bonds,
x = event_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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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 = 2) +
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 = 2 ) +
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" )
```