Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
0.0 1.0 3.0 3.6 6.0 16.0 11
Display code
ds %>%drop_na(children)%>%ggplot(aes(x = children))+geom_bar(color ="black",fill ="gray",width =0.75)+geom_textvline(label ="Mean = 3.60", xintercept =3.60, vjust =1.3, lwd =1.05, linetype =2)+labs(x ="Number of children", y ="Frequency", title ="Number of children")+theme_bw()
Variable: Ethnicity
This variable needs lots of cleaning by someone familiar with ethnic distribution in Uganda. It is not possible to visualize it in its current form, which looks like this:
This variable needs lots of cleaning by someone familiar to Uganda education system. It is not possible to visualize it in its current form, which looks something like this:
Display code
head(table(ds$Level_of_education), n =15)
'A' Level
3
"A" Level
1
0 Level
1
A level
1
A' Level
1
Advance Certificate in Electrical Installation
1
bachelors
2
bachelors degree
1
Bed Maker
1
certificate
1
Certificate
5
Certificate in early chiildhood development
1
Certificate in Laboratory technology
1
certificate IN PLUMBING
1
Certification in Interior/Exterior design
1
Section 2. Factor Analysis: Group fusion/identification
Display code
## Four ingroup fusion items:ds$IGF01 <-as.numeric(ds$`Q11.1 Group Bonds`)ds$IGF02 <-as.numeric(ds$`Q11.2 Group Bonds`)ds$IGF03 <-as.numeric(ds$`Q11.3 Group Bonds`)ds$IGF04 <-as.numeric(ds$`Q11.4 Group Bonds`)## Four ingroup identification items:ds$IGI01 <-as.numeric(ds$`Q11.9 Group Bonds`)ds$IGI02 <-as.numeric(ds$`Q11.10 Group Bonds`)ds$IGI03 <-as.numeric(ds$`Q11.11 Group Bonds`)ds$IGI04 <-as.numeric(ds$`Q11.12 Group Bonds`)## Four outgroup fusion items:ds$OGF01 <-as.numeric(ds$`Q11.5 Group Bonds`)ds$OGF02 <-as.numeric(ds$`Q11.6 Group Bonds`)ds$OGF03 <-as.numeric(ds$`Q11.7 Group Bonds`)ds$OGF04 <-as.numeric(ds$`Q11.8 Group Bonds`)## Four outgroup identification items:ds$OGI01 <-as.numeric(ds$`Q11.13 Group Bonds`)ds$OGI02 <-as.numeric(ds$`Q11.14 Group Bonds`)ds$OGI03 <-as.numeric(ds$`Q11.15 Group Bonds`)ds$OGI04 <-as.numeric(ds$`Q11.16 Group Bonds`)## Bonds dataframe:bonds <-cbind.data.frame(ds$IGF01, ds$IGF02, ds$IGF03, ds$IGF04, ds$IGI01, ds$IGI02, ds$IGI03, ds$IGI04, ds$OGF01, ds$OGF02, ds$OGF03, ds$OGF04, ds$OGI01, ds$OGI02, ds$OGI03, ds$OGI04)names(bonds) <-sub('ds\\$', '', names(bonds))bonds <-na.omit(bonds)mtx1 <-cor(bonds[, c(1:16)])
Shorthand for item names: IG = Ingroup, OG = Outgroup F = Fusion, I = Identification So for example: IGF01 = “ingroup fusion: item 1” OGI04 = “outgroup identification: item 4”, and so on
The correlation plot above shows the correlation coefficients between the sixteen different items (eight for ingroup fusion/identification and eight for outgroup fusion/identification).
The general criteria is that KMO needs to be greater than 0.60. Based on the results (overall MSA = 0.9), factor analysis is appropriate.
Bartlett’s test of sphericity
Display code
cortest.bartlett(bonds)
$chisq
[1] 6910
$p.value
[1] 0
$df
[1] 120
The test is significant, again suggesting that factor analysis is appropriate.
Parallel test
Display code
parallel <-fa.parallel(bonds)
Parallel analysis suggests that the number of factors = 3 and the number of components = 2
Based on the scree plot, factor analysis with two factors is the most appropriate. We will proceed with promax rotation, which assumes that the items are inter-correlated (that is, not independent from each other).
Factor analysis: Two factor model with promax rotation
Call:
factanal(x = bonds, factors = 2, rotation = "promax")
Uniquenesses:
IGF01 IGF02 IGF03 IGF04 IGI01 IGI02 IGI03 IGI04 OGF01 OGF02 OGF03 OGF04 OGI01
0.529 0.311 0.336 0.428 0.697 0.467 0.492 0.858 0.344 0.248 0.319 0.385 0.151
OGI02 OGI03 OGI04
0.101 0.062 0.086
Loadings:
Factor1 Factor2
IGF01 0.689
IGF02 0.834
IGF03 -0.115 0.818
IGF04 0.759
IGI01 0.548
IGI02 0.724
IGI03 0.703
IGI04 0.335 0.143
OGF01 0.806
OGF02 0.864
OGF03 0.810
OGF04 0.778
OGI01 0.925
OGI02 0.952
OGI03 0.973
OGI04 0.960
Factor1 Factor2
SS loadings 6.4 3.79
Proportion Var 0.4 0.24
Cumulative Var 0.4 0.64
Factor Correlations:
Factor1 Factor2
Factor1 1.0000 -0.0954
Factor2 -0.0954 1.0000
Test of the hypothesis that 2 factors are sufficient.
The chi square statistic is 1049 on 89 degrees of freedom.
The p-value is 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011
Factor analysis interpretation
The promax rotated FA output suggests that there are two factors:
Factor 1 consisting of the eight outgroup fusion/identification items
Factor 2 consisting of the eight ingroup fusion/identification items
The two factors are negatively correlated (coefficient = -0.0954)
The two factors cumulatively explain 64% of the variance in the data. Factor 1 explains 40% of the variance, and factor 2 explains 24% of the variance.
One item (out of the 16 total items) is “weird” - “IGI04” or “ingroup identification item 4.” It loads better with factor 1 instead of factor 2. The prompt for this item is “I feel a sense of belonging with the [ingroup]”
For our purposes, I am going to combine the ingroup fusion/identification items together to form one scale (based on Factor 2), and combine the outgroup fusion/identification items together to form a different scale (based on Factor 1).
Again, the output shows that the item “IGI04” (ingroup identification - item 4) has the weakest correlation with the other items, while the other items have moderate to strong correlation with each other.
In the “item statistics” output above, the output for “raw.r” for the last item “IGI04” is 0.47. This is the item-total correlation (a measure of how much this item correlates with the entire scale), and the value is substantially lower for this item compared to the other items.
Display code
### Reliability if each item is dropped:alpha02$alpha.drop
In the “alpha drop” output above, the output for “raw_alpha” for the last item “IGI04” is 0.87. This means that Cronbach’s alpha for the scale will increase to 0.87 (from the current value of 0.74) if that item is dropped.
All of this combined suggests that this item (IGI04) does not really go well with this scale, and the internal consistency of this scale will substantially improve if this item is dropped.
I will still keep this item for the analysis. But it looks like something weird is going on with this one item that is messing up the reliability of the scale.
Contrary to the “ingroup fusion/identification” scale previously, this scale has high reliability score, all the items are strongly correlated with each other, and there are no “weird” items in this scale.
Overall, both the “ingroup fusion/identification” scale as well as the “outgroup fusion/identification” scale are quite reliable and appropriate for measuring the concepts that they represent. The only exception is one item for the the “ingroup fusion/identification” scale (IGI04 or ingroup identification item 4). The results get a lot less noisier if this item is dropped.
Section 3a. Factor analysis of separate fusion/identification items (Version 1)
Display code
## Three ingroup fusion items:ds$IGF01 <-as.numeric(ds$`Q11.1 Group Bonds`)ds$IGF02 <-as.numeric(ds$`Q11.2 Group Bonds`)ds$IGF03 <-as.numeric(ds$`Q11.3 Group Bonds`)## Three outgroup fusion items:ds$OGF01 <-as.numeric(ds$`Q11.5 Group Bonds`)ds$OGF02 <-as.numeric(ds$`Q11.6 Group Bonds`)ds$OGF03 <-as.numeric(ds$`Q11.7 Group Bonds`)## Three ingroup identification items:ds$IGI01 <-as.numeric(ds$`Q11.9 Group Bonds`)ds$IGI02 <-as.numeric(ds$`Q11.10 Group Bonds`)ds$IGI03 <-as.numeric(ds$`Q11.11 Group Bonds`)## Three outgroup identification items:ds$OGI01 <-as.numeric(ds$`Q11.13 Group Bonds`)ds$OGI02 <-as.numeric(ds$`Q11.14 Group Bonds`)ds$OGI03 <-as.numeric(ds$`Q11.15 Group Bonds`)## Bonds dataframe:bonds <-cbind.data.frame(ds$IGF01, ds$IGF02, ds$IGF03, ds$IGI01, ds$IGI02, ds$IGI03, ds$OGF01, ds$OGF02, ds$OGF03, ds$OGI01, ds$OGI02, ds$OGI03)names(bonds) <-sub('ds\\$', '', names(bonds))bonds <-na.omit(bonds)mtx1 <-cor(bonds[, c(1:9)])
The correlation plot above shows the correlation coefficients between the nine different items (three fusion / identification items each for ingroup and outgroup).
### Reliability if each item is dropped:alpha02$alpha.drop
raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
OGI01 0.96 0.96 0.92 0.92 23 0.0037 NA 0.92
OGI02 0.94 0.94 0.88 0.88 15 0.0057 NA 0.88
OGI03 0.93 0.93 0.87 0.87 13 0.0065 NA 0.87
Section 3b. Factor analysis of separate fusion/identification items (Version 2)
Note: This version only drops one item - the problematic ingroup identification item, and retains all the other items from the ingroup fusion/identification scales.
Display code
## Four ingroup fusion items:ds$IGF01 <-as.numeric(ds$`Q11.1 Group Bonds`)ds$IGF02 <-as.numeric(ds$`Q11.2 Group Bonds`)ds$IGF03 <-as.numeric(ds$`Q11.3 Group Bonds`)ds$IGF04 <-as.numeric(ds$`Q11.4 Group Bonds`)## Three ingroup identification items:ds$IGI01 <-as.numeric(ds$`Q11.9 Group Bonds`)ds$IGI02 <-as.numeric(ds$`Q11.10 Group Bonds`)ds$IGI03 <-as.numeric(ds$`Q11.11 Group Bonds`)## Four outgroup fusion items:ds$OGF01 <-as.numeric(ds$`Q11.5 Group Bonds`)ds$OGF02 <-as.numeric(ds$`Q11.6 Group Bonds`)ds$OGF03 <-as.numeric(ds$`Q11.7 Group Bonds`)ds$OGF04 <-as.numeric(ds$`Q11.8 Group Bonds`)## Four outgroup identification items:ds$OGI01 <-as.numeric(ds$`Q11.13 Group Bonds`)ds$OGI02 <-as.numeric(ds$`Q11.14 Group Bonds`)ds$OGI03 <-as.numeric(ds$`Q11.15 Group Bonds`)ds$OGI04 <-as.numeric(ds$`Q11.16 Group Bonds`)## Bonds dataframe:bonds <-cbind.data.frame(ds$IGF01, ds$IGF02, ds$IGF03, ds$IGF04, ds$IGI01, ds$IGI02, ds$IGI03, ds$OGF01, ds$OGF02, ds$OGF03, ds$OGF04, ds$OGI01, ds$OGI02, ds$OGI03, ds$OGI04)names(bonds) <-sub('ds\\$', '', names(bonds))bonds <-na.omit(bonds)mtx1 <-cor(bonds[, c(1:15)])
The correlation plot above shows the correlation coefficients between the nine different items (three fusion / identification items each for ingroup and outgroup).
## BCL and BBL items:# BCL_01:# Seek out opportunities to bridge social divisions with their opponents, enemies, opposition groups, or other outgroups. # Variables: Q6.1, Q7.1# BCL_02:# Demonstrate willingness to compromise with their opponents, enemies, opposition groups, or other outgroups. # Variables: Q6.2, Q7.2# BCL_03:# Try to understand and empathize with their opponents, enemies, opposition groups, or other outgroups. # Variables: Q6.3, Q7.3# BBL_01:# Represent the interests of the communities and groups that they belong to even at the cost of other groups.# Variables: Q6.4, Q7.4# BBL_02:# Focus on building stronger connections within the communities and groups they belong to rather than building stronger relationships with other groups across boundaries.# Variables: Q6.5, Q7.5# BBL_03:# Try to gain benefits for the communities and groups they belong to even at the expense of other groups.# Variables: Q6.6, Q7.6ds$ENDBCL01 <-as.numeric(ds$`Q6.1 Leadership Quality`)ds$ENDBCL02 <-as.numeric(ds$`Q6.2 Leadership Quality`)ds$ENDBCL03 <-as.numeric(ds$`Q6.3 Leadership Quality`)ds$ENDBBL01 <-as.numeric(ds$`Q6.4 Leadership Quality`)ds$ENDBBL02 <-as.numeric(ds$`Q6.5 Leadership Quality`)ds$ENDBBL03 <-as.numeric(ds$`Q6.6 Leadership Quality`)ds$EXPBCL01 <-as.numeric(ds$`Q7.1 Leadership Experience`)ds$EXPBCL02 <-as.numeric(ds$`Q7.2 Leadership Experience`)ds$EXPBCL03 <-as.numeric(ds$`Q7.3 Leadership Experience`)ds$EXPBBL01 <-as.numeric(ds$`Q7.4 Leadership Experience`)ds$EXPBBL02 <-as.numeric(ds$`Q7.5 Leadership Experience`)ds$EXPBBL03 <-as.numeric(ds$`Q7.6 Leadership Experience`)leadership <-cbind.data.frame(ds$ENDBCL01, ds$ENDBCL02, ds$ENDBCL03, ds$ENDBBL01, ds$ENDBBL02, ds$ENDBBL03, ds$EXPBCL01, ds$EXPBCL02, ds$EXPBCL03, ds$EXPBBL01, ds$EXPBBL02, ds$EXPBBL03)names(leadership) <-sub('ds\\$', '', names(leadership))leadership <-na.omit(leadership)mtx1 <-cor(leadership[, c(1:12)])
Shorthand for item names: END = Endorse, EXP = Experience BCL = BCL, BBL = BBL So for example: ENDBCL01 = “Endorsement of BCL, item 1” EXPBBL02 = “Experience of BBL, item 2”, and so on
The correlation plot above shows the correlation coefficients between the twelve different items (six for endorsement of BCL/BBL, and six for experience of BCL/BBL).
The general criteria is that KMO needs to be greater than 0.60. Based on the results (overall MSA = 0.76), factor analysis is appropriate.
Bartlett’s test of sphericity
Display code
cortest.bartlett(leadership)
$chisq
[1] 3059
$p.value
[1] 0
$df
[1] 66
The test is significant, again suggesting that factor analysis is appropriate.
Parallel test
Display code
parallel <-fa.parallel(leadership)
Parallel analysis suggests that the number of factors = 4 and the number of components = 3
Based on the scree plot, factor analysis with four factors is the most appropriate. We will proceed with promax rotation, which assumes that the items are inter-correlated (that is, not independent from each other).
Factor analysis: Four factor model with promax rotation
Call:
factanal(x = leadership, factors = 4, rotation = "promax")
Uniquenesses:
ENDBCL01 ENDBCL02 ENDBCL03 ENDBBL01 ENDBBL02 ENDBBL03 EXPBCL01 EXPBCL02
0.54 0.44 0.42 0.27 0.17 0.28 0.29 0.26
EXPBCL03 EXPBBL01 EXPBBL02 EXPBBL03
0.43 0.38 0.21 0.37
Loadings:
Factor1 Factor2 Factor3 Factor4
ENDBCL01 -0.142 0.324 0.384
ENDBCL02 0.746
ENDBCL03 -0.124 0.826
ENDBBL01 0.868
ENDBBL02 0.923
ENDBBL03 0.832
EXPBCL01 0.852
EXPBCL02 0.902
EXPBCL03 0.772
EXPBBL01 0.737
EXPBBL02 0.924
EXPBBL03 0.799
Factor1 Factor2 Factor3 Factor4
SS loadings 2.33 2.28 2.05 1.40
Proportion Var 0.19 0.19 0.17 0.12
Cumulative Var 0.19 0.38 0.56 0.67
Factor Correlations:
Factor1 Factor2 Factor3 Factor4
Factor1 1.000 -0.188 0.427 -0.182
Factor2 -0.188 1.000 0.284 0.505
Factor3 0.427 0.284 1.000 0.155
Factor4 -0.182 0.505 0.155 1.000
Test of the hypothesis that 4 factors are sufficient.
The chi square statistic is 165 on 24 degrees of freedom.
The p-value is 0.000000000000000000000056
Factor analysis interpretation
The promax rotated FA output suggests that there are four factors:
Factor 1 = Endorsement of BBL
Factor 2 = Experience of BCL
Factor 3 = Experience of BBL
Factor 4 = Endorsement of BCL
The four factors cumulatively explain 67% of the variance in the data. Factor 1 explains 19% of the variance, factor 2 explains 19%, factor 3 explains 17%, and factor 4 explains 12% .
The correlation between the four factors in the output above provide some interesting information. The output with existing factor names is a little hard to interpret, so I renamed the factor names to come up with a readable correlation matrix:
### Reliability if each item is dropped:alph04$alpha.drop
raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
EXPBBL01 0.82 0.82 0.69 0.69 4.4 0.017 NA 0.69
EXPBBL02 0.75 0.75 0.60 0.60 3.1 0.022 NA 0.60
EXPBBL03 0.82 0.82 0.70 0.70 4.6 0.016 NA 0.70
Reliability analysis: interpretation
Based on the results above, the four scales have relatively high alpha scores for the most part and there aren’t any “weird” items. However, some scales are more internally consistent than others. Here are the Cronbach’s alpha values for each scale:
Alpha for endorsement of BCL = 0.70. This is the lowest score of all four scales, and it falls below the conventional threshold of 0.80.
Research question: Do group fusion / identification predict BCL vs BBL?
Variables in the analysis:
Eight scales that were calculated based on factor analysis:
Ingroup fusion
Ingroup identification
Outgroup fusion
Outgroup identification
Endorsement of BCL
Endorsement of BBL
Experience of BCL
Experience of BBL
Demographics:
Age
Gender
Marital status
Socio-economic status
Regression models
This set of regression models uses the ingroup fusion/identification with only three items. Since the fourth item on “ingroup identification” scale was problematic, that item was removed. To maintain consistency, the fourth item from the other three scales (ingroup fusion, outgroup fusion, and outgroup identification) are also removed.
## Four regression models predicting endorsement and experience of BCL / BBL:lm01 <-lm(Endorse_BCL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+Age+Female+Married+`SES-`,data = ds)lm02 <-lm(Experience_BCL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+Age+Female+Married+`SES-`, data = ds)lm03 <-lm(Endorse_BBL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+Age+Female+Married+`SES-`, data = ds)lm04 <-lm(Experience_BBL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+Age+Female+Married+`SES-`, data = ds)
This set of regression models use all four items for the the ingroup fusion/identification scales. It only leaves out the ONE problematic “ingroup identification” item. That is, ingroup fusion, outgroup fusion, and outgroup identification have four items, while ingroup identification has three items.
## Four regression models predicting endorsement and experience of BCL / BBL:lm01 <-lm(Endorse_BCL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+Age+Female+Married+`SES-`,data = ds)lm02 <-lm(Experience_BCL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+Age+Female+Married+`SES-`, data = ds)lm03 <-lm(Endorse_BBL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+Age+Female+Married+`SES-`, data = ds)lm04 <-lm(Experience_BBL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+Age+Female+Married+`SES-`, data = ds)
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
1.0 2.0 3.0 3.3 5.0 7.0 6
Display code
ds %>%drop_na(history_discrimination)%>%ggplot(aes(x = history_discrimination))+geom_histogram(color ="black",fill ="gray",bins =20)+geom_textvline(label ="Mean = 3.30", xintercept =3.30, vjust =1.1, lwd =1.05, linetype =2)+labs(x ="Perceived history of discrimination score", y ="Frequency", title ="Perceived history of discrimination")+theme_bw()
This set of regression models have additional predictor variables compared to the last set. It adds empathic concern, perspective taking, and perceived history of discrimination as additional predictors.
## Four regression models predicting endorsement and experience of BCL / BBL:lm01 <-lm(Endorse_BCL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+empathic_concern+perspective_taking+history_discrimination+Age+Female+Married+`SES-`, data = ds)lm02 <-lm(Experience_BCL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+empathic_concern+perspective_taking+history_discrimination+Age+Female+Married+`SES-`, data = ds)lm03 <-lm(Endorse_BBL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+empathic_concern+perspective_taking+history_discrimination+Age+Female+Married+`SES-`, data = ds)lm04 <-lm(Experience_BBL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+empathic_concern+perspective_taking+history_discrimination+Age+Female+Married+`SES-`, data = ds)
Section 9. Alternative regression models with different outcomes
This set of regression models have different outcome variables which are: outgroup cooperation, outgroup hostility, and willingness to fight outgroup.
Display code
## Four regression models predicting endorsement and experience of BCL / BBL:lm01 <-lm(og_cooperation~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+empathic_concern+perspective_taking+history_discrimination+Age+Female+Married+`SES-`, data = ds)lm02 <-lm(og_hostility~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+empathic_concern+perspective_taking+history_discrimination+Age+Female+Married+`SES-`, data = ds)lm03 <-lm(fight_outgroup~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+empathic_concern+perspective_taking+history_discrimination+Age+Female+Married+`SES-`, data = ds)
ds$religious_freedom_per_01 <-as.numeric(ds$`Q16.1 Religious Freedom`)ds$religious_freedom_per_02a <-as.numeric(ds$`Q16.2 Religious Freedom`)ds$religious_freedom_per_02 <- (8- ds$religious_freedom_per_02a)ds$religious_freedom_per_03 <-as.numeric(ds$`Q16.3 Religious Freedom`)ds$religious_freedom_per_04 <-as.numeric(ds$`Q16.4 Religious Freedom`)ds$religious_freedom_per_05 <-as.numeric(ds$`Q16.5 Religious Freedom`)ds$religious_freedom_per_06 <-as.numeric(ds$`Q16.6 Religious Freedom`)ds$religious_freedom_per_07 <-as.numeric(ds$`Q16.7 Religious Freedom`)ds$religious_freedom_per_08 <-as.numeric(ds$`Q16.8 Religious Freedom`)ds$sprf <- (ds$religious_freedom_per_01+ds$religious_freedom_per_02+ ds$religious_freedom_per_03+ds$religious_freedom_per_04+ ds$religious_freedom_per_05+ds$religious_freedom_per_06+ ds$religious_freedom_per_07+ds$religious_freedom_per_08)/8summary(ds$sprf)
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
2.8 5.2 5.5 5.6 6.0 7.0 13
Display code
ds %>%drop_na(sprf)%>%ggplot(aes(x = sprf))+geom_histogram(color ="black",fill ="gray",bins =30)+geom_textvline(label ="Mean = 5.60", xintercept =5.60, vjust =1.1, lwd =1.05, linetype =2)+labs(x ="SPRF score", y ="Frequency", title ="Social perception of religious freedom")+theme_bw()
Experience of religious freedom
Display code
ds$religious_freedom_exp_01a <-as.numeric(ds$`Q17.1 Life experience`)ds$religious_freedom_exp_01 <- (8- ds$religious_freedom_exp_01)ds$religious_freedom_exp_02a <-as.numeric(ds$`Q17.2 Life experience`)ds$religious_freedom_exp_02 <- (8- ds$religious_freedom_exp_02)ds$religious_freedom_exp_03a <-as.numeric(ds$`Q17.3 Life experience`)ds$religious_freedom_exp_03 <- (8- ds$religious_freedom_exp_03)ds$religious_freedom_exp_04a <-as.numeric(ds$`Q17.4 Life experience`)ds$religious_freedom_exp_04 <- (8- ds$religious_freedom_exp_04)ds$religious_freedom_exp_05a <-as.numeric(ds$`Q17.5 Life experience`)ds$religious_freedom_exp_05 <- (8- ds$religious_freedom_exp_05)ds$religious_freedom_exp_06a <-as.numeric(ds$`Q17.6 Life experience`)ds$religious_freedom_exp_06 <- (8- ds$religious_freedom_exp_06)ds$exp_religious_freedom <- (ds$religious_freedom_exp_01+ds$religious_freedom_exp_02+ ds$religious_freedom_exp_03+ds$religious_freedom_exp_04+ ds$religious_freedom_exp_05+ds$religious_freedom_exp_06)/6summary(ds$exp_religious_freedom)
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
1.0 5.5 6.5 6.2 7.0 7.0 8
Display code
ds %>%drop_na(exp_religious_freedom)%>%ggplot(aes(x = exp_religious_freedom))+geom_histogram(color ="black",fill ="gray",bins =30)+geom_textvline(label ="Mean = 5.30", xintercept =5.30, vjust =1.1, lwd =1.05, linetype =2)+labs(x ="Experience of religious freedom score", y ="Frequency", title ="Experience of religious freedom")+theme_bw()
Experience of religious freedom based on religious affiliation
ds %>%drop_na(religion, exp_religious_freedom)%>%ggplot(aes(y = exp_religious_freedom, x = religion))+geom_boxplot()+labs(x ="", y ="Experience of religious freedom score", title ="Experience of religious freedom")+coord_flip()+theme_bw()
Section 11. Positive/Negative contact with outgroup
Call:
factanal(x = ig_marriage, factors = 1, rotation = "promax")
Uniquenesses:
intergroup_marriage_01 intergroup_marriage_02 intergroup_marriage_03
0.25 0.14 0.20
intergroup_marriage_04
0.27
Loadings:
Factor1
intergroup_marriage_01 0.87
intergroup_marriage_02 0.93
intergroup_marriage_03 0.89
intergroup_marriage_04 0.85
Factor1
SS loadings 3.13
Proportion Var 0.78
Test of the hypothesis that 1 factor is sufficient.
The chi square statistic is 117 on 2 degrees of freedom.
The p-value is 0.000000000000000000000000031
Based on the above output for factor analysis and reliability analysis, the “support for intergroup marriage” scale is highly reliable. Here is the visualization for the scale:
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
1.0 5.0 6.0 5.4 6.2 7.0 2
Display code
ds %>%drop_na(endorse_intergroup_marriage)%>%ggplot(aes(x = endorse_intergroup_marriage))+geom_histogram(color ="black",fill ="gray",bins =30)+geom_textvline(label ="Mean = 5.40", xintercept =5.40, vjust =1.1, lwd =1.05, linetype =2)+labs(x ="Intergroup marriage endorsement score", y ="Frequency", title ="Support for intergroup marriage")+theme_bw()
Section 13. Outgroup affect
Outgroup affect: Scale construction
Display code
## Feel outgroup: negative to positive:ds$ogaf1 <- ds$`Q13.1 Feel Outgroup- Negative to Positive`ds$og_aff_01 <-ifelse(ds$ogaf1 =="very negative", "Very negative",ifelse(ds$ogaf1 =="Very negative", "Very negative",ifelse(ds$ogaf1 =="Very Negative", "Very negative",ifelse(ds$ogaf1 =="moderately negative", "Moderately negative",ifelse(ds$ogaf1 =="Moderately negative", "Moderately negative",ifelse(ds$ogaf1 =="Moderately Negative", "Moderately negative",ifelse(ds$ogaf1 =="a little negative", "A little negative",ifelse(ds$ogaf1 =="A little negative", "A little negative",ifelse(ds$ogaf1 =="neutral", "Neutral",ifelse(ds$ogaf1 =="Neutral", "Neutral",ifelse(ds$ogaf1 =="a little positive", "A little positive",ifelse(ds$ogaf1 =="A little positive", "A little positive",ifelse(ds$ogaf1 =="moderately positive", "Moderately positive",ifelse(ds$ogaf1 =="Moderately positive", "Moderately positive",ifelse(ds$ogaf1 =="Moderately Positive", "Moderately positive",ifelse(ds$ogaf1 =="very positive", "Very positive",ifelse(ds$ogaf1 =="Very positive", "Very positive",ifelse(ds$ogaf1 =="Very Positive", "Very positive", NA))))))))))))))))))ds$og_aff_01 <-factor(ds$og_aff_01, levels=c("Very negative", "Moderately negative","A little negative", "Neutral", "A little positive", "Moderately positive", "Very positive"))table(ds$og_aff_01)
Very negative Moderately negative A little negative Neutral
99 29 37 87
A little positive Moderately positive Very positive
194 16 34
Display code
## Feel Outgroup: Hostile to friendly:ds$ogaf2 <- (ds$`Q13.2 Feel Outgroup - Hostile to Friendly`)ds$og_aff_02 <-ifelse(ds$ogaf2 =="very hostile", "Very hostile", ifelse(ds$ogaf2 =="Very hostile", "Very hostile", ifelse(ds$ogaf2 =="Very Hostile", "Very hostile", ifelse(ds$ogaf2 =="moderately Hostile", "Moderately hostile", ifelse(ds$ogaf2 =="Moderately hostile", "Moderately hostile", ifelse(ds$ogaf2 =="Moderately Hostile", "Moderately hostile", ifelse(ds$ogaf2 =="a little hostile", "A little hostile", ifelse(ds$ogaf2 =="A little hostile", "A little hostile", ifelse(ds$ogaf2 =="neutral", "Neutral", ifelse(ds$ogaf2 =="Neutral", "Neutral", ifelse(ds$ogaf2 =="a little friendly", "A little friendly", ifelse(ds$ogaf2 =="A little friendly", "A little friendly", ifelse(ds$ogaf2 =="A little Friendly", "A little friendly", ifelse(ds$ogaf2 =="moderately friendly", "Moderately friendly", ifelse(ds$ogaf2 =="Moderately friendly", "Moderately friendly", ifelse(ds$ogaf2 =="Moderately Friendly", "Moderately friendly", ifelse(ds$ogaf2 =="very friendly", "Very friendly", ifelse(ds$ogaf2 =="Very friendly", "Very friendly", ""))))))))))))))))))ds$og_aff_02 <-factor(ds$og_aff_02, levels =c("Very hostile", "Moderately hostile", "A little hostile", "Neutral", "A little friendly", "Moderately friendly","Very friendly"))table(ds$og_aff_02)
Very hostile Moderately hostile A little hostile Neutral
27 23 40 111
A little friendly Moderately friendly Very friendly
227 29 39
Display code
## Feel Outgroup: Suspicious to trusting:ds$ogaf3 <- ds$`Q13.3 Feel Outgroup - Suspicious to Trusting`ds$og_aff_03 <-ifelse(ds$ogaf3 =="very suspicious", "Very suspicious", ifelse(ds$ogaf3 =="moderately suspicious", "Moderately suspicious",ifelse(ds$ogaf3 =="Moderately suspicious", "Moderately suspicious",ifelse(ds$ogaf3 =="a little suspicious", "A little suspicious",ifelse(ds$ogaf3 =="A little suspicious", "A little suspicious",ifelse(ds$ogaf3 =="A little suspicious", "A little suspicious", ifelse(ds$ogaf3 =="neutral", "Neutral",ifelse(ds$ogaf3 =="Neutral", "Neutral",ifelse(ds$ogaf3 =="a little respect", "A little trusting",ifelse(ds$ogaf3 =="a little trusting", "A little trusting",ifelse(ds$ogaf3 =="A little trusting", "A little trusting", ifelse(ds$ogaf3 =="A little Trusting", "A little trusting",ifelse(ds$ogaf3 =="moderately trusting", "Moderately trusting",ifelse(ds$ogaf3 =="Moderately trusting", "Moderately trusting",ifelse(ds$ogaf3 =="very trusting", "Very trusting",ifelse(ds$ogaf3 =="Very trusting", "Very trusting", NA))))))))))))))))ds$og_aff_03 <-factor(ds$og_aff_03, levels =c("Very suspicious", "Moderately suspicious", "A little suspicious", "Neutral","A little trusting", "Moderately trusting","Very trusting"))table(ds$og_aff_03)
Very suspicious Moderately suspicious A little suspicious
41 26 50
Neutral A little trusting Moderately trusting
125 185 36
Very trusting
33
Display code
## Feel Outgroup: Contempt to respect:ds$ogaf4 <- ds$`Q13.4 Feel Outgroup - Contempt to Respect`ds$og_aff_04 <-ifelse(ds$ogaf4 =="A lot of contempt", "A lot of contempt",ifelse(ds$ogaf4 =="A lot of Contempt", "A lot of contempt",ifelse(ds$ogaf4 =="Moderate contempt", "Moderate contempt",ifelse(ds$ogaf4 =="a little contempt", "A little contempt",ifelse(ds$ogaf4 =="A little contempt", "A little contempt",ifelse(ds$ogaf4 =="neutral", "Neutral",ifelse(ds$ogaf4 =="Neutral", "Neutral",ifelse(ds$ogaf4 =="a little respect", "A little respect",ifelse(ds$ogaf4 =="A little respect", "A little respect",ifelse(ds$ogaf4 =="Moderate respect", "Moderate respect",ifelse(ds$ogaf4 =="a lot of respect", "A lot of respect",ifelse(ds$ogaf4 =="A lot of respect", "A lot of respect", NA))))))))))))ds$og_aff_04 <-factor(ds$og_aff_04, levels =c("A lot of contempt", "Moderate contempt","A little contempt", "Neutral", "A little respect", "Moderate respect","A lot of respect"))table(ds$og_aff_04)
A lot of contempt Moderate contempt A little contempt Neutral
35 19 45 82
A little respect Moderate respect A lot of respect
155 81 78
Display code
## Feel Outgroup: Concerned to Unconcerned:ds$ogaf5 <- ds$`Q13.5 Feel Outgroup - Concerned to Unconcerned`table(ds$ogaf5)
a little concerned A little concerned A little uconcerned
2 113 1
a little unconcerned A little unconcerned moderately concerned
4 32 20
Moderately concerned Moderately unconcerned N/A
28 13 4
neutral Neutral very concerned
9 175 38
Very concerned Very Concerned very unconcerned
24 1 35
Very unconcerned
1
Display code
ds$og_aff_05 <-ifelse(ds$ogaf5 =="very concerned", "Very concerned",ifelse(ds$ogaf5 =="Very concerned", "Very concerned", ifelse(ds$ogaf5 =="Very Concerned", "Very concerned", ifelse(ds$ogaf5 =="moderately concerned", "Moderately concerned", ifelse(ds$ogaf5 =="Moderately concerned", "Moderately concerned", ifelse(ds$ogaf5 =="a little concerned", "A little concerned",ifelse(ds$ogaf5 =="A little concerned", "A little concerned", ifelse(ds$ogaf5 =="neutral", "Neutral", ifelse(ds$ogaf5 =="Neutral", "Neutral", ifelse(ds$ogaf5 =="A little uconcerned", "A little unconcerned", ifelse(ds$ogaf5 =="a little unconcerned", "A little unconcerned",ifelse(ds$ogaf5 =="A little unconcerned", "A little unconcerned", ifelse(ds$ogaf5 =="Moderately unconcerned", "Moderately unconcerned", ifelse(ds$ogaf5 =="very unconcerned", "Very unconcerned", ifelse(ds$ogaf5 =="Very unconcerned", "Very unconcerned", NA)))))))))))))))ds$og_aff_05 <-factor(ds$og_aff_05, levels =c("Very concerned", "Moderately concerned", "A little concerned", "Neutral","A little unconcerned", "Moderately unconcerned","Very unconcerned"))table(ds$og_aff_05)
Very concerned Moderately concerned A little concerned
63 48 115
Neutral A little unconcerned Moderately unconcerned
184 37 13
Very unconcerned
36
Display code
## Feel Outgroup: Threatened to Relaxed:ds$ogaf6 <- ds$`Q13.6 Feel Outgroup - Threatened to Relaxed`## convert first character only to upper case:ds$ogaf6a <-gsub("(\\D)(\\D+)", "\\U\\1\\L\\2", ds$ogaf6, perl =TRUE)ds$og_aff_06 <-ifelse(ds$ogaf6a =="Alittle relaxed", "A little relaxed", ifelse(ds$ogaf6a =="N/a", NA, ifelse(ds$ogaf6a =="Never", NA,ds$ogaf6a)))ds$og_aff_06 <-factor(ds$og_aff_06, levels =c("Very threatened", "Moderately threatened", "A little threatened", "Neutral", "A little relaxed", "Moderately relaxed", "Very relaxed"))table(ds$og_aff_06)
Very threatened Moderately threatened A little threatened
35 16 32
Neutral A little relaxed Moderately relaxed
154 174 26
Very relaxed
58
Call:
factanal(x = og_affect, factors = 1, rotation = "promax")
Uniquenesses:
NegativeToPositive HostileToFriendly SuspiciousToTrusting
0.31 0.20 0.22
ContemptToRespect ConcernedToUnconcerned ThreatenedToRelaxed
0.30 1.00 0.45
Loadings:
Factor1
NegativeToPositive 0.829
HostileToFriendly 0.894
SuspiciousToTrusting 0.882
ContemptToRespect 0.834
ConcernedToUnconcerned
ThreatenedToRelaxed 0.741
Factor1
SS loadings 3.51
Proportion Var 0.58
Test of the hypothesis that 1 factor is sufficient.
The chi square statistic is 32 on 9 degrees of freedom.
The p-value is 0.00018
Display code
## Reliability analysispsych::alpha(og_affect)
Some items ( ConcernedToUnconcerned ) were negatively correlated with the total scale and
probably should be reversed.
To do this, run the function again with the 'check.keys=TRUE' option
Based on the output of factor analysis as well as reliability, it seems like one item (“concerned to unconcerned”) is problematic. Here is the scale without that item:
Based on the above output for factor analysis and reliability analysis, the “outgroup affect” scale is highly reliable if we drop the problematic item (“concerned to unconcerned”). Here is the visualization for the scale after dropping the problematic item:
This set of regression models have additional predictors: frequency of positive and negative contact, and interaction between perspective taking and perceived history of discrimination
Display code
ds$freq_positive_contact <- ds$pc02ds$freq_negative_contact <- ds$nc02ds$perspectiveXdiscrimination <- ds$perspective_taking*ds$history_discrimination## Four regression models predicting endorsement and experience of BCL / BBL:lm01 <-lm(Endorse_BCL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+freq_positive_contact+freq_negative_contact+empathic_concern+perspective_taking+history_discrimination+perspectiveXdiscrimination+Age+Female+Married+`SES-`, data = ds)lm02 <-lm(Experience_BCL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+freq_positive_contact+freq_negative_contact+empathic_concern+perspective_taking+history_discrimination+perspectiveXdiscrimination+Age+Female+Married+`SES-`, data = ds)lm03 <-lm(Endorse_BBL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+freq_positive_contact+freq_negative_contact+empathic_concern+perspective_taking+history_discrimination+perspectiveXdiscrimination+Age+Female+Married+`SES-`, data = ds)lm04 <-lm(Experience_BBL~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+freq_positive_contact+freq_negative_contact+empathic_concern+perspective_taking+history_discrimination+perspectiveXdiscrimination+Age+Female+Married+`SES-`, data = ds)
Same predictors as section 14 above, but with different outcomes. This set of regression models has an additional outcome variable: affect towards outgroup.
Display code
## Four regression models:lm01 <-lm(og_cooperation~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+freq_positive_contact+freq_negative_contact+empathic_concern+perspective_taking+history_discrimination+perspectiveXdiscrimination+Age+Female+Married+`SES-`, data = ds)lm02 <-lm(og_hostility~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+freq_positive_contact+freq_negative_contact+empathic_concern+perspective_taking+history_discrimination+perspectiveXdiscrimination+Age+Female+Married+`SES-`, data = ds)lm03 <-lm(fight_outgroup~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+freq_positive_contact+freq_negative_contact+empathic_concern+perspective_taking+history_discrimination+perspectiveXdiscrimination+Age+Female+Married+`SES-`, data = ds)lm04 <-lm(og_affect~IG_Fusion+IG_Identification+OG_Fusion+OG_Identification+freq_positive_contact+freq_negative_contact+empathic_concern+perspective_taking+history_discrimination+perspectiveXdiscrimination+Age+Female+Married+`SES-`, data = ds)
Some items ( ds$event_negative_affect ) were negatively correlated with the total scale and
probably should be reversed.
To do this, run the function again with the 'check.keys=TRUE' option
Below are the individual Cronbach’s alpha for each of the seven subscales, followed by their individual visualizations, followed by the correlation between the seven sub-scales
## Import text related datasets:bing <-as.data.table(get_sentiments("bing"))stopwords <-as.data.table(stop_words)## Corpus of most common words:corpus1 <- ds %>%unnest_tokens(word, description)corpus1 <-as.data.table(corpus1)stopwords <-as.data.table(stopwords)## Remove stop words:corpus1 <- corpus1[!stopwords, on ="word"]## Merge corpus with data:df2 <-merge(corpus1, bing, by ="word")
Word cloud: Full sample
Display code
a <-sort(table(corpus1$word), decreasing = T)tblwc <-as.data.table(a)head(tblwc, n =15)
V1 N
1: church 327
2: life 234
3: people 226
4: day 223
5: home 178
6: school 147
7: children 144
8: husband 134
9: family 128
10: event 113
11: married 112
12: forget 107
13: money 107
14: time 105
15: community 101
corpus2 <- corpus1[corpus1$ethnicity=="Bantu",]a <-sort(table(corpus2$word), decreasing = T)tblwc <-as.data.table(a)head(tblwc, n =15)
V1 N
1: church 44
2: life 32
3: children 29
4: day 28
5: home 28
6: people 21
7: school 21
8: husband 20
9: money 18
10: time 17
11: god 16
12: forget 15
13: lot 15
14: started 15
15: community 14
corpus2 <- corpus1[corpus1$ethnicity=="Luo",]a <-sort(table(corpus2$word), decreasing = T)tblwc <-as.data.table(a)head(tblwc, n =15)
V1 N
1: church 123
2: day 104
3: people 88
4: life 77
5: home 66
6: time 52
7: forget 51
8: school 49
9: event 47
10: family 47
11: married 46
12: money 46
13: children 44
14: lot 41
15: happy 39
corpus2 <- corpus1[corpus1$ethnicity=="Nilotic",]a <-sort(table(corpus2$word), decreasing = T)tblwc <-as.data.table(a)head(tblwc, n =15)
V1 N
1: church 156
2: life 120
3: people 115
4: day 89
5: home 82
6: school 75
7: husband 73
8: children 68
9: family 66
10: event 51
11: community 49
12: married 48
13: god 41
14: money 41
15: forget 40
Social perception of religious freedom
Display code
Display code