Introduction: Theoretical Argument, Hypotheses and Data

When a state forms a foreign alliance with another state, it likely does not only consider that state in itself, but also the network it is embedded in. Rather than solely dyadic-based considerations, states’ position in the network, and their geostrategic and economic embeddedness therefore matter for alliance formation.

Asking the question of what could explain the alliance network structure in the year 2012, I want to first examine explanations related to homophily, before looking at partial conditional dependencies.

More specifically, the dyadic effects I focus on are homophily in terms of a shared subcontinent, similar human development, and level of democratic freedom. I then also hypothesize that there is a clustering around repeated alliance choice.

In order to examine these hypotheses, I merge a dyadic, directed network dataset from the Correlates of War Project with data on political rights from Freedom House (ordinal values from 1 to 7), and with the UN’s human development index.

Prettier Overview of Hypotheses:

a<-"Dyad independence"
b1<-"Countries are more likely to form alliances if they have a) matching regions"
b2<- "... b) matching levels of political rights"
b3<- "... c) matching levels of human development"
c<- "Partial conditional dependency"
d<-"Alliances cluster around repeated alliance choice"

a1<-cbind(a,b1)
a2<-cbind(a,b2)
a3<-cbind(a,b3)
b<-cbind(c,d)

Hypotheses<-rbind(a1,a2,a3,b)
colnames(Hypotheses)<-c("Level of Dependence", "Hypothesis")
rownames(Hypotheses)<-c("H1a", "H1b", "H1c", "H2")

##View(Hypotheses) to see table

Building the Dataset

#Downloading COW Foreign Alliances Dataset
library(haven)
library(foreign)
library(igraph)
## 
## Attaching package: 'igraph'
## The following objects are masked from 'package:stats':
## 
##     decompose, spectrum
## The following object is masked from 'package:base':
## 
##     union
data<-read_dta("/Users/leaschaad/Desktop/This/alliance_v4.1_by_directed_yearly.dta")
##filter by year 2012
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:igraph':
## 
##     as_data_frame, groups, union
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
data<-subset(data, year == 2012)
## Restricting to dyads
data<-select(data, state_name1, state_name2)

#Downloading Freedom House Region and Democracy Attributes Dataset
library(readxl)
fh<-read_xls("/Users/leaschaad/Desktop/This/All_data_FIW_2013-2021.xls")
##restricting to year 2013
fh<-subset(fh, Edition == "2013") ###didn't have 2012, but 2013 is very similar
##restricting fh to Country, Region, Status, political rights score, and civil liberties score
##and matching names to COW dataset for merging
fh<-select(fh, "Country/Territory", Region, "PR rating")
fh<-rename(fh, "PR" = "PR rating")
fh$PR<-as.numeric(fh$PR)

fh$"Country/Territory"[fh$"Country/Territory" == "United States"]<-"United States of America"
fh$"Country/Territory"[fh$"Country/Territory" == "Antigua and Barbuda"]<-"Antigua & Barbuda"
fh$"Country/Territory"[fh$"Country/Territory" == "The Gambia"]<-"Gambia"
fh$"Country/Territory"[fh$"Country/Territory" == "Cabo Verde"]<-"Cape Verde"
fh$"Country/Territory"[fh$"Country/Territory" == "Cote d'Ivoire"]<-"Ivory Coast"
fh$"Country/Territory"[fh$"Country/Territory" == "Congo (Brazzaville)"]<-"Democratic Republic of the Congo"
fh$"Country/Territory"[fh$"Country/Territory" == "Congo (Kinshasa)"]<-"Congo"

#Downloading HDI dataset:

library(readxl)
hdi<-read_xls("/Users/leaschaad/Desktop/This/HumanDevelopmentIndex.xls")
## New names:
## * `` -> ...4
## * `` -> ...6
## * `` -> ...8
## * `` -> ...10
## * `` -> ...12
## * ...
hdi<-select(hdi, Country, "2012")
hdi<-rename(hdi, "hdi" = "2012")
hdi$hdi<-as.numeric(hdi$hdi)
## Warning: NAs introduced by coercion
##matching names to COW dataset for merging
hdi$Country[hdi$Country == "Bolivia (Plurinational State of)"]<-"Bolivia"
hdi$Country[hdi$Country == "United States"]<-"United States of America"
hdi$Country[hdi$Country == "Venezuela (Bolivarian Republic of)"]<-"Venezuela"
hdi$Country[hdi$Country == "Syrian Arab Republic"]<-"Syria"
hdi$Country[hdi$Country == "Saint Lucia"]<-"St. Lucia"
hdi$Country[hdi$Country == "Saint Kitts and Nevis"]<-"St. Kitts and Nevis"
hdi$Country[hdi$Country == "Saint Vincent and the Grenadines"]<-"St. Vincent and the Grenadines"
hdi$Country[hdi$Country == "Antigua and Barbuda"]<-"Antigua & Barbuda"
hdi$Country[hdi$Country == "Czechia"]<-"Czech Republic"
hdi$Country[hdi$Country == "Korea (Republic of)"]<-"South Korea"
hdi$Country[hdi$Country == "Russian Federation"]<-"Russia"
hdi$Country[hdi$Country == "Moldova (Republic of)"]<-"Moldova"
hdi$Country[hdi$Country == "Eswatini (Kingdom of)"]<-"Swaziland"
data$state_name1[data$state_name1 == "German Federal Republic"]<-"Germany"
data$state_name2[data$state_name2 == "German Federal Republic"]<-"Germany"

#Merging Datasets to one
library(igraph)
library(migraph)
## Registered S3 methods overwritten by 'migraph':
##   method              from
##   plot.blockmodel     sna 
##   print.blockmodel    sna 
##   print.summary.netlm sna 
##   summary.netlm       sna
## 
## Attaching package: 'migraph'
## The following objects are masked from 'package:igraph':
## 
##     as_edgelist, is_connected, is_directed, is_weighted
## The following object is masked from 'package:stats':
## 
##     filter
library(dplyr)

merged<-left_join(data, fh, by = c("state_name1" = "Country/Territory"))
merged<-left_join(merged, hdi, by = c("state_name1" = "Country"))

#Factorizing PR and hdi

library(ggplot2)
merged$hdi<-cut_number(merged$hdi, n = 3, labels = c("low", "medium", "high"))
merged$PR<-cut_number(merged$PR, n = 3, labels = c("low", "medium", "high"))

table(merged$hdi)
## 
##    low medium   high 
##   1022    991    996
table(merged$PR)
## 
##    low medium   high 
##   1419    839    853
#Dealing with NAs - they have to go because ergm can't deal with them
merged$hdi<-as.character(merged$hdi)
merged$PR<-as.character(merged$PR)
merged[is.na(merged)] = "Recode" ##Recoding all NAs to "Recode", because R didn't seem to recognize NAs otherwise - must be character variables for this to work

