library(rio)
library(ggplot2)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(rjson)
library(pander)

input1 <- rjson::fromJSON(file = "data1.json")
input2 <- rjson::fromJSON(file = "data2.json")

output1 <- import("output1.csv")
output2 <- import("output2.csv")

myScale <- c("gray", "black")

Figure 1

beliefs1 <- lapply(input1, function(x) {
  x$inferences %>% unlist() %>% unname() %>% unique() -> b
  data.frame(respondent = x$name, beliefs = b)
}) %>% bind_rows() %>% 
  mutate(beliefsRC = recode(beliefs, "support-from-the-people-for-peaceful-activity-against-home-state" = "public-support-for-nonviolent-dissent",
                            "insufficiency-of-activity-inside-state-structure" = "insufficiency-of-peaceful-activity-against-home-state",
                            "self-conviction" = "self-efficacy",
                            "peaceful-activity" = "private-peaceful-activity",
                            "acceptance-of-negative-consequences-of-violence" = "acceptance-of-consequences-of-violence",
                            "absence-of-acceptance-of-negative-consequences-of-violence" = "absence-of-acceptance-of-consequences-of-violence"
  ))

beliefs1$beliefsRC <- gsub("[[:punct:]]", " ", beliefs1$beliefsRC)

beliefs1 %>%
  group_by(beliefsRC) %>%
  summarise(nobs = length(beliefsRC)) %>%
  filter(beliefsRC != "nv" & beliefsRC != "v") %>%
  filter(nobs > 5) %>%
  ggplot(aes(x = reorder(beliefsRC, nobs), y = nobs)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  labs(x = "", y = "",
       title = "Unique beliefs in dataset 1 (>5)") +
  theme_minimal()

table(beliefs1$beliefsRC) %>% sort(decreasing = TRUE) %>% pander()
Table continues below
aggression by home state peaceful activity against home state
25 24
Table continues below
domination by home state transformatory goal
22 22
Table continues below
support for violence in direct environment negative consequences of violence
18 17
Table continues below
continuation of aggression by home state duty for action against home state nv
14 14 14
Table continues below
private peaceful activity absence of peaceful means
14 13
Table continues below
existence of violence against home state v imperialism political goal
13 13 12 12
Table continues below
impossibility of reaching goals by violence private goal continuation of peaceful activity against home state
11 10 9
Table continues below
existence of peaceful activity against home state possibility of reaching goals by peaceful means
9 9
Table continues below
strength of resistance against home state absence of success of peaceful activity against home state
9 8
Table continues below
absence of success of violence education during childhood
8 8
Table continues below
possibility for violence possibility of reaching goals by violence self efficacy
8 8 8
Table continues below
strained living conditions strength of home state absence of acceptance of consequences of violence
8 8 7
Table continues below
acceptance of consequences of violence domination by previous state
7 7
Table continues below
ignorance of fellow citizens insufficiency of activity inside state structures obedience to god
7 7 7
Table continues below
public support for nonviolent dissent absence of approval for violence by the people interest in politics
7 6 6
Table continues below
necessity for violence success of peaceful activity
6 6
Table continues below
absence of domination by home state absence of strength of home state
5 5
Table continues below
aggression by foreign state experience of violence
5 5
Table continues below
impossibility of accepting home state strength of international resistance against state system
5 5
Table continues below
absence of success of peaceful activity absolute priority of transformatory goal
4 4
Table continues below
acceptance of state structures existence of international resistance against state system
4 4
Table continues below
negative experience in state system unreligious state weakness of home state
4 4 4
Table continues below
absence of state structures education of the people
3 3
Table continues below
indispensability of state structures negative consequences of absence of state structures
3 3
Table continues below
negative consequences of victory of the resistance in foreign state priority of goal opposing violence
3 3
Table continues below
superiority of state structures absence of acceptance of home state
3 2
Table continues below
absence of aggression by home state absence of necessity for violence acceptance of state representatives
2 2 2
Table continues below
change of home state disunity of muslims existence of absolute priority of transformatory goal
2 2 2
Table continues below
illegal activity negative consequences of absence of action against home state peaceful activity against foreign state
2 2 2
Table continues below
peaceful activity supporting home state possibility for nonviolence
2 2
Table continues below
support from the people for violence weakness of resistance against home state
2 2
Table continues below
absence of absolute priority of political goal absence of acceptance of aggression by home state
1 1
Table continues below
absence of action against home state absence of domination by foreign state
1 1
Table continues below
absence of education during childhood absence of interest in politics
1 1
Table continues below
absence of support for violence in direct environment absolute priority of private goal
1 1
Table continues below
acceptance of state aggression aggression by previous state alternative
1 1 1
Table continues below
avoidance of negative consequences of violence dislike of violence distance from social structures
1 1 1
Table continues below
efficient structure of violent group enjoyment of violence
1 1
Table continues below
existence of violence against foreign state goal opposing violence gods might
1 1 1
Table continues below
importance of the people joining the army personal problems
1 1 1
Table continues below
refusal to join army religious state strength of foreign state
1 1 1
Table continues below
success of peaceful activity against home state support by home state
1 1
Table continues below
support from foreign state for peaceful activity against home state victory of resistance against state system
1 1
Table continues below
weakness of foreign state weakness of human beings
1 1
weakness of international resistance against state system weakness of will
1 1
table(table(beliefs1$beliefsRC) <= 5) %>% pander()
FALSE TRUE
40 67

Figure 2

beliefs2 <- lapply(input2, function(x) {
  x$inferences %>% unlist() %>% unname() %>% unique() -> b
  data.frame(respondent = x$name, beliefs = b[!b %in% c("v", "nv")])
}) %>% bind_rows()  %>% mutate(
  beliefsRC = na_if(recode(beliefs,
                           "2011" = "revolution abroad",
                           "crimeG" = "state crime",
                           "poorLC" = "poverty",
                           "satisf" = "satisfaction",
                           "effHS" = "state effort",
                           "approvHS" = "state approval",
                           "needchange" = "need for political change",
                           "job" = "employment",
                           "changeHS" = "change of government",
                           "vioG" = "state violence",
                           "intE" = "international influence",
                           "vioAB" = "violence abroad",
                           "approvPRO" = "protest approval",
                           "NOhope" = "hopelessness",
                           "improvLC" = "improved living conditions",
                           "supportPRO" = "protest support",
                           "NOapprovHS" = "state disapproval",
                           "interactPRO" = "interaction protestors",
                           "goodpersHS" = "positive character head of state",
                           "strengthHS" = "state strength",
                           "NOresultPRO" = "lack of prior protest result",
                           "priorprotest" = "prior protest",
                           "goodLC" = "good living conditions",
                           "crimePG" = "previous state crime",
                           "NOapprovPRO" = "protest disapproval",
                           "prideNAT" = "pride",
                           "NOunityPP" = "lack of unity among the people",
                           "vioPG" = "previous state violence",
                           "protectA" = "protection by army",
                           "prioS" = "personal priority",
                           "NOneedPART" = "no need for dissent",
                           "badpersPP" = "negative personality of the people",
                           "P-M-2010" = "Other",
                           "NP-E-2011" = "Other",
                           "P-E-2011" = "Other",
                           "NP-E-2014" = "Other",
                           "P-M-2011" = "Other",
                           "P-E-2013" = "Other",
                           "NP-M-2014" = "Other"),
                    "Other"
  ))

# number of unique beliefs length(unique(groupedData$V2_new))

beliefs2 %>%
  group_by(beliefsRC) %>%
  summarise(nobs = length(beliefsRC)) %>%
  filter(beliefsRC != "nv" & beliefsRC != "v") %>%
  filter(nobs > 8) %>%
  ggplot(aes(x = reorder(beliefsRC, nobs), y = nobs)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  labs(x = "", y = "",
       title = "Unique beliefs in dataset 2 (>8)") +
  theme_minimal()

table(beliefs2$beliefsRC) %>% sort(decreasing = TRUE) %>% pander()
Table continues below
state crime poverty protest revolution abroad safety family
50 49 45 28 28 27
Table continues below
satisfaction state effort hope state approval employment
27 24 23 23 20
Table continues below
need for political change change of government history state violence
20 18 17 17
Table continues below
prior protest protest approval fear hopelessness
15 14 13 13
Table continues below
improved living conditions international influence interaction protestors
13 13 12
Table continues below
positive character head of state protest support state disapproval
12 12 12
Table continues below
lack of prior protest result media previous state crime state strength
11 11 11 11
Table continues below
violence abroad courage good living conditions protest disapproval
11 10 10 10
Table continues below
lack of unity among the people pride solidarity previous state violence
9 9 9 8
Table continues below
religion improvPOL negative personality of the people no need for dissent
8 7 7 7
Table continues below
personal priority protection by army NOskillsPRO unityPP dirE
7 7 6 6 5
Table continues below
ignorance NOalt NOapprovPHS NOsafety selfsacrifice strengthG
5 5 5 5 5 5
Table continues below
approvPHS goodpersPP jobavail needstrength NOinterestPOL P-M-2014
4 4 4 4 4 4
Table continues below
prioSAF strengthE strengthPRO ageHS badpersHS conspir deterioPOL
4 4 4 3 3 3 3
Table continues below
effS election humanN modesty moraloutrage needunityPP NOapprovSON
3 3 3 3 3 3 3
Table continues below
NOfreePRESS NOsatisf passpowerSON persS resistA uncertainty
3 3 3 3 3 3
Table continues below
friends NOkingdomE NOstrengthPRO strengthPP successPRO supA
2 2 2 2 2 2
Table continues below
surprise badperSON badpersPHS crimeA crimePP curiosity diversity
2 1 1 1 1 1 1
Table continues below
effPP experFRI freedom freePRESS godsmight goodpersS interestPOL
1 1 1 1 1 1 1
Table continues below
isoPHS needchangePP needcourage needsolidarity NOapprovPPHS NOeffHS
1 1 1 1 1 1
Table continues below
NOeffPP NOimpIND NOimprov NOjob NOpersPHS NOpriorprotest NOprioS
1 1 1 1 1 1 1
Table continues below
NOreligion NOresponscrimHS NOskillPHS NOskillsPG NOskillsPP
1 1 1 1 1
Table continues below
NOsuccessPRIV NOsupportPRO NOsystem NP-E-2013 obediencePP P-E-2010
1 1 1 1 1 1
Table continues below
P-E-2014 P-M-2012 possibilityPRO protectPRO religextreme skillsHS
1 1 1 1 1 1
skillsPRO strengthA strengthPHS supportS vioPRO vioSON
1 1 1 1 1 1
table(table(beliefs2$beliefsRC) <= 8) %>% pander()
FALSE TRUE
36 98

Figure 3

ggplot(output1 %>% 
         mutate(g = recode(`continuation-of-aggression-by-home-state`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = a, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale)  

ggplot(output1 %>% 
         mutate(g = recode(`aggression-by-home-state`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = a, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale)  

ggplot(output1 %>% 
         mutate(g = recode(`domination-by-home-state`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = a, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale) 

ggplot(output1 %>% 
         mutate(g = recode(`continuation-of-aggression-by-home-state`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = na, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale)  

ggplot(output1 %>% 
         mutate(g = recode(`aggression-by-home-state`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = na, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale)  

ggplot(output1 %>% 
         mutate(g = recode(`domination-by-home-state`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = na, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale)  

Figure 4.1

ggplot(output2 %>% 
         mutate(g = recode(`crimeG`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = a, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale)  

ggplot(output2 %>% 
         mutate(g = recode(`vioG`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = a, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale)  

ggplot(output2 %>% 
         mutate(g = recode(`crimeG`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = na, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale)  

ggplot(output2 %>% 
         mutate(g = recode(`vioG`, 
                           `0` = "activated belief", 
                           `1` = "removed belief")),
       aes(x = na, fill = g, col = g)) +
  geom_bar(position = position_dodge2(preserve = "single")) +
  theme(panel.background = element_rect(fill = 'white', colour = 'black'), 
        legend.position = "bottom") +
  labs(fill = "", col = "", x = "decision counts", y = "number of runs") +
  scale_fill_manual(values = myScale) +
  scale_color_manual(values = myScale)  

Table 1

# data1
output1 %>% group_by(`aggression-by-home-state`) %>% summarise(mu_a = mean(a)) %>% print()
## # A tibble: 2 × 2
##   `aggression-by-home-state`  mu_a
##                        <int> <dbl>
## 1                          0  9   
## 2                          1  3.75
output1 %>% group_by(`continuation-of-aggression-by-home-state`) %>% summarise(mu_a = mean(a))
## # A tibble: 2 × 2
##   `continuation-of-aggression-by-home-state`  mu_a
##                                        <int> <dbl>
## 1                                          0  8.38
## 2                                          1  4.38
output1 %>% group_by(`domination-by-home-state`) %>% summarise(mu_a = mean(a))
## # A tibble: 2 × 2
##   `domination-by-home-state`  mu_a
##                        <int> <dbl>
## 1                          0  7.56
## 2                          1  5.19
output1 %>% group_by(`education-of-the-people`) %>% summarise(mu_a = mean(a))
## # A tibble: 2 × 2
##   `education-of-the-people`  mu_a
##                       <int> <dbl>
## 1                         0  6.38
## 2                         1  6.38
output1 %>% group_by(`religious-state`) %>% summarise(mu_a = mean(a))
## # A tibble: 2 × 2
##   `religious-state`  mu_a
##               <int> <dbl>
## 1                 0  6.38
## 2                 1  6.38
output1 %>% group_by(`unreligious-state`) %>% summarise(mu_a = mean(a))
## # A tibble: 2 × 2
##   `unreligious-state`  mu_a
##                 <int> <dbl>
## 1                   0  6.5 
## 2                   1  6.25
output1 %>% group_by(`aggression-by-home-state`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   `aggression-by-home-state` mu_na
##                        <int> <dbl>
## 1                          0 10   
## 2                          1  6.62
output1 %>% group_by(`continuation-of-aggression-by-home-state`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   `continuation-of-aggression-by-home-state` mu_na
##                                        <int> <dbl>
## 1                                          0  8.56
## 2                                          1  8.06
output1 %>% group_by(`domination-by-home-state`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   `domination-by-home-state` mu_na
##                        <int> <dbl>
## 1                          0 10.4 
## 2                          1  6.25
output1 %>% group_by(`education-of-the-people`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   `education-of-the-people` mu_na
##                       <int> <dbl>
## 1                         0  8.88
## 2                         1  7.75
output1 %>% group_by(`religious-state`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   `religious-state` mu_na
##               <int> <dbl>
## 1                 0  8.56
## 2                 1  8.06
output1 %>% group_by(`unreligious-state`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   `unreligious-state` mu_na
##                 <int> <dbl>
## 1                   0  8.5 
## 2                   1  8.12
#data 2
output2 %>% group_by(`crimeG`) %>% summarise(mu_p = mean(a))
## # A tibble: 2 × 2
##   crimeG  mu_p
##    <int> <dbl>
## 1      0 26.8 
## 2      1  9.69
output2 %>% group_by(`vioG`) %>% summarise(mu_p = mean(a))
## # A tibble: 2 × 2
##    vioG  mu_p
##   <int> <dbl>
## 1     0  19.9
## 2     1  16.6
output2 %>% group_by(`protest`) %>% summarise(mu_p = mean(a))
## # A tibble: 2 × 2
##   protest  mu_p
##     <int> <dbl>
## 1       0  21.6
## 2       1  14.9
output2 %>% group_by(`interactPRO`) %>% summarise(mu_p = mean(a))
## # A tibble: 2 × 2
##   interactPRO  mu_p
##         <int> <dbl>
## 1           0  19.5
## 2           1  17.0
output2 %>% group_by(`2011`) %>% summarise(mu_p = mean(a))
## # A tibble: 2 × 2
##   `2011`  mu_p
##    <int> <dbl>
## 1      0  20.5
## 2      1  16
output2 %>% group_by(`intE`) %>% summarise(mu_p = mean(a))
## # A tibble: 2 × 2
##    intE  mu_p
##   <int> <dbl>
## 1     0  18.6
## 2     1  17.9
output2 %>% group_by(`poorLC`) %>% summarise(mu_p = mean(a))
## # A tibble: 2 × 2
##   poorLC  mu_p
##    <int> <dbl>
## 1      0  20.0
## 2      1  16.5
output2 %>% group_by(`safety`) %>% summarise(mu_p = mean(a))
## # A tibble: 2 × 2
##   safety  mu_p
##    <int> <dbl>
## 1      0  18.3
## 2      1  18.3
output2 %>% group_by(`crimeG`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   crimeG mu_na
##    <int> <dbl>
## 1      0  34.6
## 2      1  29.0
output2 %>% group_by(`vioG`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##    vioG mu_na
##   <int> <dbl>
## 1     0  32.6
## 2     1  31.0
output2 %>% group_by(`protest`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   protest mu_na
##     <int> <dbl>
## 1       0  33.4
## 2       1  30.2
output2 %>% group_by(`interactPRO`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   interactPRO mu_na
##         <int> <dbl>
## 1           0  32.1
## 2           1  31.5
output2 %>% group_by(`2011`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   `2011` mu_na
##    <int> <dbl>
## 1      0  33.2
## 2      1  30.4
output2 %>% group_by(`intE`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##    intE mu_na
##   <int> <dbl>
## 1     0  32.8
## 2     1  30.8
output2 %>% group_by(`poorLC`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   poorLC mu_na
##    <int> <dbl>
## 1      0  35.6
## 2      1  27.9
output2 %>% group_by(`safety`) %>% summarise(mu_na = mean(na))
## # A tibble: 2 × 2
##   safety mu_na
##    <int> <dbl>
## 1      0  34.6
## 2      1  29.0
#violent dissidents data 1
t.test(a ~ `continuation-of-aggression-by-home-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  a by continuation-of-aggression-by-home-state
## t = 238.68, df = 122683, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  3.967153 4.032847
## sample estimates:
## mean in group 0 mean in group 1 
##           8.375           4.375
t.test(a ~ `aggression-by-home-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  a by aggression-by-home-state
## t = 378.25, df = 117018, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  5.222796 5.277204
## sample estimates:
## mean in group 0 mean in group 1 
##            9.00            3.75
t.test(a ~ `domination-by-home-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  a by domination-by-home-state
## t = 125.19, df = 130721, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  2.337817 2.412183
## sample estimates:
## mean in group 0 mean in group 1 
##          7.5625          5.1875
t.test(a ~ `education-of-the-people`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  a by education-of-the-people
## t = 0, df = 131070, p-value = 1
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -0.03934312  0.03934312
## sample estimates:
## mean in group 0 mean in group 1 
##           6.375           6.375
t.test(a ~ `religious-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  a by religious-state
## t = 0, df = 131070, p-value = 1
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -0.03934312  0.03934312
## sample estimates:
## mean in group 0 mean in group 1 
##           6.375           6.375
t.test(a ~ `unreligious-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  a by unreligious-state
## t = 12.462, df = 130273, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  0.2106802 0.2893198
## sample estimates:
## mean in group 0 mean in group 1 
##            6.50            6.25
#nonviolent dissidents data 1
t.test(na ~ `continuation-of-aggression-by-home-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  na by continuation-of-aggression-by-home-state
## t = 29.715, df = 130950, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  0.4670206 0.5329794
## sample estimates:
## mean in group 0 mean in group 1 
##          8.5625          8.0625
t.test(na ~ `aggression-by-home-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  na by aggression-by-home-state
## t = 239.77, df = 116046, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  3.347412 3.402588
## sample estimates:
## mean in group 0 mean in group 1 
##          10.000           6.625
t.test(na ~ `domination-by-home-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  na by domination-by-home-state
## t = 331.1, df = 115272, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  4.100582 4.149418
## sample estimates:
## mean in group 0 mean in group 1 
##          10.375           6.250
t.test(na ~ `education-of-the-people`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  na by education-of-the-people
## t = 67.794, df = 130490, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  1.092475 1.157525
## sample estimates:
## mean in group 0 mean in group 1 
##           8.875           7.750
t.test(na ~ `religious-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  na by religious-state
## t = 29.715, df = 129995, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  0.4670206 0.5329794
## sample estimates:
## mean in group 0 mean in group 1 
##          8.5625          8.0625
t.test(na ~ `unreligious-state`, data = output1)
## 
##  Welch Two Sample t-test
## 
## data:  na by unreligious-state
## t = 22.254, df = 131029, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  0.3419721 0.4080279
## sample estimates:
## mean in group 0 mean in group 1 
##           8.500           8.125
#nonviolent dissidents data 2
t.test(a ~ `crimeG`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  a by crimeG
## t = 544.51, df = 99345, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  17.07893 17.20232
## sample estimates:
## mean in group 0 mean in group 1 
##        26.82812         9.68750
t.test(a ~ `vioG`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  a by vioG
## t = 60.176, df = 129599, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  3.265074 3.484926
## sample estimates:
## mean in group 0 mean in group 1 
##        19.94531        16.57031
t.test(a ~ `protest`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  a by protest
## t = 124.37, df = 118615, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  6.582111 6.792889
## sample estimates:
## mean in group 0 mean in group 1 
##        21.60156        14.91406
t.test(a ~ `interactPRO`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  a by interactPRO
## t = 45.424, df = 129863, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  2.451933 2.673067
## sample estimates:
## mean in group 0 mean in group 1 
##        19.53906        16.97656
t.test(a ~ `2011`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  a by 2011
## t = 81.407, df = 123796, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  4.406905 4.624345
## sample estimates:
## mean in group 0 mean in group 1 
##        20.51562        16.00000
t.test(a ~ `intE`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  a by intE
## t = 13.2, df = 131051, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  0.6386396 0.8613604
## sample estimates:
## mean in group 0 mean in group 1 
##        18.63281        17.88281
t.test(a ~ `poorLC`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  a by poorLC
## t = 61.322, df = 130695, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  3.327631 3.547369
## sample estimates:
## mean in group 0 mean in group 1 
##        19.97656        16.53906
t.test(a ~ `safety`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  a by safety
## t = 0, df = 131070, p-value = 1
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  -0.1114344  0.1114344
## sample estimates:
## mean in group 0 mean in group 1 
##        18.25781        18.25781
#nondissidents, data 2
t.test(na ~ `crimeG`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  na by crimeG
## t = 137.13, df = 129397, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  5.482995 5.642005
## sample estimates:
## mean in group 0 mean in group 1 
##        34.57031        29.00781
t.test(na ~ `vioG`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  na by vioG
## t = 36.933, df = 130826, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  1.509172 1.678328
## sample estimates:
## mean in group 0 mean in group 1 
##        32.58594        30.99219
t.test(na ~ `protest`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  na by protest
## t = 75.815, df = 126798, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  3.135538 3.301962
## sample estimates:
## mean in group 0 mean in group 1 
##        33.39844        30.17969
t.test(na ~ `interactPRO`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  na by interactPRO
## t = 14.42, df = 130956, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  0.5400502 0.7099498
## sample estimates:
## mean in group 0 mean in group 1 
##        32.10156        31.47656
t.test(na ~ `2011`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  na by 2011
## t = 66.283, df = 130557, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  2.744498 2.911752
## sample estimates:
## mean in group 0 mean in group 1 
##        33.20312        30.37500
t.test(na ~ `intE`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  na by intE
## t = 46.856, df = 131049, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  1.931311 2.099939
## sample estimates:
## mean in group 0 mean in group 1 
##        32.79688        30.78125
t.test(na ~ `poorLC`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  na by poorLC
## t = 204.33, df = 118210, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  7.644711 7.792789
## sample estimates:
## mean in group 0 mean in group 1 
##        35.64844        27.92969
t.test(na ~ `safety`, data = output2)
## 
##  Welch Two Sample t-test
## 
## data:  na by safety
## t = 140.22, df = 124555, p-value < 2.2e-16
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
##  5.592597 5.751153
## sample estimates:
## mean in group 0 mean in group 1 
##        34.62500        28.95312

Appendix graphs

beliefs1$group <- "Violent"
beliefs1$group[grep("^NV", beliefs1$respondent)] <- "Non-violent"

beliefs1 %>%
  group_by(beliefsRC, group) %>%
  summarise(nobs = length(beliefsRC)) %>%
  filter(beliefsRC != "nv" & beliefsRC != "v") %>%
  filter(group == "Violent") %>%
  filter(nobs > 3) %>%
  ggplot(aes(x = reorder(beliefsRC, nobs), y = nobs)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  labs(x = "", y = "",
       title = "Unique beliefs, violent dissidents (>3, dataset 1)") +
  theme_minimal()
## `summarise()` has grouped output by 'beliefsRC'. You can override using the
## `.groups` argument.

beliefs1 %>%
  group_by(beliefsRC, group) %>%
  summarise(nobs = length(beliefsRC)) %>%
  filter(beliefsRC != "nv" & beliefsRC != "v") %>%
  filter(group == "Non-violent") %>%
  filter(nobs > 3) %>%
  ggplot(aes(x = reorder(beliefsRC, nobs), y = nobs)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  labs(x = "", y = "",
       title = "Unique beliefs, nonviolent dissidents (>3, dataset 1)") +
  theme_minimal()
## `summarise()` has grouped output by 'beliefsRC'. You can override using the
## `.groups` argument.

beliefs1 %>% filter(!beliefsRC %in% c("nv", "v")) %>%  group_by(group, beliefsRC) %>% summarise(cnt = length(beliefsRC)) %>% arrange(group, desc(cnt)) %>% pander()
## `summarise()` has grouped output by 'group'. You can override using the
## `.groups` argument.
group beliefsRC cnt
Non-violent peaceful activity against home state 13
Non-violent aggression by home state 12
Non-violent domination by home state 11
Non-violent impossibility of reaching goals by violence 10
Non-violent negative consequences of violence 10
Non-violent transformatory goal 10
Non-violent existence of violence against home state 9
Non-violent possibility of reaching goals by peaceful means 9
Non-violent private peaceful activity 9
Non-violent duty for action against home state 8
Non-violent absence of acceptance of consequences of violence 7
Non-violent absence of success of violence 7
Non-violent imperialism 7
Non-violent public support for nonviolent dissent 7
Non-violent support for violence in direct environment 7
Non-violent continuation of aggression by home state 6
Non-violent political goal 6
Non-violent possibility for violence 6
Non-violent private goal 6
Non-violent absence of success of peaceful activity against home state 5
Non-violent continuation of peaceful activity against home state 5
Non-violent ignorance of fellow citizens 5
Non-violent strength of home state 5
Non-violent absence of approval for violence by the people 4
Non-violent domination by previous state 4
Non-violent education during childhood 4
Non-violent existence of peaceful activity against home state 4
Non-violent interest in politics 4
Non-violent obedience to god 4
Non-violent strained living conditions 4
Non-violent absence of domination by home state 3
Non-violent absence of state structures 3
Non-violent acceptance of state structures 3
Non-violent aggression by foreign state 3
Non-violent education of the people 3
Non-violent experience of violence 3
Non-violent indispensability of state structures 3
Non-violent negative consequences of absence of state structures 3
Non-violent negative consequences of victory of the resistance in foreign state 3
Non-violent strength of international resistance against state system 3
Non-violent strength of resistance against home state 3
Non-violent success of peaceful activity 3
Non-violent superiority of state structures 3
Non-violent absence of aggression by home state 2
Non-violent absence of necessity for violence 2
Non-violent absence of peaceful means 2
Non-violent disunity of muslims 2
Non-violent existence of absolute priority of transformatory goal 2
Non-violent impossibility of accepting home state 2
Non-violent negative consequences of absence of action against home state 2
Non-violent negative experience in state system 2
Non-violent peaceful activity against foreign state 2
Non-violent peaceful activity supporting home state 2
Non-violent possibility for nonviolence 2
Non-violent priority of goal opposing violence 2
Non-violent weakness of resistance against home state 2
Non-violent absence of absolute priority of political goal 1
Non-violent absence of acceptance of home state 1
Non-violent absence of action against home state 1
Non-violent absence of domination by foreign state 1
Non-violent absence of interest in politics 1
Non-violent absence of success of peaceful activity 1
Non-violent absence of support for violence in direct environment 1
Non-violent absolute priority of private goal 1
Non-violent acceptance of state aggression 1
Non-violent acceptance of state representatives 1
Non-violent aggression by previous state 1
Non-violent change of home state 1
Non-violent enjoyment of violence 1
Non-violent existence of international resistance against state system 1
Non-violent existence of violence against foreign state 1
Non-violent illegal activity 1
Non-violent importance of the people 1
Non-violent joining the army 1
Non-violent personal problems 1
Non-violent refusal to join army 1
Non-violent religious state 1
Non-violent self efficacy 1
Non-violent strength of foreign state 1
Non-violent success of peaceful activity against home state 1
Non-violent support by home state 1
Non-violent support from foreign state for peaceful activity against home state 1
Non-violent unreligious state 1
Non-violent weakness of foreign state 1
Non-violent weakness of home state 1
Non-violent weakness of human beings 1
Non-violent weakness of international resistance against state system 1
Violent aggression by home state 13
Violent transformatory goal 12
Violent absence of peaceful means 11
Violent domination by home state 11
Violent peaceful activity against home state 11
Violent support for violence in direct environment 11
Violent continuation of aggression by home state 8
Violent possibility of reaching goals by violence 8
Violent acceptance of consequences of violence 7
Violent insufficiency of activity inside state structures 7
Violent negative consequences of violence 7
Violent self efficacy 7
Violent duty for action against home state 6
Violent necessity for violence 6
Violent political goal 6
Violent strength of resistance against home state 6
Violent absence of strength of home state 5
Violent existence of peaceful activity against home state 5
Violent imperialism 5
Violent private peaceful activity 5
Violent absolute priority of transformatory goal 4
Violent continuation of peaceful activity against home state 4
Violent education during childhood 4
Violent existence of violence against home state 4
Violent private goal 4
Violent strained living conditions 4
Violent absence of success of peaceful activity 3
Violent absence of success of peaceful activity against home state 3
Violent domination by previous state 3
Violent existence of international resistance against state system 3
Violent impossibility of accepting home state 3
Violent obedience to god 3
Violent strength of home state 3
Violent success of peaceful activity 3
Violent unreligious state 3
Violent weakness of home state 3
Violent absence of approval for violence by the people 2
Violent absence of domination by home state 2
Violent aggression by foreign state 2
Violent experience of violence 2
Violent ignorance of fellow citizens 2
Violent interest in politics 2
Violent negative experience in state system 2
Violent possibility for violence 2
Violent strength of international resistance against state system 2
Violent support from the people for violence 2
Violent absence of acceptance of aggression by home state 1
Violent absence of acceptance of home state 1
Violent absence of education during childhood 1
Violent absence of success of violence 1
Violent acceptance of state representatives 1
Violent acceptance of state structures 1
Violent alternative 1
Violent avoidance of negative consequences of violence 1
Violent change of home state 1
Violent dislike of violence 1
Violent distance from social structures 1
Violent efficient structure of violent group 1
Violent goal opposing violence 1
Violent gods might 1
Violent illegal activity 1
Violent impossibility of reaching goals by violence 1
Violent priority of goal opposing violence 1
Violent victory of resistance against state system 1
Violent weakness of will 1
beliefs2$group <- "Protester"
beliefs2$group[grep("^NP", beliefs2$respondent)] <- "Non-protester"

beliefs2 %>%
  group_by(beliefsRC, group) %>%
  summarise(nobs = length(beliefsRC)) %>%
  filter(beliefsRC != "nv" & beliefsRC != "v") %>%
  filter(group == "Protester") %>%
  filter(nobs > 5) %>%
  ggplot(aes(x = reorder(beliefsRC, nobs), y = nobs)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  labs(x = "", y = "",
       title = "Unique beliefs, nonviolent dissidents (>5, dataset 2)") +
  theme_minimal()
## `summarise()` has grouped output by 'beliefsRC'. You can override using the
## `.groups` argument.

beliefs2 %>%
  group_by(beliefsRC, group) %>%
  summarise(nobs = length(beliefsRC)) %>%
  filter(beliefsRC != "nv" & beliefsRC != "v") %>%
  filter(group == "Non-protester") %>%
  filter(nobs > 5) %>%
  ggplot(aes(x = reorder(beliefsRC, nobs), y = nobs)) +
  geom_bar(stat = "identity", position = "dodge") +
  coord_flip() +
  labs(x = "", y = "",
       title = "Unique beliefs, non-dissidents (>5, dataset 2)") +
  theme_minimal()
## `summarise()` has grouped output by 'beliefsRC'. You can override using the
## `.groups` argument.

beliefs2 %>% filter(!beliefsRC %in% c("nv", "v")) %>%  group_by(group, beliefsRC) %>% summarise(cnt = length(beliefsRC)) %>% arrange(group, desc(cnt)) %>% pander()
## `summarise()` has grouped output by 'group'. You can override using the
## `.groups` argument.
group beliefsRC cnt
Non-protester NA 67
Non-protester poverty 35
Non-protester safety 28
Non-protester satisfaction 26
Non-protester state approval 22
Non-protester protest 21
Non-protester employment 20
Non-protester state effort 19
Non-protester family 17
Non-protester change of government 14
Non-protester improved living conditions 12
Non-protester positive character head of state 12
Non-protester state crime 12
Non-protester revolution abroad 11
Non-protester protest approval 10
Non-protester protest disapproval 10
Non-protester history 9
Non-protester hopelessness 9
Non-protester international influence 9
Non-protester violence abroad 9
Non-protester previous state crime 8
Non-protester lack of prior protest result 7
Non-protester negative personality of the people 7
Non-protester no need for dissent 7
Non-protester personal priority 7
Non-protester previous state violence 7
Non-protester protection by army 7
Non-protester state strength 7
Non-protester good living conditions 6
Non-protester need for political change 6
Non-protester state violence 6
Non-protester media 5
Non-protester prior protest 5
Non-protester religion 5
Non-protester approvPHS 4
Non-protester fear 4
Non-protester interaction protestors 4
Non-protester jobavail 4
Non-protester lack of unity among the people 4
Non-protester NOapprovPHS 4
Non-protester NOinterestPOL 4
Non-protester NOskillsPRO 4
Non-protester prioSAF 4
Non-protester state disapproval 4
Non-protester deterioPOL 3
Non-protester dirE 3
Non-protester effS 3
Non-protester goodpersPP 3
Non-protester improvPOL 3
Non-protester NOsafety 3
Non-protester NOsatisf 3
Non-protester protest support 3
Non-protester strengthE 3
Non-protester strengthG 3
Non-protester conspir 2
Non-protester humanN 2
Non-protester ignorance 2
Non-protester needstrength 2
Non-protester NOalt 2
Non-protester NOfreePRESS 2
Non-protester persS 2
Non-protester pride 2
Non-protester resistA 2
Non-protester supA 2
Non-protester uncertainty 2
Non-protester crimeA 1
Non-protester crimePP 1
Non-protester diversity 1
Non-protester effPP 1
Non-protester election 1
Non-protester experFRI 1
Non-protester freePRESS 1
Non-protester goodpersS 1
Non-protester hope 1
Non-protester isoPHS 1
Non-protester needchangePP 1
Non-protester NOapprovPPHS 1
Non-protester NOeffPP 1
Non-protester NOimpIND 1
Non-protester NOimprov 1
Non-protester NOjob 1
Non-protester NOpersPHS 1
Non-protester NOresponscrimHS 1
Non-protester NOskillPHS 1
Non-protester NOskillsPG 1
Non-protester NOskillsPP 1
Non-protester NOsuccessPRIV 1
Non-protester NOsystem 1
Non-protester NP-E-2013 1
Non-protester obediencePP 1
Non-protester skillsHS 1
Non-protester strengthA 1
Non-protester strengthPHS 1
Non-protester surprise 1
Non-protester unityPP 1
Non-protester vioPRO 1
Protester NA 46
Protester state crime 38
Protester protest 24
Protester hope 22
Protester revolution abroad 17
Protester need for political change 14
Protester poverty 14
Protester state violence 11
Protester courage 10
Protester family 10
Protester prior protest 10
Protester fear 9
Protester protest support 9
Protester solidarity 9
Protester history 8
Protester interaction protestors 8
Protester state disapproval 8
Protester pride 7
Protester media 6
Protester lack of unity among the people 5
Protester selfsacrifice 5
Protester state effort 5
Protester unityPP 5
Protester change of government 4
Protester good living conditions 4
Protester hopelessness 4
Protester improvPOL 4
Protester international influence 4
Protester lack of prior protest result 4
Protester P-M-2014 4
Protester protest approval 4
Protester state strength 4
Protester strengthPRO 4
Protester ageHS 3
Protester badpersHS 3
Protester ignorance 3
Protester modesty 3
Protester moraloutrage 3
Protester needunityPP 3
Protester NOalt 3
Protester NOapprovSON 3
Protester passpowerSON 3
Protester previous state crime 3
Protester religion 3
Protester dirE 2
Protester election 2
Protester friends 2
Protester needstrength 2
Protester NOkingdomE 2
Protester NOsafety 2
Protester NOskillsPRO 2
Protester NOstrengthPRO 2
Protester strengthG 2
Protester strengthPP 2
Protester successPRO 2
Protester violence abroad 2
Protester badperSON 1
Protester badpersPHS 1
Protester conspir 1
Protester curiosity 1
Protester freedom 1
Protester godsmight 1
Protester goodpersPP 1
Protester humanN 1
Protester improved living conditions 1
Protester interestPOL 1
Protester needcourage 1
Protester needsolidarity 1
Protester NOapprovPHS 1
Protester NOeffHS 1
Protester NOfreePRESS 1
Protester NOpriorprotest 1
Protester NOprioS 1
Protester NOreligion 1
Protester NOsupportPRO 1
Protester P-E-2010 1
Protester P-E-2014 1
Protester P-M-2012 1
Protester persS 1
Protester possibilityPRO 1
Protester previous state violence 1
Protester protectPRO 1
Protester religextreme 1
Protester resistA 1
Protester satisfaction 1
Protester skillsPRO 1
Protester state approval 1
Protester strengthE 1
Protester supportS 1
Protester surprise 1
Protester uncertainty 1
Protester vioSON 1