merged$hdi[merged$hdi == "Recode"]<-"medium"
merged$PR[merged$PR == "Recode"]<-"medium"
merged$Region[merged$Region == "Recode"]<-"Other"

#turning into graph object that takes first two as edge list and other columns as attributes
library(igraph)
alliance<-graph_from_data_frame(merged[, 1:2], directed = TRUE, vertices = merged[!duplicated(merged[,1]), c(1, 3:5)])
summary(alliance)
## IGRAPH eeb09a1 DN-- 141 3114 -- 
## + attr: name (v/c), Region (v/c), PR (v/c), hdi (v/c)
V(alliance)$color<-"pink"
plot(alliance, vertex.size = 7, label.size = .1, vertex.label.color = "black", edge.arrow.size = 0.1 , edge.arrow.width = 0.5)
title(main = "Foreign Alliances in 2012") ##taking a first look at the network - enlarge to read names. If you want to be able to read the names, save this as a pdf while enlarging x10. Otherwise, view it without vertex labels with the code below:

plot(alliance, vertex.size = 7, vertex.label = NA, edge.arrow.size = 0.1 , edge.arrow.width = 0.5)
title(main = "Foreign Alliances in 2012")

#Turning into network object
library(ergm)
## Loading required package: network
## 
## 'network' 1.17.1 (2021-06-12), part of the Statnet Project
## * 'news(package="network")' for changes since last version
## * 'citation("network")' for citation information
## * 'https://statnet.org' for help, support, and other information
## 
## Attaching package: 'network'
## The following objects are masked from 'package:igraph':
## 
##     %c%, %s%, add.edges, add.vertices, delete.edges, delete.vertices,
##     get.edge.attribute, get.edges, get.vertex.attribute, is.bipartite,
##     is.directed, list.edge.attributes, list.vertex.attributes,
##     set.edge.attribute, set.vertex.attribute
## 
## 'ergm' 4.1.2 (2021-07-26), part of the Statnet Project
## * 'news(package="ergm")' for changes since last version
## * 'citation("ergm")' for citation information
## * 'https://statnet.org' for help, support, and other information
## 'ergm' 4 is a major update that introduces some backwards-incompatible
## changes. Please type 'news(package="ergm")' for a list of major
## changes.
library(intergraph)
alliance2<-alliance
alliance2 <- intergraph::asNetwork(alliance)
##So now I have a graph object (alliance) and a network object (alliance2)

Looking at Data - Basic measures

library(migraph)
library(igraph)
##Density e.g. the proportion of ties in a network
edge_density(alliance) #0.1577508
## [1] 0.1577508
##Transitivity
transitivity(alliance) #0.9065951
## [1] 0.9065951
reciprocity(alliance) #1 --> Every tie is reciprocated
## [1] 1

Now that we have built the dataset, let’s look at some basic measures. We can see that the network is not very dense, is fully reciprocal, and has many three-cycles. But can the network be explained by randomness, or is there at least some level of dependence going on?

Network Visualization

#Comparing Network to Random Network
model1 <- ergm(alliance2 ~ edges)
## Starting maximum pseudolikelihood estimation (MPLE):
## Evaluating the predictor and response matrix.
## Maximizing the pseudolikelihood.
## Finished MPLE.
## Stopping at the initial estimate.
## Evaluating log-likelihood at the estimate.
summary(model1)
## Call:
## ergm(formula = alliance2 ~ edges)
## 
## Maximum Likelihood Results:
## 
##       Estimate Std. Error MCMC % z value Pr(>|z|)    
## edges -1.93186    0.02141      0  -90.24   <1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 27365  on 19740  degrees of freedom
##  Residual Deviance: 14993  on 19739  degrees of freedom
##  
## AIC: 14995  BIC: 15003  (Smaller is better. MC Std. Err. = 0)
(sim <- simulate(model1))
##  Network attributes:
##   vertices = 141 
##   directed = TRUE 
##   hyper = FALSE 
##   loops = FALSE 
##   multiple = TRUE 
##   bipartite = FALSE 
##   total edges= 2467 
##     missing edges= 0 
##     non-missing edges= 2467 
## 
##  Vertex attribute names: 
##     color hdi PR Region vertex.names 
## 
##  Edge attribute names not shown
par(mfrow=c(1,2))
plot(alliance2, main="Observed")
plot(sim, main="Simulated")

We can see that the randomly simulated network is very different to the observed network - the observed network has more clusters and is less dense. We therefore know that the network structure is not determined by randomness. Now, let’s make a descriptive assessment dyad effects by looking at whether there is homophily in the network regarding political rights, human development, and regions.

Descriptive Statistics Looking at Homophily in Network Alliances

#Exploring homophily of attributes by looking at if it coincides with walktrap algorithm (tried different communnity algorithm, this one fit best)
library(igraph)
library(migraph)
alliance_wt_4<-cluster_walktrap(alliance) #walktrap with 4 steps
summary(alliance)
## IGRAPH eeb09a1 DN-- 141 3114 -- 
## + attr: name (v/c), Region (v/c), PR (v/c), hdi (v/c), color (v/c)
## Preparations: Coloring Nodes 

###color nodes according to Regions
library(igraph)
alliance_Region<-alliance
V(alliance_Region)$Region
##   [1] "Europe"   "Europe"   "Americas" "Americas" "Americas" "Americas"
##   [7] "Americas" "SSA"      "SSA"      "SSA"      "MENA"     "MENA"    
##  [13] "MENA"     "MENA"     "SSA"      "MENA"     "MENA"     "MENA"    
##  [19] "MENA"     "MENA"     "MENA"     "MENA"     "MENA"     "MENA"    
##  [25] "MENA"     "MENA"     "MENA"     "Americas" "Americas" "Americas"
##  [31] "Americas" "Americas" "Americas" "Americas" "Americas" "Americas"
##  [37] "Americas" "Americas" "Americas" "Americas" "Americas" "Americas"
##  [43] "Americas" "Americas" "Americas" "Americas" "Americas" "Americas"
##  [49] "Americas" "Americas" "Americas" "Americas" "Americas" "Americas"
##  [55] "Americas" "Americas" "Europe"   "Europe"   "Europe"   "Europe"  
##  [61] "Europe"   "Europe"   "Europe"   "Europe"   "Europe"   "Europe"  
##  [67] "Europe"   "Europe"   "Europe"   "Europe"   "Europe"   "Asia"    
##  [73] "Asia"     "Asia"     "Asia"     "Asia"     "SSA"      "SSA"     
##  [79] "Asia"     "Asia"     "SSA"      "SSA"      "Asia"     "SSA"     
##  [85] "SSA"      "SSA"      "SSA"      "SSA"      "SSA"      "SSA"     
##  [91] "SSA"      "SSA"      "SSA"      "SSA"      "SSA"      "SSA"     
##  [97] "SSA"      "SSA"      "Other"    "Eurasia"  "Europe"   "Europe"  
## [103] "Eurasia"  "Europe"   "Eurasia"  "Eurasia"  "Eurasia"  "Eurasia" 
## [109] "Eurasia"  "Eurasia"  "Eurasia"  "Eurasia"  "Eurasia"  "Eurasia" 
## [115] "Europe"   "Europe"   "Europe"   "Europe"   "Asia"     "Europe"  
## [121] "Europe"   "MENA"     "Other"    "Europe"   "SSA"      "SSA"     
## [127] "SSA"      "SSA"      "SSA"      "SSA"      "SSA"      "SSA"     
## [133] "SSA"      "SSA"      "SSA"      "MENA"     "Asia"     "SSA"     
## [139] "SSA"      "SSA"      "SSA"
V(alliance_Region)$color<-"white"

V(alliance_Region)$color <- ifelse(V(alliance_Region)$Region == "Americas", "blue", ifelse(V(alliance_Region)$Region == "Europe", "red", ifelse(V(alliance_Region)$Region == "MENA", "green", ifelse(V(alliance_Region)$Region == "SSA", "yellow", ifelse(V(alliance_Region)$Region == "Asia", "orange", ifelse(V(alliance_Region)$Region == "Eurasia", "darkgreen", "white"))))))

###color nodes according to hdi
alliance_hdi<-alliance
V(alliance_hdi)$hdi
##   [1] "high"   "high"   "medium" "low"    "low"    "medium" "medium" "low"   
##   [9] "medium" "low"    "low"    "medium" "medium" "medium" "low"    "low"   
##  [17] "low"    "low"    "medium" "medium" "high"   "low"    "high"   "high"  
##  [25] "high"   "high"   "high"   "high"   "high"   "high"   "low"    "medium"
##  [33] "medium" "medium" "high"   "medium" "medium" "medium" "medium" "medium"
##  [41] "medium" "medium" "low"    "low"    "low"    "low"    "low"    "medium"
##  [49] "medium" "low"    "medium" "medium" "medium" "high"   "high"   "high"  
##  [57] "high"   "high"   "high"   "high"   "high"   "high"   "high"   "high"  
##  [65] "high"   "high"   "high"   "high"   "high"   "high"   "medium" "low"   
##  [73] "high"   "high"   "high"   "low"    "low"    "low"    "medium" "medium"
##  [81] "low"    "low"    "low"    "medium" "low"    "low"    "low"    "low"   
##  [89] "low"    "low"    "medium" "low"    "low"    "low"    "low"    "low"   
##  [97] "low"    "low"    "low"    "high"   "high"   "high"   "medium" "high"  
## [105] "medium" "high"   "medium" "medium" "medium" "low"    "low"    "low"   
## [113] "low"    "medium" "medium" "high"   "high"   "high"   "medium" "high"  
## [121] "high"   "high"   "medium" "medium" "low"    "low"    "medium" "low"   
## [129] "low"    "low"    "low"    "low"    "low"    "low"    "low"    "medium"
## [137] "low"    "low"    "medium" "low"    "low"
V(alliance_hdi)$color<-"white"

V(alliance_hdi)$color <- ifelse(V(alliance_hdi)$hdi == "low", "yellow", ifelse(V(alliance_hdi)$hdi == "medium", "orange", ifelse(V(alliance_hdi)$hdi == "high", "red", "white")))

###color nodes according to PR
alliance_PR<-alliance
V(alliance_PR)$PR
##   [1] "low"    "low"    "medium" "medium" "medium" "medium" "medium" "high"  
##   [9] "high"   "high"   "medium" "high"   "medium" "medium" "high"   "high"  
##  [17] "medium" "high"   "medium" "high"   "high"   "high"   "medium" "high"  
##  [25] "high"   "high"   "high"   "low"    "low"    "low"    "medium" "low"   
##  [33] "low"    "low"    "low"    "low"    "low"    "low"    "low"    "low"   
##  [41] "low"    "medium" "low"    "medium" "medium" "low"    "medium" "low"   
##  [49] "low"    "low"    "low"    "low"    "low"    "low"    "low"    "low"   
##  [57] "low"    "low"    "low"    "low"    "low"    "low"    "low"    "low"   
##  [65] "low"    "low"    "low"    "low"    "low"    "low"    "medium" "medium"
##  [73] "low"    "low"    "low"    "medium" "medium" "high"   "high"   "high"  
##  [81] "medium" "high"   "low"    "low"    "high"   "high"   "high"   "low"   
##  [89] "low"    "medium" "medium" "medium" "medium" "low"    "low"    "medium"
##  [97] "medium" "low"    "medium" "high"   "low"    "low"    "medium" "low"   
## [105] "medium" "high"   "medium" "medium" "high"   "high"   "high"   "medium"
## [113] "high"   "high"   "medium" "low"    "low"    "low"    "low"    "low"   
## [121] "low"    "low"    "medium" "medium" "medium" "high"   "high"   "low"   
## [129] "high"   "high"   "high"   "medium" "high"   "high"   "high"   "high"  
## [137] "high"   "medium" "medium" "medium" "high"
V(alliance_PR)$color<-"white"

V(alliance_PR)$color <- ifelse(V(alliance_PR)$PR == "low", "red", ifelse(V(alliance_PR)$PR == "medium", "orange", ifelse(V(alliance_PR)$PR == "high", "yellow", "white")))

##Plots Community Algorithm and Node Attributes

plot(alliance_Region, vertex.size = 7, label.size = .1, vertex.label = NA, edge.arrow.size = 0.1 , edge.arrow.width = 0.5, mark.groups = alliance_wt_4)
title(main = "Foreign Alliances and Regions", cex.main = 1, col.main = "black") ##plot Regions
legend("topleft", legend=c("Americas", "Europe", "MENA", "SSA", "Asia", "Eurasia"),
       col=c("blue", "red", "green", "yellow", "orange", "darkgreen"), lty=1:1, cex=0.5)

plot(alliance_hdi, vertex.size = 7, label.size = .1, vertex.label = NA, edge.arrow.size = 0.1 , edge.arrow.width = 0.5, mark.groups = alliance_wt_4)
title(main = "Foreign Alliances and Human Development", cex.main = 1, col.main = "black") ##plot hdi
legend("topleft", legend=c("low", "medium", "high"),
       col=c("yellow", "orange", "red"), lty=1:1, cex=0.5)

plot(alliance_PR, vertex.size = 7, label.size = .1, vertex.label = NA, edge.arrow.size = 0.1 , edge.arrow.width = 0.5, mark.groups = alliance_wt_4)
title(main = "Foreign Alliances and Political Rights", cex.main = 1, col.main = "black") ##plot PR
legend("topleft", legend=c("low", "medium", "high"),
       col=c("red", "orange", "yellow"), lty=1:1, cex=0.5)

We can see that to a certain extent, alliance communities seem to coincide with regions, political rights and human development. Clusters seem most homophile with regard to regions, and less clear with regard to the other two attributes. As a next step, let’s examine this structural hypothesis causally, before also taking into account different levels of dependencies.

Running Exponential Random Graph Models (ERGMs)

library(ergm)
library(migraph)
#testing dyad effects - H1a-c
model_match_all<-ergm(alliance2 ~ edges + nodefactor("hdi") + nodematch("hdi") + nodefactor("PR") + nodematch("PR") + nodefactor("Region") + nodematch("Region"))
## Starting maximum pseudolikelihood estimation (MPLE):
## Evaluating the predictor and response matrix.
## Maximizing the pseudolikelihood.
## Finished MPLE.
## Stopping at the initial estimate.
## Evaluating log-likelihood at the estimate.
summary(model_match_all)
## Call:
## ergm(formula = alliance2 ~ edges + nodefactor("hdi") + nodematch("hdi") + 
##     nodefactor("PR") + nodematch("PR") + nodefactor("Region") + 
##     nodematch("Region"))
## 
## Maximum Likelihood Results:
## 
##                           Estimate Std. Error MCMC % z value Pr(>|z|)    
## edges                     -1.21115    0.23505      0  -5.153  < 1e-04 ***
## nodefactor.hdi.low        -0.58994    0.10041      0  -5.875  < 1e-04 ***
## nodefactor.hdi.medium     -0.44645    0.08919      0  -5.006  < 1e-04 ***
## nodematch.hdi              0.17954    0.08017      0   2.240 0.025115 *  
## nodefactor.PR.low         -0.40216    0.08476      0  -4.745  < 1e-04 ***
## nodefactor.PR.medium      -0.10075    0.06635      0  -1.518 0.128906    
## nodematch.PR               0.77400    0.07403      0  10.455  < 1e-04 ***
## nodefactor.Region.Asia    -2.00081    0.12451      0 -16.069  < 1e-04 ***
## nodefactor.Region.Eurasia -0.44684    0.12301      0  -3.633 0.000281 ***
## nodefactor.Region.Europe  -1.94176    0.09146      0 -21.232  < 1e-04 ***
## nodefactor.Region.MENA    -1.07104    0.10069      0 -10.637  < 1e-04 ***
## nodefactor.Region.Other   -1.90718    0.40794      0  -4.675  < 1e-04 ***
## nodefactor.Region.SSA     -1.82357    0.08427      0 -21.639  < 1e-04 ***
## nodematch.Region           4.99180    0.09071      0  55.029  < 1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 27365  on 19740  degrees of freedom
##  Residual Deviance:  6263  on 19726  degrees of freedom
##  
## AIC: 6291  BIC: 6401  (Smaller is better. MC Std. Err. = 0)
#Testing Partial Conditional Dependence
model_gwesp_all<-ergm(alliance2 ~ edges + gwesp(0.2, fixed = TRUE) + nodefactor("hdi") + nodematch("hdi") + nodefactor("PR") + nodematch("PR") + nodefactor("Region") + nodematch("Region")) ##Converged with 99% confidence after running 26 mins
## Starting maximum pseudolikelihood estimation (MPLE):
## Evaluating the predictor and response matrix.
## Maximizing the pseudolikelihood.
## Finished MPLE.
## Starting Monte Carlo maximum likelihood estimation (MCMLE):
## Iteration 1 of at most 60:
## Optimizing with step length 0.0653.
## The log-likelihood improved by 2.2558.
## Estimating equations are not within tolerance region.
## Iteration 2 of at most 60:
## Optimizing with step length 0.0694.
## The log-likelihood improved by 1.8622.
## Estimating equations are not within tolerance region.
## Iteration 3 of at most 60:
## Optimizing with step length 0.0562.
## The log-likelihood improved by 1.4584.
## Estimating equations are not within tolerance region.
## Iteration 4 of at most 60:
## Optimizing with step length 0.0678.
## The log-likelihood improved by 1.9162.
## Estimating equations are not within tolerance region.
## Iteration 5 of at most 60:
## Optimizing with step length 0.0836.
## The log-likelihood improved by 1.8703.
## Estimating equations are not within tolerance region.
## Iteration 6 of at most 60:
## Optimizing with step length 0.1013.
## The log-likelihood improved by 2.0890.
## Estimating equations are not within tolerance region.
## Iteration 7 of at most 60:
## Optimizing with step length 0.0909.
## The log-likelihood improved by 1.7228.
## Estimating equations are not within tolerance region.
## Iteration 8 of at most 60:
## Optimizing with step length 0.1031.
## The log-likelihood improved by 1.6109.
## Estimating equations are not within tolerance region.
## Iteration 9 of at most 60:
## Optimizing with step length 0.1211.
## The log-likelihood improved by 1.7211.
## Estimating equations are not within tolerance region.
## Iteration 10 of at most 60:
## Optimizing with step length 0.1264.
## The log-likelihood improved by 1.8149.
## Estimating equations are not within tolerance region.
## Iteration 11 of at most 60:
## Optimizing with step length 0.1907.
## The log-likelihood improved by 2.4807.
## Estimating equations are not within tolerance region.
## Iteration 12 of at most 60:
## Optimizing with step length 0.1847.
## The log-likelihood improved by 1.6652.
## Estimating equations are not within tolerance region.
## Iteration 13 of at most 60:
## Optimizing with step length 0.2510.
## The log-likelihood improved by 2.4208.
## Estimating equations are not within tolerance region.
## Iteration 14 of at most 60:
## Optimizing with step length 0.2499.
## The log-likelihood improved by 1.4904.
## Estimating equations are not within tolerance region.
## Iteration 15 of at most 60:
## Optimizing with step length 0.4047.
## The log-likelihood improved by 2.4508.
## Estimating equations are not within tolerance region.
## Iteration 16 of at most 60:
## Optimizing with step length 0.5151.
## The log-likelihood improved by 1.3677.
## Estimating equations are not within tolerance region.
## Iteration 17 of at most 60:
## Optimizing with step length 1.0000.
## The log-likelihood improved by 0.6730.
## Estimating equations are not within tolerance region.
## Iteration 18 of at most 60:
## Optimizing with step length 1.0000.
## The log-likelihood improved by 0.1754.
## Estimating equations are not within tolerance region.
## Iteration 19 of at most 60:
## Optimizing with step length 1.0000.
## The log-likelihood improved by 0.0572.
## Convergence test p-value: 0.9848. Not converged with 99% confidence; increasing sample size.
## Iteration 20 of at most 60:
## Optimizing with step length 1.0000.
## The log-likelihood improved by 0.0673.
## Convergence test p-value: 1.0000. Not converged with 99% confidence; increasing sample size.
## Iteration 21 of at most 60:
## Optimizing with step length 1.0000.
## The log-likelihood improved by 0.0390.
## Convergence test p-value: 0.6324. Not converged with 99% confidence; increasing sample size.
## Iteration 22 of at most 60:
## Optimizing with step length 1.0000.
## The log-likelihood improved by 0.0520.
## Convergence test p-value: 0.8689. Not converged with 99% confidence; increasing sample size.
## Iteration 23 of at most 60:
## Optimizing with step length 1.0000.
## The log-likelihood improved by 0.0446.
## Convergence test p-value: 0.3173. Not converged with 99% confidence; increasing sample size.
## Iteration 24 of at most 60:
## Optimizing with step length 1.0000.
## The log-likelihood improved by 0.0138.
## Convergence test p-value: < 0.0001. Converged with 99% confidence.
## Finished MCMLE.
## Evaluating log-likelihood at the estimate. Fitting the dyad-independent submodel...
## Bridging between the dyad-independent submodel and the full model...
## Setting up bridge sampling...
## Using 16 bridges: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 .
## Bridging finished.
## This model was fit using MCMC.  To examine model diagnostics and check
## for degeneracy, use the mcmc.diagnostics() function.
summary(model_gwesp_all)
## Call:
## ergm(formula = alliance2 ~ edges + gwesp(0.2, fixed = TRUE) + 
##     nodefactor("hdi") + nodematch("hdi") + nodefactor("PR") + 
##     nodematch("PR") + nodefactor("Region") + nodematch("Region"))
## 
## Monte Carlo Maximum Likelihood Results:
## 
##                           Estimate Std. Error MCMC % z value Pr(>|z|)    
## edges                     -3.39418    0.29188      0 -11.629   <1e-04 ***
## gwesp.fixed.0.2            1.71853    0.16307      0  10.539   <1e-04 ***
## nodefactor.hdi.low        -0.45251    0.09060      0  -4.995   <1e-04 ***
## nodefactor.hdi.medium     -0.35476    0.07993      0  -4.439   <1e-04 ***
## nodematch.hdi              0.12111    0.07782      0   1.556   0.1196    
## nodefactor.PR.low         -0.39500    0.07831      0  -5.044   <1e-04 ***
## nodefactor.PR.medium      -0.12575    0.06407      0  -1.963   0.0497 *  
## nodematch.PR               0.77778    0.07102      0  10.951   <1e-04 ***
## nodefactor.Region.Asia    -1.84699    0.08032      0 -22.995   <1e-04 ***
## nodefactor.Region.Eurasia -0.43222    0.10950      0  -3.947   <1e-04 ***
## nodefactor.Region.Europe  -1.77171    0.08929      0 -19.842   <1e-04 ***
## nodefactor.Region.MENA    -0.96489    0.09374      0 -10.293   <1e-04 ***
## nodefactor.Region.Other   -1.30479    0.31308      0  -4.168   <1e-04 ***
## nodefactor.Region.SSA     -1.82174    0.08035      0 -22.673   <1e-04 ***
## nodematch.Region           4.62305    0.08696      0  53.161   <1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      Null Deviance: 27365  on 19740  degrees of freedom
##  Residual Deviance:  6082  on 19725  degrees of freedom
##  
## AIC: 6112  BIC: 6230  (Smaller is better. MC Std. Err. = 0.2968)
#Visualizations 
##all coefficients
library(stargazer)
## 
## Please cite as: 
## 
##  Hlavac, Marek (2018). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2.2. https://CRAN.R-project.org/package=stargazer
stargazer(model_match_all, model_gwesp_all, type = "text")
## 
## ======================================================
##                               Dependent variable:     
##                           ----------------------------
##                                    alliance2          
##                                (1)            (2)     
## ------------------------------------------------------
## edges                       -1.211***      -3.394***  
##                              (0.235)        (0.292)   
##                                                       
## gwesp.fixed.0.2                            1.719***   
##                                             (0.163)   
##                                                       
## nodefactor.hdi.low          -0.590***      -0.453***  
##                              (0.100)        (0.091)   
##                                                       
## nodefactor.hdi.medium       -0.446***      -0.355***  
##                              (0.089)        (0.080)   
##                                                       
## nodematch.hdi                0.180**         0.121    
##                              (0.080)        (0.078)   
##                                                       
## nodefactor.PR.low           -0.402***      -0.395***  
##                              (0.085)        (0.078)   
##                                                       
## nodefactor.PR.medium          -0.101       -0.126**   
##                              (0.066)        (0.064)   
##                                                       
## nodematch.PR                 0.774***      0.778***   
##                              (0.074)        (0.071)   
##                                                       
## nodefactor.Region.Asia      -2.001***      -1.847***  
##                              (0.125)        (0.080)   
##                                                       
## nodefactor.Region.Eurasia   -0.447***      -0.432***  
##                              (0.123)        (0.110)   
##                                                       
## nodefactor.Region.Europe    -1.942***      -1.772***  
##                              (0.091)        (0.089)   
##                                                       
## nodefactor.Region.MENA      -1.071***      -0.965***  
##                              (0.101)        (0.094)   
##                                                       
## nodefactor.Region.Other     -1.907***      -1.305***  
##                              (0.408)        (0.313)   
##                                                       
## nodefactor.Region.SSA       -1.824***      -1.822***  
##                              (0.084)        (0.080)   
##                                                       
## nodematch.Region             4.992***      4.623***   
##                              (0.091)        (0.087)   
##                                                       
## ------------------------------------------------------
## Akaike Inf. Crit.           6,290.519      6,111.575  
## Bayesian Inf. Crit.         6,400.985      6,229.931  
## ======================================================
## Note:                      *p<0.1; **p<0.05; ***p<0.01
##choosing only coefficients I'm focusing on
library(stargazer)
stargazer(model_match_all, model_gwesp_all, keep = c("nodematch.hdi", "nodematch.Region", "nodematch.PR", "gwesp.fixed.0.2"), type = "text")
## 
## ================================================
##                         Dependent variable:     
##                     ----------------------------
##                              alliance2          
##                          (1)            (2)     
## ------------------------------------------------
## gwesp.fixed.0.2                      1.719***   
##                                       (0.163)   
##                                                 
## nodematch.hdi          0.180**         0.121    
##                        (0.080)        (0.078)   
##                                                 
## nodematch.PR           0.774***      0.778***   
##                        (0.074)        (0.071)   
##                                                 
## nodematch.Region       4.992***      4.623***   
##                        (0.091)        (0.087)   
##                                                 
## ------------------------------------------------
## Akaike Inf. Crit.     6,290.519      6,111.575  
## Bayesian Inf. Crit.   6,400.985      6,229.931  
## ================================================
## Note:                *p<0.1; **p<0.05; ***p<0.01

Interestingly we can see that in both models, most coefficients are (highly) significant. This already tells us that region, hdi and PR have an influence on foreign alliances. Looking at dyad effects in examining hypothesis one, we can confirm that countries are more likely to build foreign alliances with countries within their region (H1a), and that have similar levels of political rights and human development (H1b,H1c). More specifically, we can see that all nodematch coefficients are positive and significant on a 95% confidence interval (hdi) and even 99% confidence interval (region and PR). Regarding our third hypothesis, we can see that the model that incorporates social circuit dependence has a lower AIC and therefore better fits the data. We can also accept our second hypothesis, seeing that the gwesp coefficient is significant on a 99% confidence interval. Further, the fact that the nodematch PR and nodematch region coefficients remain significant in this model too strengthens our confidence in hypotheses 1a and b. However, we can see that in the partial conditional model, nodematch hdi does not attain statistical significance, which suggests that it is subsumed by the gwesp effect and throws into question hypothesis 1c.

Goodness of Fit

library(ergm)
(fit_match_all <- gof(model_match_all,  GOF = ~ idegree + distance + triadcensus + espartners - model))
## 
## Goodness-of-fit for in-degree 
## 
##           obs min  mean max MC p-value
## idegree0    0   0  0.88   4       0.56
## idegree1   11   0  1.83   5       0.00
## idegree2    7   0  2.33   7       0.02
## idegree3    3   0  2.70   8       0.98
## idegree4    3   0  2.24   6       0.74
## idegree5    0   0  2.03   8       0.22
## idegree6    2   0  1.82   7       0.94
## idegree7    0   0  2.30   6       0.18
## idegree8    2   0  3.29  11       0.68
## idegree9    0   0  3.92  10       0.04
## idegree10   7   0  5.73  15       0.64
## idegree11   4   1  7.28  15       0.30
## idegree12   2   3  8.78  14       0.00
## idegree13   3   4 11.75  20       0.00
## idegree14  15   4 11.91  21       0.50
## idegree15   9   6 11.25  19       0.44
## idegree16   1   3  9.68  17       0.00
## idegree17   1   1  6.96  13       0.02
## idegree18  25   1  4.66  12       0.00
## idegree19   6   0  2.88   8       0.10
## idegree20   1   0  1.54   5       1.00
## idegree21   2   0  0.73   3       0.32
## idegree22   0   0  0.30   2       1.00
## idegree23   0   0  0.18   2       1.00
## idegree24   1   0  0.03   1       0.06
## idegree26   1   0  0.00   0       0.00
## idegree28   0   0  0.01   1       1.00
## idegree29   0   0  0.16   2       1.00
## idegree30   1   0  0.80   4       1.00
## idegree31   0   0  1.88   7       0.32
## idegree32   0   0  3.70   8       0.02
## idegree33  32   1  5.50  11       0.00
## idegree34   0   2  5.94  11       0.00
## idegree35   0   2  5.19  10       0.00
## idegree36   0   0  4.55  10       0.04
## idegree37   0   0  3.01   8       0.08
## idegree38   0   0  1.74   5       0.36
## idegree39   0   0  0.88   3       0.82
## idegree40   0   0  0.29   2       1.00
## idegree41   0   0  0.20   2       1.00
## idegree42   0   0  0.11   2       1.00
## idegree43   0   0  0.04   1       1.00
## idegree51   1   0  0.00   0       0.00
## idegree56   1   0  0.00   0       0.00
## 
## Goodness-of-fit for minimum geodesic distance 
## 
##      obs  min    mean  max MC p-value
## 1   2498 2428 2495.15 2549       0.80
## 2   3456 7168 7731.14 8236       0.00
## 3   5198 6715 7419.26 7950       0.00
## 4   3190 1272 1626.84 2225       0.00
## 5   3336   36  154.59  426       0.00
## 6   1232    0   16.82  185       0.00
## 7    242    0    2.07   69       0.00
## 8     32    0    0.03    2       0.00
## Inf  556    0  294.10 1105       0.26
## 
## Goodness-of-fit for triad census 
## 
##                     obs    min      mean    max MC p-value
## triadcensus.003  304490 255733 260610.97 266915          0
## triadcensus.012       0  76983  87084.98  92271          0
## triadcensus.102  141033  80856  83142.59  88173          0
## triadcensus.021D      0   1423   1687.56   1901          0
## triadcensus.021U      0   1464   1692.68   1868          0
## triadcensus.021C      0   2846   3381.87   3679          0
## triadcensus.111D      0   3942   4768.26   5348          0
## triadcensus.111U      0   4306   4992.37   5631          0
## triadcensus.030T      0    499    735.11    886          0
## triadcensus.030C      0    154    250.64    309          0
## triadcensus.201    2783    301    501.32    731          0
## triadcensus.120D      0    283    373.49    425          0
## triadcensus.120U      0    250    376.74    451          0
## triadcensus.120C      0    620    770.30    895          0
## triadcensus.210       0   1415   2041.79   2401          0
## triadcensus.300    9004   4487   4899.33   5769          0
## 
## Goodness-of-fit for edgewise shared partner 
## 
##        obs min   mean max MC p-value
## esp0    46 107 130.06 152       0.00
## esp1    28 114 136.37 164       0.00
## esp2    14 107 141.89 169       0.00
## esp3    10 108 150.31 188       0.00
## esp4     6 114 140.62 180       0.00
## esp5    36  95 123.73 146       0.00
## esp6    12  48 104.43 136       0.00
## esp7     2  53 100.68 150       0.00
## esp8     8  62 110.29 156       0.00
## esp9   136  90 109.75 137       0.04
## esp10   96  59  86.17 145       0.50
## esp11   42  22  48.58  80       0.70
## esp12   12  11  25.50  52       0.04
## esp13  210   3  11.20  31       0.00
## esp14   36   0   3.59  11       0.00
## esp15    0   0   1.11   4       0.70
## esp16    0   0   0.17   2       1.00
## esp17  658   0   0.00   0       0.00
## esp18   20   0   0.00   0       0.00
## esp19    4   0   0.00   0       0.00
## esp20    0   0   0.01   1       1.00
## esp21    0   0   0.56   6       1.00
## esp22    0   0   0.89   6       1.00
## esp23    0   0   1.90   8       0.86
## esp24    0   0   6.15  22       0.42
## esp25    0   0  17.66  44       0.08
## esp26    0   2  43.55  85       0.00
## esp27    0  20  95.30 155       0.00
## esp28    0  68 158.95 212       0.00
## esp29    0 114 221.90 269       0.00
## esp30    0 176 243.22 344       0.00
## esp31    0  94 187.62 396       0.00
## esp32 1120  36  81.54 246       0.00
## esp33    0   2  10.58  32       0.00
## esp34    0   0   0.84   5       0.98
## esp35    0   0   0.03   1       1.00
## esp49    2   0   0.00   0       0.00
## 
## Goodness-of-fit for model statistics 
## 
##                            obs  min    mean  max MC p-value
## edges                     2498 2428 2495.15 2549       0.80
## nodefactor.hdi.low        1722 1650 1711.07 1772       0.56
## nodefactor.hdi.medium     1772 1701 1771.68 1827       0.88
## nodematch.hdi             1254 1216 1251.39 1287       0.88
## nodefactor.PR.low         2504 2462 2532.17 2575       0.22
## nodefactor.PR.medium      1394 1316 1377.68 1445       0.56
## nodematch.PR              1440 1406 1429.51 1455       0.48
## nodefactor.Region.Asia      68   47   65.38   82       0.84
## nodefactor.Region.Eurasia  344  332  348.69  370       0.56
## nodefactor.Region.Europe   716  673  718.68  766       0.98
## nodefactor.Region.MENA     570  522  557.16  584       0.38
## nodefactor.Region.Other      6    0    4.88   11       0.82
## nodefactor.Region.SSA      966  892  942.15  995       0.32
## nodematch.Region          2204 2163 2202.27 2230       1.00
summary(fit_match_all)
##                     Length Class   Mode   
## network.size            1  -none-  numeric
## GOF                     2  formula call   
## pval.model             70  -none-  numeric
## summary.model          70  -none-  numeric
## pobs.model             14  -none-  numeric
## psim.model           1400  -none-  numeric
## bds.model              28  -none-  numeric
## obs.model              14  -none-  numeric
## sim.model            1400  -none-  numeric
## pval.dist             705  -none-  numeric
## summary.dist          705  -none-  numeric
## pobs.dist             141  -none-  numeric
## psim.dist           14100  -none-  numeric
## bds.dist              282  -none-  numeric
## obs.dist              141  -none-  numeric
## sim.dist            14100  -none-  numeric
## pval.ideg             705  -none-  numeric
## summary.ideg          705  -none-  numeric
## pobs.ideg             141  -none-  numeric
## psim.ideg           14100  -none-  numeric
## bds.ideg              282  -none-  numeric
## obs.ideg              141  -none-  numeric
## sim.ideg            14100  -none-  numeric
## pval.espart           700  -none-  numeric
## summary.espart        700  -none-  numeric
## pobs.espart           140  -none-  numeric
## psim.espart         14000  -none-  numeric
## bds.espart            280  -none-  numeric
## obs.espart            140  -none-  numeric
## sim.espart          14000  -none-  numeric
## pval.triadcensus       80  -none-  numeric
## summary.triadcensus    80  -none-  numeric
## pobs.triadcensus       16  -none-  numeric
## psim.triadcensus     1600  -none-  numeric
## bds.triadcensus        32  -none-  numeric
## obs.triadcensus        16  -none-  numeric
## sim.triadcensus      1600  -none-  numeric
plot(fit_match_all)

(fit_gwesp_all <- gof(model_gwesp_all,  GOF = ~ idegree + distance + triadcensus + espartners - model))
## 
## Goodness-of-fit for in-degree 
## 
##           obs min  mean max MC p-value
## idegree0    0   0  2.86   9       0.04
## idegree1   11   0  1.23   4       0.00
## idegree2    7   0  1.82   6       0.00
## idegree3    3   0  1.95   7       0.50
## idegree4    3   0  1.91   7       0.62
## idegree5    0   0  1.72   4       0.24
## idegree6    2   0  1.63   6       1.00
## idegree7    0   0  1.95   6       0.30
## idegree8    2   0  2.98   6       0.76
## idegree9    0   0  4.07  11       0.12
## idegree10   7   1  6.09  11       0.82
## idegree11   4   2  7.90  15       0.26
## idegree12   2   4 10.10  20       0.00
## idegree13   3   4 11.01  21       0.00
## idegree14  15   5 11.68  20       0.36
## idegree15   9   2 10.63  18       0.76
## idegree16   1   4  9.02  17       0.00
## idegree17   1   1  6.41  14       0.06
## idegree18  25   0  4.95  12       0.00
## idegree19   6   0  3.35   7       0.22
## idegree20   1   0  1.58   5       0.94
## idegree21   2   0  1.19   4       0.62
## idegree22   0   0  0.55   2       1.00
## idegree23   0   0  0.24   2       1.00
## idegree24   1   0  0.14   2       0.24
## idegree25   0   0  0.03   1       1.00
## idegree26   1   0  0.04   1       0.08
## idegree27   0   0  0.15   2       1.00
## idegree28   0   0  0.27   2       1.00
## idegree29   0   0  0.63   3       0.96
## idegree30   1   0  1.50   5       1.00
## idegree31   0   0  2.41   7       0.24
## idegree32   0   0  3.76   9       0.04
## idegree33  32   1  4.88   9       0.00
## idegree34   0   0  5.30  10       0.02
## idegree35   0   0  4.78  10       0.02
## idegree36   0   0  3.65  10       0.12
## idegree37   0   0  2.79   7       0.08
## idegree38   0   0  1.73   6       0.36
## idegree39   0   0  1.04   4       0.70
## idegree40   0   0  0.55   3       1.00
## idegree41   0   0  0.33   2       1.00
## idegree42   0   0  0.13   2       1.00
## idegree43   0   0  0.06   1       1.00
## idegree46   0   0  0.01   1       1.00
## idegree51   1   0  0.00   0       0.00
## idegree56   1   0  0.00   0       0.00
## 
## Goodness-of-fit for minimum geodesic distance 
## 
##      obs  min    mean  max MC p-value
## 1   2498 2415 2494.77 2583       0.96
## 2   3456 5605 6480.15 7359       0.00
## 3   5198 5767 6564.23 7234       0.00
## 4   3190 1906 2743.13 3643       0.24
## 5   3336   36  442.68  962       0.00
## 6   1232    0   58.44  414       0.00
## 7    242    0   10.45  224       0.00
## 8     32    0    1.81   90       0.04
## 9      0    0    0.17   17       1.00
## Inf  556  140  944.17 2706       0.52
## 
## Goodness-of-fit for triad census 
## 
##                     obs    min      mean    max MC p-value
## triadcensus.003  304490 253692 259017.07 270863          0
## triadcensus.012       0  75364  90563.40  96374          0
## triadcensus.102  141033  76474  80717.63  87870          0
## triadcensus.021D      0   1134   1633.64   2033          0
## triadcensus.021U      0   1102   1634.88   1892          0
## triadcensus.021C      0   2257   3324.16   4016          0
## triadcensus.111D      0   4158   4948.50   6124          0
## triadcensus.111U      0   3994   4932.95   5700          0
## triadcensus.030T      0    601    862.16   1025          0
## triadcensus.030C      0    178    290.32    360          0
## triadcensus.201    2783    362    660.16   1054          0
## triadcensus.120D      0    374    513.80    618          0
## triadcensus.120U      0    355    506.18    573          0
## triadcensus.120C      0    650    959.55   1110          0
## triadcensus.210       0   1452   2545.14   2915          0
## triadcensus.300    9004   3678   4200.46   5655          0
## 
## Goodness-of-fit for edgewise shared partner 
## 
##        obs min   mean max MC p-value
## esp0    46  13  23.89  37       0.00
## esp1    28  88 113.95 153       0.00
## esp2    14 115 165.41 213       0.00
## esp3    10 145 183.75 223       0.00
## esp4     6 131 178.44 217       0.00
## esp5    36 118 161.96 200       0.00
## esp6    12  90 137.34 185       0.00
## esp7     2  84 120.70 163       0.00
## esp8     8  55 108.30 168       0.00
## esp9   136  60  93.42 124       0.00
## esp10   96  40  70.81 130       0.06
## esp11   42  12  45.05  70       0.86
## esp12   12   7  27.78  55       0.06
## esp13  210   0  14.31  34       0.00
## esp14   36   0   5.67  20       0.00
## esp15    0   0   1.77   7       0.72
## esp16    0   0   0.30   5       1.00
## esp17  658   0   0.05   3       0.00
## esp18   20   0   0.09   4       0.00
## esp19    4   0   0.32   7       0.06
## esp20    0   0   0.69   6       1.00
## esp21    0   0   2.34  14       0.78
## esp22    0   0   6.66  30       0.32
## esp23    0   0  17.20  56       0.06
## esp24    0   0  36.60  95       0.02
## esp25    0   1  73.25 141       0.00
## esp26    0   3 124.89 216       0.00
## esp27    0  22 175.55 226       0.00
## esp28    0  47 201.12 271       0.00
## esp29    0 107 184.69 278       0.00
## esp30    0  47 127.59 266       0.00
## esp31    0  14  66.61 366       0.00
## esp32 1120   4  21.12 231       0.00
## esp33    0   0   2.84  17       0.38
## esp34    0   0   0.26   2       1.00
## esp35    0   0   0.05   1       1.00
## esp49    2   0   0.00   0       0.00
## 
## Goodness-of-fit for model statistics 
## 
##                                obs      min     mean      max MC p-value
## edges                     2498.000 2415.000 2494.770 2583.000       0.96
## gwesp.fixed.0.2           2988.029 2892.077 2984.454 3097.038       0.90
## nodefactor.hdi.low        1722.000 1653.000 1720.310 1797.000       1.00
## nodefactor.hdi.medium     1772.000 1697.000 1766.430 1844.000       0.88
## nodematch.hdi             1254.000 1198.000 1254.720 1301.000       0.96
## nodefactor.PR.low         2504.000 2394.000 2504.180 2608.000       0.96
## nodefactor.PR.medium      1394.000 1323.000 1391.620 1466.000       1.00
## nodematch.PR              1440.000 1380.000 1438.230 1501.000       0.96
## nodefactor.Region.Asia      68.000   12.000   59.900   93.000       0.72
## nodefactor.Region.Eurasia  344.000  309.000  342.240  373.000       0.96
## nodefactor.Region.Europe   716.000  661.000  715.650  769.000       1.00
## nodefactor.Region.MENA     570.000  520.000  572.170  614.000       0.82
## nodefactor.Region.Other      6.000    0.000    6.220   16.000       1.00
## nodefactor.Region.SSA      966.000  878.000  965.330 1037.000       0.96
## nodematch.Region          2204.000 2146.000 2200.980 2251.000       0.94
summary(fit_gwesp_all)
##                     Length Class   Mode   
## network.size            1  -none-  numeric
## GOF                     2  formula call   
## pval.model             75  -none-  numeric
## summary.model          75  -none-  numeric
## pobs.model             15  -none-  numeric
## psim.model           1500  -none-  numeric
## bds.model              30  -none-  numeric
## obs.model              15  -none-  numeric
## sim.model            1500  -none-  numeric
## pval.dist             705  -none-  numeric
## summary.dist          705  -none-  numeric
## pobs.dist             141  -none-  numeric
## psim.dist           14100  -none-  numeric
## bds.dist              282  -none-  numeric
## obs.dist              141  -none-  numeric
## sim.dist            14100  -none-  numeric
## pval.ideg             705  -none-  numeric
## summary.ideg          705  -none-  numeric
## pobs.ideg             141  -none-  numeric
## psim.ideg           14100  -none-  numeric
## bds.ideg              282  -none-  numeric
## obs.ideg              141  -none-  numeric
## sim.ideg            14100  -none-  numeric
## pval.espart           700  -none-  numeric
## summary.espart        700  -none-  numeric
## pobs.espart           140  -none-  numeric
## psim.espart         14000  -none-  numeric
## bds.espart            280  -none-  numeric
## obs.espart            140  -none-  numeric
## sim.espart          14000  -none-  numeric
## pval.triadcensus       80  -none-  numeric
## summary.triadcensus    80  -none-  numeric
## pobs.triadcensus       16  -none-  numeric
## psim.triadcensus     1600  -none-  numeric
## bds.triadcensus        32  -none-  numeric
## obs.triadcensus        16  -none-  numeric
## sim.triadcensus      1600  -none-  numeric
plot(fit_gwesp_all)

par(mfrow=c(2,2))
plot(fit_match_all)

plot(fit_gwesp_all)

dev.off()
## null device 
##           1

We now compare the general fit of the simulation on the observed number of edges, node density, number of triangles, and triad census. Unfortunately, this analysis shows that the models were not very good at predicting the observed network structure. We can see that our observed statistics (thick lines) often does not fall within the range of simulated values.